Commits

Steve Losh committed 0ce247a

More jinja conversion.

Comments (0)

Files changed (8)

letterpress/archiveentries.tmpl

+{% if archives %}
+    {% for archive in archives %}
+        <a href="{{ url }}archive/{{ node|short }}{{ archive.extension }}">{{ archive.type|escape }}</a>
+    {% endfor %}
+{% endif %}

letterpress/base.tmpl

 <body>
 
     <div id="page-header" class="wrap">
-        <a href="{{  url  }}summary{ sessionvars%urlparameter }">{{  repo|escape  }}</a>
+        <a href="{{  url  }}summary{% include "urlparams" %}">{{  repo|escape  }}</a>
     </div>
 
     <div id="navigation">
         <form id="repo-search" action="{{  url  }}log">
-            { sessionvars%hiddenformentry }
+            {% include "hiddenformentries" %}
             <span>search &rarr; </span>
             <input type="text" name="rev" />
         </form>
 
         <ul>
-            <li><a href="{{  url  }}summary{ sessionvars%urlparameter }">summary</a></li>
-            <li><a href="{{  url  }}shortlog{ sessionvars%urlparameter }">shortlog</a></li>
-            <li><a href="{{  url  }}log{ sessionvars%urlparameter }">changelog</a></li>
-            <li><a href="{{  url  }}graph{ sessionvars%urlparameter }">graph</a></li>
-            <li><a href="{{  url  }}tags{ sessionvars%urlparameter }">tags</a></li>
-            <li><a href="{{  url  }}branches{ sessionvars%urlparameter }">branches</a></li>
-            <li><a href="{{  url  }}file/{{ node|short }}{ sessionvars%urlparameter }">files</a></li>
-            <li>{ archives%archiveentry }</li>
+            <li><a href="{{  url  }}summary{% include "urlparams" %}">summary</a></li>
+            <li><a href="{{  url  }}shortlog{% include "urlparams" %}">shortlog</a></li>
+            <li><a href="{{  url  }}log{% include "urlparams" %}">changelog</a></li>
+            <li><a href="{{  url  }}graph{% include "urlparams" %}">graph</a></li>
+            <li><a href="{{  url  }}tags{% include "urlparams" %}">tags</a></li>
+            <li><a href="{{  url  }}branches{% include "urlparams" %}">branches</a></li>
+            <li><a href="{{  url  }}file/{{ node|short }}{% include "urlparams" %}">files</a></li>
+            <li>{% include "archiveentries" %}</li>
         </ul>
     </div>
 
     <div id="content" class="wrap">
-    
-        <h1>Repository Summary</h1>
-
-        <ul class="info-list">
-            <li>
-                <span class="key">Description:</span>
-                <span class="value">{{ desc }}</span>
-            </li>
-            <li>
-                <span class="key">Owner:</span>
-                <span class="value">{{ owner|obfuscate }}</span>
-            </li>
-            <li>
-                <span class="key">Last change:</span>
-                <span class="value">{{ lastchange|rfc822date }}</span>
-            </li>
-        </ul>
-
-        <h2><a href="{{  url  }}shortlog{ sessionvars%urlparameter }">Recent Changes</a></h2>
-        <table class="shortlog">
-            {{ shortlog }}
-            <tr class="more">
-                <td colspan="4">
-                    <a class="list" href="{{  url  }}shortlog{ sessionvars%urlparameter }">more&hellip;</a>
-                </td>
-            </tr>
-        </table>
-
-        <div class="split">
-        
-            <div class="split-left">
-                <h2><a href="{{  url  }}tags{ sessionvars%urlparameter }">Tags</a></h2>
-                <table class="tags">
-                    {{ tags }}
-                    <tr class="more">
-                        <td colspan="3">
-                            <a class="list" href="{{  url  }}tags{ sessionvars%urlparameter }">more&hellip;</a>
-                        </td>
-                    </tr>
-                </table>
-            </div>
-        
-            <div class="split-right">
-                <h2><a href="{{  url  }}branches{ sessionvars%urlparameter }">Branches</a></h2>
-                <table class="branches">
-                    {% for branch in branches() %}
-                        <tr class="parity{{ branch.parity }}">
-                            <td class="age">
-                                {{ branch.date|age }} ago
-                            </td>
-                            <td class="node">
-                                <a class="list" href="{{ url }}shortlog/{{ branch.node|short }}{ sessionvars%urlparameter }">{{ branch.node|short }}</a>
-                            </td>
-                            <td class="branch {{ branch.status }}">
-                                {{ branch.branch|escape }}
-                            </td>
-                            <td class="links">
-                                <a href="{{ url }}changeset/{{ branch.node|short }}{ sessionvars%urlparameter }">changeset</a>
-                                &ndash;
-                                <a href="{{ url }}log/{{ branch.node|short }}{ sessionvars%urlparameter }">changelog</a>
-                                &ndash;
-                                <a href="{{ url }}file/{{ branch.node|short }}{ sessionvars%urlparameter }">files</a>
-                            </td>
-                        </tr>
-                    {% endfor %}
-                    <tr class="more">
-                        <td colspan="4">
-                            <a class="list"  href="#">more&hellip;</a>
-                        </td>
-                    </tr>
-                </table>
-            </div>
-    
-        </div>
-
+        {% block content %}
+            
+        {% endblock %}
     </div>
 
     <div id="footer">

