Patchwork [2,of,5] hgweb: consolidate search form for monoblue

login
register
mail settings
Submitter Gregory Szorc
Date June 9, 2017, 9 p.m.
Message ID <08889384494e21be250f.1497042003@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/21293/
State Accepted
Headers show

Comments

Gregory Szorc - June 9, 2017, 9 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1497040870 25200
#      Fri Jun 09 13:41:10 2017 -0700
# Node ID 08889384494e21be250fae4d9c7b8082df31c0b2
# Parent  ba069fc58ff051abadd3d0371c2a9a34e99079dd
hgweb: consolidate search form for monoblue

Same deal as for paper.
Yuya Nishihara - June 11, 2017, 4:23 a.m.
On Fri, 09 Jun 2017 14:00:03 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1497040870 25200
> #      Fri Jun 09 13:41:10 2017 -0700
> # Node ID 08889384494e21be250fae4d9c7b8082df31c0b2
> # Parent  ba069fc58ff051abadd3d0371c2a9a34e99079dd
> hgweb: consolidate search form for monoblue

> diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
> --- a/mercurial/templates/monoblue/map
> +++ b/mercurial/templates/monoblue/map
> @@ -279,3 +279,12 @@ urlparameter = '{separator}{name}={value
>  hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
>  graph = graph.tmpl
>  breadcrumb = '&gt; <a href="{url|urlescape}">{name|escape}</a> '
> +
> +searchform = '
> +  <form action="{url|urlescape}log">
> +    {sessionvars%hiddenformentry}
> +    <dl class="search">
> +      <dt><label>Search: </label></dt>
> +      <dd><input type="text" name="rev" /></dd>

Missed value="{query|escape}". I'll fix it in flight.

Patch

diff --git a/mercurial/templates/monoblue/bookmarks.tmpl b/mercurial/templates/monoblue/bookmarks.tmpl
--- a/mercurial/templates/monoblue/bookmarks.tmpl
+++ b/mercurial/templates/monoblue/bookmarks.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / bookmarks</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/branches.tmpl b/mercurial/templates/monoblue/branches.tmpl
--- a/mercurial/templates/monoblue/branches.tmpl
+++ b/mercurial/templates/monoblue/branches.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / branches</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/changelog.tmpl b/mercurial/templates/monoblue/changelog.tmpl
--- a/mercurial/templates/monoblue/changelog.tmpl
+++ b/mercurial/templates/monoblue/changelog.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/changeset.tmpl b/mercurial/templates/monoblue/changeset.tmpl
--- a/mercurial/templates/monoblue/changeset.tmpl
+++ b/mercurial/templates/monoblue/changeset.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/error.tmpl b/mercurial/templates/monoblue/error.tmpl
--- a/mercurial/templates/monoblue/error.tmpl
+++ b/mercurial/templates/monoblue/error.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / not found: {repo|escape}</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/fileannotate.tmpl b/mercurial/templates/monoblue/fileannotate.tmpl
--- a/mercurial/templates/monoblue/fileannotate.tmpl
+++ b/mercurial/templates/monoblue/fileannotate.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / annotate</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/filecomparison.tmpl b/mercurial/templates/monoblue/filecomparison.tmpl
--- a/mercurial/templates/monoblue/filecomparison.tmpl
+++ b/mercurial/templates/monoblue/filecomparison.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file comparison</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/filediff.tmpl b/mercurial/templates/monoblue/filediff.tmpl
--- a/mercurial/templates/monoblue/filediff.tmpl
+++ b/mercurial/templates/monoblue/filediff.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file diff</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/filelog.tmpl b/mercurial/templates/monoblue/filelog.tmpl
--- a/mercurial/templates/monoblue/filelog.tmpl
+++ b/mercurial/templates/monoblue/filelog.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file revisions</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/filerevision.tmpl b/mercurial/templates/monoblue/filerevision.tmpl
--- a/mercurial/templates/monoblue/filerevision.tmpl
+++ b/mercurial/templates/monoblue/filerevision.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file revision</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/graph.tmpl b/mercurial/templates/monoblue/graph.tmpl
--- a/mercurial/templates/monoblue/graph.tmpl
+++ b/mercurial/templates/monoblue/graph.tmpl
@@ -10,13 +10,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / graph</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/help.tmpl b/mercurial/templates/monoblue/help.tmpl
--- a/mercurial/templates/monoblue/help.tmpl
+++ b/mercurial/templates/monoblue/help.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / help</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
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
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / help</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/manifest.tmpl b/mercurial/templates/monoblue/manifest.tmpl
--- a/mercurial/templates/monoblue/manifest.tmpl
+++ b/mercurial/templates/monoblue/manifest.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / files</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -279,3 +279,12 @@  urlparameter = '{separator}{name}={value
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
 graph = graph.tmpl
 breadcrumb = '&gt; <a href="{url|urlescape}">{name|escape}</a> '
+
+searchform = '
+  <form action="{url|urlescape}log">
+    {sessionvars%hiddenformentry}
+    <dl class="search">
+      <dt><label>Search: </label></dt>
+      <dd><input type="text" name="rev" /></dd>
+    </dl>
+  </form>'
diff --git a/mercurial/templates/monoblue/notfound.tmpl b/mercurial/templates/monoblue/notfound.tmpl
--- a/mercurial/templates/monoblue/notfound.tmpl
+++ b/mercurial/templates/monoblue/notfound.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / not found: {repo|escape}</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/search.tmpl b/mercurial/templates/monoblue/search.tmpl
--- a/mercurial/templates/monoblue/search.tmpl
+++ b/mercurial/templates/monoblue/search.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / search</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" value="{query|escape}" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/shortlog.tmpl b/mercurial/templates/monoblue/shortlog.tmpl
--- a/mercurial/templates/monoblue/shortlog.tmpl
+++ b/mercurial/templates/monoblue/shortlog.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
diff --git a/mercurial/templates/monoblue/summary.tmpl b/mercurial/templates/monoblue/summary.tmpl
--- a/mercurial/templates/monoblue/summary.tmpl
+++ b/mercurial/templates/monoblue/summary.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / summary</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li class="current">summary</li>
diff --git a/mercurial/templates/monoblue/tags.tmpl b/mercurial/templates/monoblue/tags.tmpl
--- a/mercurial/templates/monoblue/tags.tmpl
+++ b/mercurial/templates/monoblue/tags.tmpl
@@ -9,13 +9,7 @@ 
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / tags</h1>
 
-        <form action="{url|urlescape}log">
-            {sessionvars%hiddenformentry}
-            <dl class="search">
-                <dt><label>Search: </label></dt>
-                <dd><input type="text" name="rev" /></dd>
-            </dl>
-        </form>
+        {searchform}
 
         <ul class="page-nav">
             <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
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
@@ -289,13 +289,14 @@  manifest with descending (monoblue)
       <div class="page-header">
           <h1 class="breadcrumb"><a href="/">Mercurial</a>  / files</h1>
   
-          <form action="/log">
-              <input type="hidden" name="style" value="monoblue" />
-              <dl class="search">
-                  <dt><label>Search: </label></dt>
-                  <dd><input type="text" name="rev" /></dd>
-              </dl>
-          </form>
+          
+  <form action="/log">
+  <input type="hidden" name="style" value="monoblue" />
+  <dl class="search">
+  <dt><label>Search: </label></dt>
+  <dd><input type="text" name="rev" /></dd>
+  </dl>
+  </form>
   
           <ul class="page-nav">
               <li><a href="/summary?style=monoblue">summary</a></li>