[PATCH 4 of 5] hgweb: consistently add search form to all gitweb pages
Gregory Szorc
gregory.szorc at gmail.com
Fri Jun 9 17:00:05 EDT 2017
# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1497041136 25200
# Fri Jun 09 13:45:36 2017 -0700
# Node ID f8c2776885f1025e3be50d04f030d5d84526a02e
# Parent 47282854e7aff870a87c9e573d4ef5fdca5b894a
hgweb: consistently add search form to all gitweb pages
Paper has it on all pages. Not sure why gitweb doesn't. I think it
should be everywhere because it is a useful feature.
Also, we weren't consistently adding the HTML in the same place. This
was OK since the element is absolutely positioned. But this bothered
me a bit, so I went ahead and fixed it.
diff --git a/mercurial/templates/gitweb/bookmarks.tmpl b/mercurial/templates/gitweb/bookmarks.tmpl
--- a/mercurial/templates/gitweb/bookmarks.tmpl
+++ b/mercurial/templates/gitweb/bookmarks.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / bookmarks
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/branches.tmpl b/mercurial/templates/gitweb/branches.tmpl
--- a/mercurial/templates/gitweb/branches.tmpl
+++ b/mercurial/templates/gitweb/branches.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / branches
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/changelog.tmpl b/mercurial/templates/gitweb/changelog.tmpl
--- a/mercurial/templates/gitweb/changelog.tmpl
+++ b/mercurial/templates/gitweb/changelog.tmpl
@@ -10,10 +10,9 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog
+{searchform}
</div>
-{searchform}
-
<div class="page_nav">
<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
<a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a> |
diff --git a/mercurial/templates/gitweb/changeset.tmpl b/mercurial/templates/gitweb/changeset.tmpl
--- a/mercurial/templates/gitweb/changeset.tmpl
+++ b/mercurial/templates/gitweb/changeset.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/error.tmpl b/mercurial/templates/gitweb/error.tmpl
--- a/mercurial/templates/gitweb/error.tmpl
+++ b/mercurial/templates/gitweb/error.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / error
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/fileannotate.tmpl b/mercurial/templates/gitweb/fileannotate.tmpl
--- a/mercurial/templates/gitweb/fileannotate.tmpl
+++ b/mercurial/templates/gitweb/fileannotate.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / annotate
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/filecomparison.tmpl b/mercurial/templates/gitweb/filecomparison.tmpl
--- a/mercurial/templates/gitweb/filecomparison.tmpl
+++ b/mercurial/templates/gitweb/filecomparison.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / comparison
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/filediff.tmpl b/mercurial/templates/gitweb/filediff.tmpl
--- a/mercurial/templates/gitweb/filediff.tmpl
+++ b/mercurial/templates/gitweb/filediff.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / diff
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/filelog.tmpl b/mercurial/templates/gitweb/filelog.tmpl
--- a/mercurial/templates/gitweb/filelog.tmpl
+++ b/mercurial/templates/gitweb/filelog.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / file revisions
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/filerevision.tmpl b/mercurial/templates/gitweb/filerevision.tmpl
--- a/mercurial/templates/gitweb/filerevision.tmpl
+++ b/mercurial/templates/gitweb/filerevision.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / file revision
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/graph.tmpl b/mercurial/templates/gitweb/graph.tmpl
--- a/mercurial/templates/gitweb/graph.tmpl
+++ b/mercurial/templates/gitweb/graph.tmpl
@@ -11,10 +11,9 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / graph
+{searchform}
</div>
-{searchform}
-
<div class="page_nav">
<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
<a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a> |
diff --git a/mercurial/templates/gitweb/help.tmpl b/mercurial/templates/gitweb/help.tmpl
--- a/mercurial/templates/gitweb/help.tmpl
+++ b/mercurial/templates/gitweb/help.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / help
+{searchform}
</div>
<div class="page_nav">
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
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / help
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/manifest.tmpl b/mercurial/templates/gitweb/manifest.tmpl
--- a/mercurial/templates/gitweb/manifest.tmpl
+++ b/mercurial/templates/gitweb/manifest.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / files
+{searchform}
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/search.tmpl b/mercurial/templates/gitweb/search.tmpl
--- a/mercurial/templates/gitweb/search.tmpl
+++ b/mercurial/templates/gitweb/search.tmpl
@@ -10,9 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / search
-
{searchform}
-
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/shortlog.tmpl b/mercurial/templates/gitweb/shortlog.tmpl
--- a/mercurial/templates/gitweb/shortlog.tmpl
+++ b/mercurial/templates/gitweb/shortlog.tmpl
@@ -10,10 +10,9 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog
+{searchform}
</div>
-{searchform}
-
<div class="page_nav">
<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
shortlog |
diff --git a/mercurial/templates/gitweb/summary.tmpl b/mercurial/templates/gitweb/summary.tmpl
--- a/mercurial/templates/gitweb/summary.tmpl
+++ b/mercurial/templates/gitweb/summary.tmpl
@@ -10,9 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / summary
-
{searchform}
-
</div>
<div class="page_nav">
diff --git a/mercurial/templates/gitweb/tags.tmpl b/mercurial/templates/gitweb/tags.tmpl
--- a/mercurial/templates/gitweb/tags.tmpl
+++ b/mercurial/templates/gitweb/tags.tmpl
@@ -10,6 +10,7 @@
<div class="page_header">
<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> {pathdef%breadcrumb} / tags
+{searchform}
</div>
<div class="page_nav">
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -1534,14 +1534,12 @@ Overviews
<a href="https://mercurial-scm.org/" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> / summary
-
<form action="/log">
<input type="hidden" name="style" value="gitweb" />
<div class="search">
<input type="text" name="rev" />
</div>
</form>
-
</div>
<div class="page_nav">
@@ -1735,8 +1733,6 @@ Overviews
<div class="page_header">
<a href="https://mercurial-scm.org/" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> / graph
- </div>
-
<form action="/log">
<input type="hidden" name="style" value="gitweb" />
@@ -1744,6 +1740,7 @@ Overviews
<input type="text" name="rev" />
</div>
</form>
+ </div>
<div class="page_nav">
<a href="/summary?style=gitweb">summary</a> |
diff --git a/tests/test-hgweb-descend-empties.t b/tests/test-hgweb-descend-empties.t
--- a/tests/test-hgweb-descend-empties.t
+++ b/tests/test-hgweb-descend-empties.t
@@ -405,6 +405,13 @@ manifest with descending (gitweb)
<div class="page_header">
<a href="https://mercurial-scm.org/" title="Mercurial" style="float: right;">Mercurial</a>
<a href="/">Mercurial</a> / files
+
+ <form action="/log">
+ <input type="hidden" name="style" value="gitweb" />
+ <div class="search">
+ <input type="text" name="rev" />
+ </div>
+ </form>
</div>
<div class="page_nav">
More information about the Mercurial-devel
mailing list