<!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">
<xi:include href="macros.html" />
<xi:include href="layout.html" />
<head><title>${_('All Project Roadmap')}</title></head>
<body>
<div id="content">
      <h1>${_('All Project 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="stats = milestone_stats[idx]">
            <h2><a href="${milestone.href}">
              ${_('Milestone')}: <em>${milestone.name}</em>
            </a></h2>
            <py:choose>
              <p py:when="milestone.completed" class="date">
                <!--! FIXME: message_contains_tag --> 
                ${dateinfo(milestone.completed)} に完了 
                (${format_date(milestone.completed)})
              </p>
              <p py:when="milestone.late" class="date">
                <!--! FIXME: message_contains_tag --> 
                <strong>完了期限から ${dateinfo(milestone.due)} 遅れ</strong>
                (${format_date(milestone.due)})
              </p>
              <p py:when="milestone.due" class="date">
                <!--! FIXME: message_contains_tag --> 
                あと ${dateinfo(milestone.due)} で完了期限 
                (${format_date(milestone.due)})
              </p>
              <p py:otherwise="" class="date">
                ${_('No date set')} 
              </p>
            </py:choose>
            <py:if test="stats['stats']['total_tickets'] > 0">
            <table class="progress">
              <tr>
                <td class="closed" style="width: ${stats['stats']['percent_closed']}%">
                  <a href="${milestone['queries']['closed_tickets']}"
                     title="${stats['stats']['closed_tickets']} of ${stats['stats']['total_tickets']} ticket closed"></a></td>
                <td class="open" style="width: ${stats['stats']['percent_active']}%">
                  <a href="${milestone['queries']['active_tickets']}"
                     title="${stats['stats']['active_tickets']} of ${stats['stats']['total_tickets']} ticket active"></a></td>
              </tr>
            </table>
            <p class="percent">${stats['stats']['percent_closed']}%</p>
            <dl>
              <dt>${_('Closed')} ${_('Tickets')}:</dt>
              <dd><a href="${milestone['queries']['closed_tickets']}">
                ${stats['stats']['closed_tickets']}</a></dd>
              <dt>${_('Active')} ${_('Tickets')}:</dt>
              <dd><a href="${milestone['queries']['active_tickets']}">
                ${stats['stats']['active_tickets']}</a></dd>
            </dl>
            </py:if>
          <div class="description">
            ${wiki_to_html(context(milestone.resource), milestone.description)}
          </div>
          </div>

        </li>
      </ul>
</div>
</body>
</html>
