[PATCH 2 of 3 V4] hgweb, spartan: add "URL breadcrumbs"

Angel Ezquerra angel.ezquerra at gmail.com
Sat Dec 22 18:05:20 CST 2012


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1356054012 -3600
# Node ID 1d3552cce123de607d7fe2c49a9b6426a0416b32
# Parent  320bd4ab1b2f83a8deea10d8a2ca8c80ed49058f
hgweb, spartan: add "URL breadcrumbs"

This change adds a "URL breadcrumb"  to the "title" of the pages on the spartan
template. By title I mean the first line that is shown right below the page
selection row, which shows the name of the page that is being viewed, along with
some additional information.

In doing so it standarizes those "titles" which now follow the pattern:

URL breadcumb / page details

diff --git a/mercurial/templates/spartan/branches.tmpl b/mercurial/templates/spartan/branches.tmpl
--- a/mercurial/templates/spartan/branches.tmpl
+++ b/mercurial/templates/spartan/branches.tmpl
@@ -18,7 +18,7 @@
 <a type="application/atom+xml" href="{url}atom-branches">atom</a>
 </div>
 
-<h2>branches:</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / branches</h2>
 
 <ul id="tagEntries">
 {entries%branchentry}
diff --git a/mercurial/templates/spartan/changelog.tmpl b/mercurial/templates/spartan/changelog.tmpl
--- a/mercurial/templates/spartan/changelog.tmpl
+++ b/mercurial/templates/spartan/changelog.tmpl
@@ -19,7 +19,7 @@
 <a type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}">atom</a>
 </div>
 
-<h2>changelog for {repo|escape}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog</h2>
 
 <form action="{url}log">
 {sessionvars%hiddenformentry}
diff --git a/mercurial/templates/spartan/changeset.tmpl b/mercurial/templates/spartan/changeset.tmpl
--- a/mercurial/templates/spartan/changeset.tmpl
+++ b/mercurial/templates/spartan/changeset.tmpl
@@ -15,7 +15,7 @@
 <a href="{url}help{sessionvars%urlparameter}">help</a>
 </div>
 
-<h2>changeset: {desc|strip|escape|firstline|nonempty}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset: {desc|strip|escape|firstline|nonempty}</h2>
 
 <table id="changesetEntry">
 <tr>
diff --git a/mercurial/templates/spartan/fileannotate.tmpl b/mercurial/templates/spartan/fileannotate.tmpl
--- a/mercurial/templates/spartan/fileannotate.tmpl
+++ b/mercurial/templates/spartan/fileannotate.tmpl
@@ -17,7 +17,7 @@
 <a href="{url}help{sessionvars%urlparameter}">help</a>
 </div>
 
-<h2>Annotate {file|escape}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / annotate {file|escape}</h2>
 
 <table>
 <tr>
diff --git a/mercurial/templates/spartan/filediff.tmpl b/mercurial/templates/spartan/filediff.tmpl
--- a/mercurial/templates/spartan/filediff.tmpl
+++ b/mercurial/templates/spartan/filediff.tmpl
@@ -17,7 +17,7 @@
 <a href="{url}help{sessionvars%urlparameter}">help</a>
 </div>
 
-<h2>{file|escape}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / {file|escape}</h2>
 
 <table id="filediffEntry">
 <tr>
diff --git a/mercurial/templates/spartan/filelog.tmpl b/mercurial/templates/spartan/filelog.tmpl
--- a/mercurial/templates/spartan/filelog.tmpl
+++ b/mercurial/templates/spartan/filelog.tmpl
@@ -20,7 +20,7 @@
 <a type="application/atom+xml" href="{url}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">atom</a>
 </div>
 
-<h2>{file|escape} revision history</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / {file|escape} revision history</h2>
 
 <p>navigate: <small class="navigate">{nav%filenav}</small></p>
 
diff --git a/mercurial/templates/spartan/filerevision.tmpl b/mercurial/templates/spartan/filerevision.tmpl
--- a/mercurial/templates/spartan/filerevision.tmpl
+++ b/mercurial/templates/spartan/filerevision.tmpl
@@ -17,7 +17,7 @@
 <a href="{url}help{sessionvars%urlparameter}">help</a>
 </div>
 
-<h2>{file|escape}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / {file|escape}</h2>
 
 <table>
 <tr>
diff --git a/mercurial/templates/spartan/graph.tmpl b/mercurial/templates/spartan/graph.tmpl
--- a/mercurial/templates/spartan/graph.tmpl
+++ b/mercurial/templates/spartan/graph.tmpl
@@ -17,7 +17,7 @@
 <a href="{url}help{sessionvars%urlparameter}">help</a>
 </div>
 
-<h2>graph</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / graph</h2>
 
 <form action="{url}log">
 {sessionvars%hiddenformentry}
diff --git a/mercurial/templates/spartan/manifest.tmpl b/mercurial/templates/spartan/manifest.tmpl
--- a/mercurial/templates/spartan/manifest.tmpl
+++ b/mercurial/templates/spartan/manifest.tmpl
@@ -14,7 +14,7 @@
 <a href="{url}help{sessionvars%urlparameter}">help</a>
 </div>
 
-<h2>files for changeset {node|short}: {path|escape}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / files for changeset {node|short}: {path|escape}</h2>
 
 <table cellpadding="0" cellspacing="0">
 <tr class="parity{upparity}">
diff --git a/mercurial/templates/spartan/shortlog.tmpl b/mercurial/templates/spartan/shortlog.tmpl
--- a/mercurial/templates/spartan/shortlog.tmpl
+++ b/mercurial/templates/spartan/shortlog.tmpl
@@ -19,7 +19,7 @@
 <a type="application/rss+xml" href="{url}atom-log" title="Atom feed for {repo|escape}">atom</a>
 </div>
 
-<h2>shortlog for {repo|escape}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog</h2>
 
 <form action="{url}log">
 {sessionvars%hiddenformentry}
diff --git a/mercurial/templates/spartan/tags.tmpl b/mercurial/templates/spartan/tags.tmpl
--- a/mercurial/templates/spartan/tags.tmpl
+++ b/mercurial/templates/spartan/tags.tmpl
@@ -18,7 +18,7 @@
 <a type="application/atom+xml" href="{url}atom-tags">atom</a>
 </div>
 
-<h2>tags:</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / tags</h2>
 
 <ul id="tagEntries">
 {entries%tagentry}


More information about the Mercurial-devel mailing list