<!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="layout.html" />
  <xi:include href="macros.html" />
  <head>
    <title>$path ${_('(log)')}</title>
  </head>

  <body>
    <div id="content" class="log">
      <h1>${browser_path_links(path_links)}</h1>

      <form id="prefs" action="" method="get">
        <div>
          <input type="hidden" name="action" value="$mode" />
          <input type="hidden" name="revs" value="${str(revranges)}" py:if="revranges" />
          <div class="choice">
            <fieldset>
              <legend>${_('Revision Log Mode')}:</legend>
              <label>
                <input type="radio" id="stop_on_copy" name="mode"
                       value="stop_on_copy"
                       checked="${mode in (None, 'stop_on_copy') or None}" />
                ${_('Stop on copy')} 
              </label>
              <label>
                <input type="radio" id="follow_copy" name="mode"
                       value="follow_copy"
                       checked="${mode == 'follow_copy' or None}" />
                ${_('Follow copies')} 
              </label>
              <label>
                <input type="radio" id="path_history" name="mode"
                       value="path_history"
                       checked="${mode == 'path_history' or None}" />
                ${_('Show only adds and deletes')} 
              </label>
            </fieldset>
          </div>
          <label>
            <!--! FIXME: message_contains_tag, phrase_order -->
            ログの表示開始リビジョン:
            <input type="text" id="rev" name="rev" value="$rev" size="5" />
          </label>
          <label>
            <!--! FIXME: message_contains_tag, phrase_order -->
            遡って表示するリビジョン:
            <input type="text" id="stop_rev" name="stop_rev" value="$stop_rev" size="5" />
          </label>
          <br />
          <label>
            <!--! FIXME: message_contains_tag -->
            1ページあたり最大
            <input type="text" id="limit" name="limit" value="$limit" size="3" maxlength="3" />
            リビジョン表示する。
          </label>
          <br />
          <label>
            <input type="checkbox" id="verbose" name="verbose" checked="${verbose and 'checked' or None}" />
            ${_('Show full log messages')} 
          </label>
        </div>
        <div class="buttons">
          <input type="submit" value="${_('Update')}" />
        </div>
      </form>

      <div class="diff">
        <div class="legend" id="file-legend">
          <h3>${_('Legend')}:</h3>
          <dl>
            <dt class="add"></dt><dd>${_('Added')}</dd>
            <py:if test="mode == 'path_history'">
              <dt class="rem" ></dt><dd>${_('Removed')}</dd>
            </py:if>
            <dt class="mod"></dt><dd>${_('Modified')}</dd>
            <dt class="cp"></dt><dd>${_('Copied or renamed')}</dd>
          </dl>
        </div>
      </div>


      <form py:for="items in item_ranges" class="printableform" action="${href.changeset()}" method="get">
        <div class="buttons">
          <input type="submit" value="${_('View changes')}"
            title="${_('Diff from Old Revision to New Revision (select them below)')}" />
        </div>
        <table class="listing chglist">
          <thead>
            <tr>
              <th class="diff" title="${_('Old / New')}">${_('Diff')}</th>
              <th class="change"></th>
              <th class="rev">${_('Rev')}</th>
              <th class="chgset">${_('Chgset')}</th>
              <th class="date">${_('Date')}</th>
              <th class="author">${_('Author')}</th>
              <th class="summary"><py:if test="not verbose">${_('Log Message')}</py:if></th>
            </tr>
          </thead>
          <tbody>
            <tr py:if="not items" class="even">
              <td />
              <td />
              <td class="copyfrom_path" colspan="6">
                ${_('No revisions found')}
              </td>
            </tr>
            
            <py:for each="idx, item in enumerate(items)">
              <py:with vars="change = changes[item.rev];
                             is_separator = item.change is None;
                             chgset_context = context('changeset', change.rev);
                             chgset_view = 'CHANGESET_VIEW' in perm(chgset_context.resource);
                             odd_even = idx % 2 and 'odd' or 'even'">
                <!--! highlight copy or rename operations -->
                <tr py:if="not is_separator and item.get('copyfrom_path')" class="$odd_even">
                  <td />
                  <td class="copyfrom_path" colspan="7" style="padding-left: ${item.depth - 1}em">
                    <!--! FIXME: message_contains_tag -->
                    コピー元 <a href="${href.browser(item.path, rev=item.rev)}">$item.copyfrom_path</a>:
                  </td>
                </tr>

                <tr class="$odd_even" py:choose="">
                  <td class="diff" rowspan="${verbose and 2 or None}">
                    <input type="radio" name="old" value="${item.rev}@${item.path}"
                           checked="${idx == (len(items) - 1) or None}" title="${_('From r%(rev)s', rev=item.rev)}" />
                    <input type="radio" name="new" value="${item.rev}@${item.path}"
                           checked="${idx == 0 or None}" title="${_('To r%(rev)s', rev=item.rev)}" />
                  </td>
                  <py:when test="not is_separator">
                    <td class="change" style="padding-left: ${item.depth}em">
                      <a title="${_('View log starting at this revision')}" href="${href.log(item.path, rev=item.rev)}">
                        <span class="$item.change"></span>
                        <span class="comment">($item.change)</span>
                      </a>
                    </td>
                    <td class="rev">
                      <a title="${_('Browse at revision %(rev)s', rev=item.existing_rev)}" href="${href.browser(item.path, rev=item.existing_rev)}">
                        @$item.existing_rev</a>
                    </td>
                    <td class="chgset" py:choose="item.change">
                      <a py:when="'delete'" title="${_('View removal changeset [%(rev)s]', rev=item.rev)}" href="${href.changeset(item.rev)}">
                        [$item.rev]</a>
                      <a py:otherwise="" title="${_('View changeset [%(rev)s] for %(path)s', rev=item.rev, path=item.path)}" href="${href.changeset(item.rev, item.path)}">
                        [$item.rev]</a>
                    </td>
                    <td class="date" py:content="dateinfo(change.date)" />
                    <td class="author" py:content="authorinfo(change.author)" />
                    <td class="summary" py:choose="">
                      <py:when test="verbose or not chgset_view"></py:when>
                      <py:when test="wiki_format_messages">
                        ${wiki_to_oneliner(chgset_context, change.message, shorten=True)}
                      </py:when>
                      <py:otherwise>${shorten_line(change.message)}</py:otherwise>
                    </td>
                  </py:when>
                  <td colspan="6" class="separator" py:otherwise="" />
                </tr>

                <tr py:if="verbose and not is_separator" class="$odd_even verbose">
                  <py:choose> 
                    <td py:when="chgset_view" class="summary" colspan="6"
                        py:choose="" xml:space="preserve">
                      <py:when test="wiki_format_messages">
                        ${wiki_to_html(chgset_context, change.message, escape_newlines=True)}
                      </py:when>
                      <py:otherwise><pre>${change.message}</pre></py:otherwise>
                    </td>
                  </py:choose>
                </tr>

              </py:with>
            </py:for>
          </tbody>
        </table>

        <div py:if="len(items) &gt; 10 and len(item_ranges) == 1" class="buttons">
          <input type="submit" value="${_('View changes')}"
            title="${_('Diff from Old Revision to New Revision (select them below)')}" />
        </div>
      </form>

      <div id="help">
        <!--! FIXME: message_contains_tag --> 
        <strong>Note:</strong> リビジョンログについてのヘルプは <a href="${href.wiki('TracRevisionLog')}">TracRevisionLog</a> 
        を参照してください。 
      </div>

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