Commits

Steve Losh committed 38d3fe4

Start switching to jinja to preserve my sanity.

Comments (0)

Files changed (7)

letterpress/base.tmpl

+<?xml version="1.0" encoding="{{  encoding  }}"?>
+<!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" xml:lang="en-US" lang="en-US">
+
+<head>
+    <link rel="icon" href="{{  staticurl  }}hgicon.png" type="image/png" />
+    <meta name="robots" content="index, nofollow"/>
+    
+    <link rel="stylesheet" href="{{  staticurl  }}style-letterpress.css" type="text/css" />
+    <link rel="stylesheet" href="{{  staticurl  }}aal.css" type="text/css" />
+
+    <title>{{ repo|escape  }}: {{  page_title  }} </title>
+
+    <link rel="alternate" type="application/atom+xml"
+          href="{{  url  }}atom-log" title="Atom feed for {{  repo|escape  }}"/>
+    <link rel="alternate" type="application/rss+xml"
+          href="{{  url  }}rss-log" title="RSS feed for {{  repo|escape  }}"/>
+</head>
+
+<body>
+
+    <div id="page-header" class="wrap">
+        <a href="{{  url  }}summary{ sessionvars%urlparameter }">{{  repo|escape  }}</a>
+    </div>
+
+    <div id="navigation">
+        <form id="repo-search" action="{{  url  }}log">
+            { sessionvars%hiddenformentry }
+            <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>
+        </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>
+
+    </div>
+
+    <div id="footer">
+        <p id="footer-links">
+            <a href="http://mercurial.selenic.com/">hg</a> &ndash;
+            <a href="{{ url }}rss-log">rss</a> /
+            <a href="{{ url }}atom-log">atom</a>
+        </p>
+        <p id="motd">
+            {{ motd }}
+            &nbsp;
+        </p>
+    </div>
+
+</body>
+
+</html>

letterpress/footer.tmpl

-<div id="footer">
-    <p id="footer-links">
-        <a href="http://mercurial.selenic.com/">hg</a> &ndash;
-        <a href="{url}rss-log">rss</a> /
-        <a href="{url}atom-log">atom</a>
-    </p>
-    <p id="motd">
-        {motd}
-        &nbsp;
-    </p>
-</div>
-
-</body>
-</html>

letterpress/header.tmpl

-<?xml version="1.0" encoding="{encoding}"?>
+<?xml version="1.0" encoding="{{ encoding }}"?>
 <!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" xml:lang="en-US" lang="en-US">
 
 <head>
-    <link rel="icon" href="{staticurl}hgicon.png" type="image/png" />
+    <link rel="icon" href="{{ staticurl }}hgicon.png" type="image/png" />
     <meta name="robots" content="index, nofollow"/>
     
-    <link rel="stylesheet" href="{staticurl}style-letterpress.css" type="text/css" />
-    <link rel="stylesheet" href="{staticurl}aal.css" type="text/css" />
+    <link rel="stylesheet" href="{{ staticurl }}style-letterpress.css" type="text/css" />
+    <link rel="stylesheet" href="{{ staticurl }}aal.css" type="text/css" />
 
 default = 'summary'
 mimetype = 'text/html; charset={encoding}'
-header = header.tmpl
+header = jinja2:header.tmpl
 footer = footer.tmpl
+navigation = navigation.tmpl
 search = search.tmpl
 changelog = changelog.tmpl
-summary = summary.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> '
     <td align="right">child {rev}:&nbsp;</td>
     <td><a href="{url}file{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
-shortlog = shortlog.tmpl
+shortlog = jinja2:shortlog.tmpl
 graph = graph.tmpl
 tagtag = '<span class="tagtag" title="{name}">{name}</span> '
 branchtag = '<span class="branchtag" title="{name}">{name}</span> '

letterpress/navigation.tmpl

+<div id="navigation">
+    <form id="repo-search" action="{url}log">
+        {sessionvars%hiddenformentry}
+        <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>
+    </ul>
+</div>

letterpress/shortlog.tmpl

-{header}
-<title>{repo|escape}: Shortlog</title>
-<link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-<link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
-</head>
+{% extends "base" %}
+
 <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> / shortlog
 </div>
 
-<form action="{url}log">
-{sessionvars%hiddenformentry}
-<div class="search">
-<input type="text" name="rev"  />
-</div>
-</form>
-<div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-shortlog |
-<a href="{url}log/{rev}{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}{sessionvars%urlparameter}">files</a>{archives%archiveentry}
-<br/>
-{changenav%navshortentry}<br/>
-</div>
+
+{navigation}
+
+{changenav%navshortentry}
 
 <div class="title">&nbsp;</div>
 <table cellspacing="0">
 </div>
 
 {footer}
+
+{% block content %}
+    omg
+{% endblock %}
+
+{% block head %}
+    win
+{% endblock %}

letterpress/summary.tmpl

-{header}
-    <title>{repo|escape}: Summary</title>
+{% extends "base" %}
 
-    <link rel="alternate" type="application/atom+xml"
-          href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml"
-          href="{url}rss-log" title="RSS feed for {repo|escape}"/>
-</head>
-
-
-<body>
-
-<div id="page-header" class="wrap">
-    <a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a>
-</div>
-
-<div id="navigation">
-    <form id="repo-search" action="{url}log">
-        {sessionvars%hiddenformentry}
-        <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>
-    </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">
-                {branches%branchentry}
-                <tr class="more">
-                    <td colspan="4">
-                        <a class="list"  href="#">more&hellip;</a>
-                    </td>
-                </tr>
-            </table>
-        </div>
-    
-    </div>
-
-</div>
-
-{footer}
+{% set page_title = "Summary" %}