letterpress/branchtable.tmpl

+<table class="branches">
+    {% for branch in branches() %}
+        <tr class="parity{{ branch.parity }}">
+            <td class="age">
+                {{ branch.date|age }} ago
+            </td>
+            <td class="node">
+                <a class="list" href="{{ url }}shortlog/{{ branch.node|short }}{% include "urlparams" %}">{{ branch.node|short }}</a>
+            </td>
+            <td class="branch {{ branch.status }}">
+                {{ branch.branch|escape }}
+            </td>
+            <td class="links">
+                <a href="{{ url }}changeset/{{ branch.node|short }}{% include "urlparams" %}">changeset</a>
+                &ndash;
+                <a href="{{ url }}log/{{ branch.node|short }}{% include "urlparams" %}">changelog</a>
+                &ndash;
+                <a href="{{ url }}file/{{ branch.node|short }}{% include "urlparams" %}">files</a>
+            </td>
+        </tr>
+    {% endfor %}
+    <tr class="more">
+        <td colspan="4">
+            <a class="list"  href="#">more&hellip;</a>
+        </td>
+    </tr>
+</table>

letterpress/filerevision.tmpl

 <body>
 
 <div class="page_header">
-<a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / file revision
+<a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{% include "urlparams" %}">{repo|escape}</a> / file revision
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+<a href="{url}summary{% include "urlparams" %}">summary</a> |
+<a href="{url}shortlog{% include "urlparams" %}">shortlog</a> |
+<a href="{url}log{% include "urlparams" %}">changelog</a> |
+<a href="{url}graph{% include "urlparams" %}">graph</a> |
+<a href="{url}tags{% include "urlparams" %}">tags</a> |
+<a href="{url}branches{% include "urlparams" %}">branches</a> |
+<a href="{url}file/{node|short}{path|urlescape}{% include "urlparams" %}">files</a> |
+<a href="{url}rev/{node|short}{% include "urlparams" %}">changeset</a> |
 file |
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
-<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+<a href="{url}log/{node|short}/{file|urlescape}{% include "urlparams" %}">revisions</a> |
+<a href="{url}annotate/{node|short}/{file|urlescape}{% include "urlparams" %}">annotate</a> |
+<a href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">diff</a> |
 <a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a><br/>
 </div>
 
 {branch%filerevbranch}
 <tr>
  <td>changeset {rev}</td>
- <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
+ <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{% include "urlparams" %}">{node|short}</a></td></tr>
 {parent%filerevparent}
 {child%filerevchild}
 <tr>

letterpress/hiddenformentries.tmpl

+{% for var in sessionvars %}
+    <input type="hidden" name="{{ var.name }}" value="{{ var.value|escape }}" />
+{% endfor %}
 navigation = navigation.tmpl
 search = search.tmpl
 changelog = changelog.tmpl
+branchtable = jinja2:branchtable.tmpl
 summary = jinja2:summary.tmpl
 error = error.tmpl
 notfound = notfound.tmpl
 base = base.tmpl
-naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navgraphentry = '<a href="{url}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
-filedifflink = '<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+naventry = '<a href="{url}log/{node|short}{% include "urlparams" %}">{label|escape}</a> '
+navshortentry = '<a href="{url}shortlog/{node|short}{% include "urlparams" %}">{label|escape}</a> '
+navgraphentry = '<a href="{url}graph/{node|short}{% include "urlparams" %}">{label|escape}</a> '
+filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{% include "urlparams" %}">{label|escape}</a> '
+filedifflink = '<a href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">{file|escape}</a> '
 filenodelink = '
   <tr class="parity{parity}">
-    <td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
+    <td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">{file|escape}</a></td>
     <td></td>
     <td class="link">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
-      <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+      <a href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">file</a> |
+      <a href="{url}annotate/{node|short}/{file|urlescape}{% include "urlparams" %}">annotate</a> |
+      <a href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">diff</a> |
+      <a href="{url}log/{node|short}/{file|urlescape}{% include "urlparams" %}">revisions</a>
     </td>
   </tr>'
 filenolink = '
   <tr class="parity{parity}">
-    <td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
+    <td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">{file|escape}</a></td>
     <td></td>
     <td class="link">
       file |
       annotate |
-      <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+      <a href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">diff</a> |
+      <a href="{url}log/{node|short}/{file|urlescape}{% include "urlparams" %}">revisions</a>
     </td>
   </tr>'
 fileellipses = '...'
     <td style="font-family:monospace"></td>
     <td style="font-family:monospace"></td>
     <td>
-      <a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>
-      <a href="{url}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">{emptydirs|escape}</a>
+      <a href="{url}file/{node|short}{path|urlescape}{% include "urlparams" %}">{basename|escape}</a>
+      <a href="{url}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{% include "urlparams" %}">{emptydirs|escape}</a>
     </td>
     <td class="link">
-      <a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
+      <a href="{url}file/{node|short}{path|urlescape}{% include "urlparams" %}">files</a>
     </td>
   </tr>'
 fileentry = '
     <td style="font-family:monospace" align=right>{date|isodate}</td>
     <td style="font-family:monospace" align=right>{size}</td>
     <td class="list">
-      <a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>
+      <a class="list" href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">{basename|escape}</a>
     </td>
     <td class="link">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+      <a href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">file</a> |
+      <a href="{url}log/{node|short}/{file|urlescape}{% include "urlparams" %}">revisions</a> |
+      <a href="{url}annotate/{node|short}/{file|urlescape}{% include "urlparams" %}">annotate</a>
     </td>
   </tr>'
 filerevision = filerevision.tmpl
 annotateline = '
   <tr style="font-family:monospace" class="parity{parity}">
     <td class="linenr" style="text-align: right;">
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
+      <a href="{url}annotate/{node|short}/{file|urlescape}{% include "urlparams" %}#l{targetline}"
          title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
     </td>
     <td><pre><a class="linenr" href="#{lineid}" id="{lineid}">{linenumber}</a></pre></td>
   <tr>
     <th class="parent">parent {rev}:</th>
     <td class="parent">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a href="{url}rev/{node|short}{% include "urlparams" %}">{node|short}</a>
     </td>
   </tr>'
 changesetbranch = '<tr><td>branch</td><td>{name}</td></tr>'
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a class="list" href="{url}rev/{node|short}{% include "urlparams" %}">{node|short}</a>
     </td>
   </tr>'
 filerevbranch = '<tr><td>branch</td><td>{name}</td></tr>'
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a class="list" href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">
         {rename%filerename}{node|short}
       </a>
     </td>
   </tr>'
 filerename = '{file|escape}@'
-filelogrename = '| <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">base</a>'
+filelogrename = '| <a href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">base</a>'
 fileannotateparent = '
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a class="list" href="{url}annotate/{node|short}/{file|urlescape}{% include "urlparams" %}">
         {rename%filerename}{node|short}
       </a>
     </td>
 changelogchild = '
   <tr>
     <th class="child">child {rev}:</th>
