bloodhound-trac / trac / wiki / templates / wiki_view.html

Full commit
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns=""
      py:with="modify_perm = 'WIKI_MODIFY' in perm(page.resource);
               admin_perm = 'WIKI_ADMIN' in perm(page.resource);
               is_not_latest = page.exists and page.version != latest_version">
  <xi:include href="layout.html" />
    <title py:if="title">$title</title>
    <meta py:if="version or == 'trac'" name="ROBOTS" content="NOINDEX, NOFOLLOW" />
    <link py:if="admin_perm or (not page.readonly and modify_perm)" rel="alternate" type="application/x-wiki"
          href="${, action='edit', version=page.version if is_not_latest else None)}"
          title="${_('Revert page to this version') if is_not_latest else _('Edit this page')}"/>
    <script type="text/javascript">
      jQuery(document).ready(function($) {
        $("#content").find("h1,h2,h3,h4,h5,h6").addAnchor(_("Link to this section"));
        $("#content").find(".wikianchor").each(function() {
          $(this).addAnchor(babel.format(_("Link to #%(id)s"), {id: $(this).attr('id')}));
        $(".foldable").enableFolding(true, true);

    <div id="content" class="wiki">

      <py:if test="version">
        <br />
        <table id="info" summary="Revision info">
            <tr><th scope="row" i18n:msg="version, author, date">
               Version $page.version (modified by ${authorinfo(}, ${pretty_dateinfo(page.time)})
               (<a href="${, action='diff', version=page.version)}">diff</a>)
            <tr><td class="message" xml:space="preserve">
              ${wiki_to_html(context, page.comment or '--')}

      <div class="wikipage searchable" py:choose="" xml:space="preserve">
        <py:when test="page.exists">
          <div id="wikipage" class="trac-content" py:content="wiki_to_html(context, text)" />
            last_modification = (page.comment and
                 _('Version %(version)s by %(author)s: %(comment)s',
                   version=page.version, author=format_author(, comment=page.comment) or
                 _('Version %(version)s by %(author)s',
                   version=page.version, author=format_author(
          <div py:if="not version" class="trac-modifiedby">
            <span i18n:msg="reldate">
              <a href="${, action='diff', version=page.version)}"
                 title="$last_modification">Last modified</a> ${pretty_dateinfo(page.time)}
            <span class="trac-print" i18n:msg="date">Last modified on ${format_datetime(page.time)}</span>
          <p i18n:msg="name">The page ${name_of(page.resource)} does not exist. You can create it here.</p>
          <py:if test="higher">
            <p>You could also create the same page higher in the hierarchy:</p>
              <li py:for="markup in higher">${markup}</li>

      <xi:include href="list_of_attachments.html"
                  py:with="alist = attachments; compact = True; foldable = True"/>

      <py:with vars="delete_perm = 'WIKI_DELETE' in perm(page.resource);
                     rename_perm = 'WIKI_RENAME' in perm(page.resource)">
        <py:if test="admin_perm or (not page.readonly and (modify_perm or delete_perm))">
          <div class="buttons">
            <py:if test="modify_perm">
              <form method="get" action="${}" id="modifypage">
                  <input type="hidden" name="action" value="edit" />
                    <py:when test="is_not_latest">
                      <input type="hidden" name="version" value="${page.version}"/>
                      <input type="submit" value="${_('Revert to this version')}"/>
                    <py:when test="page.exists">
                      <input type="submit" value="${_('Edit this page')}" accesskey="e" />
                      <input type="submit" value="${_('Create this page')}" accesskey="e" />
                      <div py:if="templates" id="template">
                        <label for="template">Using the template:</label>
                        <select name="template">
                          <option selected="${not default_template in templates or None}"
                                  value="">(blank page)</option>
                          <option py:for="t in sorted(templates)" value="$t"
                                  selected="${t == default_template or None}">$t</option>
              <py:if test="page.exists">
                <xi:include href="attach_file_form.html" py:with="alist = attachments"/>
            <form method="get" action="${}" id="rename" py:if="page.exists and rename_perm">
                <input type="hidden" name="action" value="rename" />
                <input type="submit" value="${_('Rename page')}" />
            <form method="get" action="${}" py:if="page.exists and delete_perm">
              <div id="delete">
                <input type="hidden" name="action" value="delete" />
                <input type="hidden" name="version" value="$page.version" />
                <py:if test="page.version == latest_version">
                  <input type="submit" name="delete_version" value="${_('Delete this version')}" />
                <input type="submit" value="${_('Delete page')}" />

      <div class="wikipage searchable" py:if="not page.exists and related">
        <p>The following pages have a name similar to this page, and may be related:</p>
          <li py:for="markup in related">${markup}</li>