Patchwork [5,of,8,v2] templates: support linking to main help page

login
register
mail settings
Submitter Eric Sumner
Date Jan. 1, 2016, 6:36 p.m.
Message ID <34c3ea65d6d1d55c9188.1451673405@waste.org>
Download mbox | patch
Permalink /patch/12460/
State Accepted
Headers show

Comments

Eric Sumner - Jan. 1, 2016, 6:36 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1451521593 25200
#      Wed Dec 30 17:26:33 2015 -0700
# Node ID 34c3ea65d6d1d55c9188c3de4ec885ca8905c205
# Parent  8e8b3371bee14e880e52f5a929e4832898d4d3ed
templates: support linking to main help page

Currently, the "helptopics" template assumes it is only used as the
main index and therefore doesn't hyperlink "help" in the navigation
list. Sub-topics will introduce an additional consumer of this
template. So teach the template to hyperlink the "help" navigation
entry when necessary.

Patch

diff --git a/mercurial/templates/gitweb/helptopics.tmpl b/mercurial/templates/gitweb/helptopics.tmpl
--- a/mercurial/templates/gitweb/helptopics.tmpl
+++ b/mercurial/templates/gitweb/helptopics.tmpl
@@ -21,7 +21,10 @@ 
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
 <a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
-help
+{if(subindex,
+  '<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>',
+  'help'
+)}
 <br/>
 </div>
 
diff --git a/mercurial/templates/monoblue/helptopics.tmpl b/mercurial/templates/monoblue/helptopics.tmpl
--- a/mercurial/templates/monoblue/helptopics.tmpl
+++ b/mercurial/templates/monoblue/helptopics.tmpl
@@ -26,7 +26,10 @@ 
             <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
             <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
             <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
-            <li class="current">help</li>
+            {if(subindex,
+              '<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>',
+              '<li class="current">help</li>'
+            )}
         </ul>
     </div>
 
diff --git a/mercurial/templates/paper/helptopics.tmpl b/mercurial/templates/paper/helptopics.tmpl
--- a/mercurial/templates/paper/helptopics.tmpl
+++ b/mercurial/templates/paper/helptopics.tmpl
@@ -17,7 +17,10 @@ 
 <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li class="active">help</li>
+{if(subindex,
+  '<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>',
+  '<li class="active">help</li>'
+)}
 </ul>
 </div>