-    <td class="child"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="child"><a href="{url}rev/{node|short}{% include "urlparams" %}">{node|short}</a></td>
   </tr>'
 changesetchild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a class="list" href="{url}rev/{node|short}{% include "urlparams" %}">{node|short}</a>
     </td>
   </tr>'
 filerevchild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+      <a class="list" href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">{node|short}</a></td>
     </tr>'
 fileannotatechild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+      <a class="list" href="{url}annotate/{node|short}/{file|urlescape}{% include "urlparams" %}">{node|short}</a></td>
     </tr>'
 tags = tags.tmpl
 tagentry = tagentry.tmpl
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a class="list" href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">
         {node|short}
       </a>
     </td>
 filelogparent = '
   <tr>
     <td align="right">parent {rev}:&nbsp;</td>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">{node|short}</a></td>
   </tr>'
 filediffchild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
+      <a class="list" href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">{node|short}</a>
     </td>
   </tr>'
 filelogchild = '
   <tr>
     <td align="right">child {rev}:&nbsp;</td>
-    <td><a href="{url}file{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url}file{node|short}/{file|urlescape}{% include "urlparams" %}">{node|short}</a></td>
   </tr>'
 shortlog = jinja2:shortlog.tmpl
 graph = graph.tmpl
   <tr class="parity{parity}">
     <td class="age"><i>{date|age} ago</i></td>
     <td>
-      <a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a class="list" href="{url}rev/{node|short}{% include "urlparams" %}">
         <b>{desc|strip|firstline|escape|nonempty}</b>
       </a>
     </td>
     <td class="link">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> {rename%filelogrename}</td>
+      <a href="{url}file/{node|short}/{file|urlescape}{% include "urlparams" %}">file</a>&nbsp;|&nbsp;<a href="{url}diff/{node|short}/{file|urlescape}{% include "urlparams" %}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/{node|short}/{file|urlescape}{% include "urlparams" %}">annotate</a> {rename%filelogrename}</td>
     </tr>'
-archiveentry = '<a href="{url}archive/{node|short}{extension}">{type|escape}</a> '
+archiveentries = jinja2:archiveentries.tmpl
 indexentry = '
   <tr class="parity{parity}">
     <td>
-      <a class="list" href="{url}{sessionvars%urlparameter}">
+      <a class="list" href="{url}{% include "urlparams" %}">
         <b>{name|escape}</b>
       </a>
     </td>
   </tr>\n'
 indexarchiveentry = ' <a href="{url}archive/{node|short}{extension}">{type|escape}</a> '
 index = index.tmpl
-urlparameter = '{separator}{name}={value|urlescape}'
-hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
+urlparams = jinja2:urlparams.tmpl
+hiddenformentries = jinja2:hiddenformentries.tmpl

letterpress/summary.tmpl

 {% extends "base" %}
 
-{% set page_title = "Summary" %}
+{% set page_title = "Summary" %}
+
+{% block content %}
+<h1>Repository Summary</h1>
+
+<ul class="info-list">
+    <li>
+        <span class="key">Description:</span>
+        <span class="value">{{ desc }}</span>
+    </li>
+    <li>
+        <span class="key">Owner:</span>
+        <span class="value">{{ owner|obfuscate }}</span>
+    </li>
+    <li>
+        <span class="key">Last change:</span>
+        <span class="value">{{ lastchange|rfc822date }}</span>
+    </li>
+</ul>
+
+<h2><a href="{{  url  }}shortlog{% include "urlparams" %}">Recent Changes</a></h2>
+<table class="shortlog">
+    {{ shortlog }}
+    <tr class="more">
+        <td colspan="4">
+            <a class="list" href="{{  url  }}shortlog{% include "urlparams" %}">more&hellip;</a>
+        </td>
+    </tr>
+</table>
+
+<div class="split">
+
+    <div class="split-left">
+        <h2><a href="{{  url  }}tags{% include "urlparams" %}">Tags</a></h2>
+        <table class="tags">
+            {{ tags }}
+            <tr class="more">
+                <td colspan="3">
+                    <a class="list" href="{{  url  }}tags{% include "urlparams" %}">more&hellip;</a>
+                </td>
+            </tr>
+        </table>
+    </div>
+
+    <div class="split-right">
+        <h2><a href="{{  url  }}branches{% include "urlparams" %}">Branches</a></h2>
+        {% include "branchtable" %}
+    </div>
+
+</div>
+{% endblock %}

letterpress/urlparams.tmpl

+{% for var in sessionvars %}{{ var.separator }}{{ var.name }}={{ var.value|urlescape }}{% endfor %}