<!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:i18n="http://genshi.edgewall.org/i18n"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <head>
    <title>Roadmap</title>
  </head>

  <body>
    <div id="content" class="roadmap">
      <h1>Roadmap</h1>

      <form id="prefs" method="get" action="">
        <div>
          <input type="checkbox" id="showcompleted" name="show" value="completed"
                 checked="${'completed' in show or None}" />
          <label for="showcompleted">Show completed milestones</label>
        </div>
        <div>
          <input type="checkbox" id="hidenoduedate" name="show" value="noduedate"
                 checked="${'noduedate' in show or None}" />
          <label for="hidenoduedate">Hide milestones with no due date</label>
        </div>
        <div class="buttons">
          <input type="submit" value="${_('Update')}" />
        </div>
      </form>

      <div class="milestones">
        <div py:for="idx, milestone in enumerate(milestones)" class="milestone">

          <div class="info" py:with="mstats = milestone_stats[idx]">
            <h2><a href="${href.milestone(milestone.name)}">
              Milestone: <em>${milestone.name}</em>
            </a></h2>
            <py:choose>
              <p py:when="milestone.completed" class="date">
                <i18n:msg params="duration, date">
                  Completed ${dateinfo(milestone.completed)} ago (${format_datetime(milestone.completed)})
                </i18n:msg>
              </p>
              <p py:when="milestone.is_late" class="date">
                <i18n:msg params="duration, date">
                  <strong>${dateinfo(milestone.due)} late</strong> (${format_datetime(milestone.due)})
                </i18n:msg>
              </p>
              <p py:when="milestone.due" class="date">
                <i18n:msg params="duration, date">
                  Due in ${dateinfo(milestone.due)} (${format_datetime(milestone.due)})
                </i18n:msg>
              </p>
              <p py:otherwise="" class="date">
                No date set
              </p>
            </py:choose>
            <xi:include href="progress_bar.html" py:if="mstats.stats.count"
                        py:with="stats = mstats.stats; interval_hrefs = mstats.interval_hrefs;
                                 stats_href = mstats.stats_href"/>
          </div>

          <div class="description" xml:space="preserve">
            ${wiki_to_html(context(milestone.resource), milestone.description)}
          </div>

        </div>
      </div>

      <div py:if="'MILESTONE_CREATE' in perm" class="buttons">
       <form method="get" action="${href.milestone()}"><div>
        <input type="hidden" name="action" value="new" />
        <input type="submit" value="${_('Add new milestone')}" />
       </div></form>
      </div>

      <div id="help" i18n:msg=""><strong>Note:</strong> See
        <a href="${href.wiki('TracRoadmap')}">TracRoadmap</a> for help on using
        the roadmap.
      </div>

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