packages feed

informative-0.1.0.4: informative.htm

<h1 #header>#{page}
<div #leftnav>
  <ul .leftnav title="Suggested">
    $forall (Entity _ sugg) <- suggs
      <li>
        <a href=@{toParent $ ArticleR $ wikisuggPage sugg}>#{wikisuggCaption sugg}
  <ul .leftnav title="Actions">
    $if loggedIn
      <li>
        <a href=@{authR LogoutR}>Logout
    $else
      <li>
        <a href=@{authR LoginR}>Login
<div #content>
  $maybe msg <- mmsg
    <div .hint>
      #{msg}
  $if not (null sects)
    $with (idx, (rid, sect, kind)) <- head sects
      $if ((mayEdit == Authorized) && (rid >= 0))
        <div .edit>
          <a href=@{toParent $ PrependR $ fromIntegral rid}>insert
  $forall (idx, (rid, sect, kind)) <- sects
    $case (sect, kind)
      $of (Left c, Article)
        <div .content>
          #{c}
      $of (Left c, Hint)
        <div .hint>
          #{c}
      $of (Left c, _)
        <div .error>
          #{c}
      $of (Right [], _)
        <div .error>
          Empty table.
      $of (Right rows, Table)
        <div .table>
          <table>
            <thead>
              $forall h <- head rows
                <th>#{h}
            $forall cols <- tail rows
              <tr>
                $forall c <- cols
                  <td>#{c}
      $of (Right rows, Mapping)
        <div .mapping>
          <table>
            $forall cols <- rows
              <tr>
                $forall c <- cols
                  <td>#{c}
    $if ((mayEdit == Authorized) && (rid < 0))
      <div .edit>
        <a href=@{toParent $ CreateR page}>create
    $if ((mayEdit == Authorized) && (rid >= 0))
      <div .edit>
        $if idx > 1
          <form method=post action=@{toParent $ UpR $ fromIntegral rid}>
            <button .linkbutton>up
        $if idx < length sects
          <form method=post action=@{toParent $ DownR $ fromIntegral rid}>
            <button .linkbutton>down
        $if length sects > 1
          <form method=post action=@{toParent $ DeleteR $ fromIntegral rid}>
            <button .linkbutton>delete
        <a href=@{toParent $ InsertR $ fromIntegral rid}>insert
        <a href=@{toParent $ EditR $ fromIntegral rid}>edit
  <div .table>
    <table>
      <thead>
        <th>Older versions
        <th>Editor
        <th>Timestamp
      $if null edits
        <tr>
          <td>#{page}
          <td>nobody
          <td>never
      $else
        $with (i, editor, stamp) <- head edits
          <tr>
            <td>
              <a href=@{toParent $ ArticleR page}>#{page}
            <td>#{editor}
            <td>#{formatTime defaultTimeLocale "%Y-%m-%d %H:%M:%S %Z" stamp}
        $forall (i, editor, stamp) <- tail edits
          <tr>
            <td>
              <a href=@{toParent $ ArticleIdR $ fromIntegral i}>#{page}
            <td>#{editor}
            <td>#{formatTime defaultTimeLocale "%Y-%m-%d %H:%M:%S %Z" stamp}