<!--!  Copyright (C) 2006-2014 Edgewall Software

  This software is licensed as described in the file COPYING, which
  you should have received as part of this distribution. The terms
  are also available at http://trac.edgewall.com/license.html.

  This software consists of voluntary contributions made by many
  individuals. For the exact contribution history, see the revision
  history and logs, available at http://trac.edgewall.org/.
-->
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:i18n="http://genshi.edgewall.org/i18n">
  <xi:include href="layout.html" />
  <head>
    <title>Timeline</title>
  </head>

  <body>
    <div id="content" class="timeline">

      <h1>Timeline</h1>

      <form id="prefs" method="get" action="">
       <div i18n:msg="">
        <label>View changes from <input type="text" id="fromdate" class="trac-datepicker" size="10" name="from" value="${format_date(fromdate)}" /></label> <br />
        <label>going back <input type="text" size="3" name="daysback" value="$daysback" /> days</label><br />
        <label>by author <input type="text" size="16" name="authors" value="$authors" /></label>
       </div>
       <fieldset>
        <label py:for="filter in filters">
          <input type="checkbox" name="${filter.name}"
                 checked="${filter.enabled or None}"/> ${filter.label}
        </label>
       </fieldset>
       <div class="buttons">
         <input type="submit" name="update" value="${_('Update')}" />
       </div>
      </form>

      <py:for each="day, events in groupby(events, key=lambda e: format_date(e.date))">
        <h2>${day}: ${_("Today") if day == today else _("Yesterday") if day == yesterday else None}</h2>
        <dl py:for="unread, events in groupby(events, key=lambda e: lastvisit and lastvisit &lt; e.dateuid)"
            class="${'unread' if unread else None}">
          <py:for each="event in events"
            py:with="highlight = precision and precisedate and timedelta(0) &lt;= (event.date - precisedate) &lt; precision">
            <dt class="${classes(event.kind, highlight=highlight, unread=unread)}">
              <a href="${event.render('url', context)}" py:choose="">
                <py:when test="event.author"><i18n:msg params="time, title, author">
                  <span class="time">${format_time(event.date, 'short')}</span> ${event.render('title', context)
                    } by ${authorinfo(event.author)}
                </i18n:msg></py:when>
                <py:otherwise>
                  <span class="time">${format_time(event.date, 'short')}</span> ${event.render('title', context)}
                </py:otherwise>
              </a>
            </dt>
            <dd class="${classes(event.kind, highlight=highlight)}">
              ${event.render('description', context)}
            </dd>
          </py:for>
        </dl>
      </py:for>

      <div id="help" i18n:msg="">
        <strong>Note:</strong> See <a href="${href.wiki('TracTimeline')}">TracTimeline</a>
        for information about the timeline view.
      </div>

    </div>
  </body>
</html>
