<!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" />
  <xi:include href="macros.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="showall" name="show" value="all"
                 checked="${showall or None}" />
          <label for="showall">Show already completed milestones</label>
        </div>
        <div class="buttons">
          <input type="submit" value="${_('Update')}" />
        </div>
      </form>

      <ul class="milestones">
        <li 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">
                Completed ${dateinfo(milestone.completed)} ago
                (${format_date(milestone.completed)})
              </p>
              <p py:when="milestone.is_late" class="date">
                <strong>${dateinfo(milestone.due)} late</strong>
                (${format_date(milestone.due)})
              </p>
              <p py:when="milestone.due" class="date">
                Due in ${dateinfo(milestone.due)}
                (${format_date(milestone.due)})
              </p>
              <p py:otherwise="" class="date">
                No date set
              </p>
            </py:choose>
            <py:if test="mstats.stats.count">${progress_bar(mstats.stats, mstats.interval_hrefs, stats_href=mstats.stats_href)}</py:if>
          </div>

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

        </li>
      </ul>

      <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>
