packages feed

informative-0.1.0.27: 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, fmt)) <- head sects
      $if ((mayEdit == Authorized) && (rid /= "/new/"))
        <div .edit>
          <a href=@{toParent $ PrependR rid}>insert
  $forall (idx, (rid, sect, kind, fmt)) <- sects
    $case (sect, kind, fmt)
      $of (Left c, Article, Source lg ln)
        <div .sourceContent .source-#{toClassname lg}>
          <div .titlehead>
            <div .langhead>
              #{prettify $ toClassname lg}
          #{c}
      $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 == "/new/"))
      <div .edit>
        <a href=@{toParent $ CreateR page}>create
    $if ((mayEdit == Authorized) && (rid /= "/new/"))
      <div .edit>
        $if idx > 1
          <form method=post action=@{toParent $ UpR  rid}>
            <button .linkbutton>up
        $if idx < length sects
          <form method=post action=@{toParent $ DownR rid}>
            <button .linkbutton>down
        $if length sects > 1
          <form method=post action=@{toParent $ DeleteR rid}>
            <button .linkbutton>delete
        <a href=@{toParent $ InsertR rid}>insert
        <a href=@{toParent $ EditR 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 i}>#{page}
            <td>#{editor}
            <td>#{formatTime defaultTimeLocale "%Y-%m-%d %H:%M:%S %Z" stamp}