packages feed

informative-0.1.0.1: informative.htm

<h1 #header>#{page}
<div #leftnav>
  <ul .leftnav title="Suggested">
    <li>
      <a href=@{toParent (ArticleR "main")}>Main page
  <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}
  $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, Error)
        <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>
        $if idx > 1
          <a href=@{toParent $ EditR page $ fromIntegral rid}>up
        $if idx < length sects
          <a href=@{toParent $ EditR page $ fromIntegral rid}>down
        <a href=@{toParent $ EditR page $ fromIntegral rid}>insert
        <a href=@{toParent $ EditR page $ 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}