Patchwork hgweb: use separate CSS class for navigation links in footer

login
register
mail settings
Submitter Gregory Szorc
Date June 21, 2017, 3:55 a.m.
Message ID <90fcc0df5d5b949ec574.1498017319@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/21575/
State Accepted
Headers show

Comments

Gregory Szorc - June 21, 2017, 3:55 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1498017209 25200
#      Tue Jun 20 20:53:29 2017 -0700
# Node ID 90fcc0df5d5b949ec574bccfdb64778f0945bb51
# Parent  0ce2cbebd74964ffe61e79de8941461bccc9371b
hgweb: use separate CSS class for navigation links in footer

2d93d2159e30 changed the styling of the "page_nav" CSS class to use
flexbox to separate elements within the <div>. I didn't realize that
this class was used outside of the links in the header. So this
resulted in incorrectly formatting links in the footer of various
pages. Fix that by introducing a new CSS class that preserves the
old CSS behavior.
Yuya Nishihara - June 22, 2017, 2:49 p.m.
On Tue, 20 Jun 2017 20:55:19 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1498017209 25200
> #      Tue Jun 20 20:53:29 2017 -0700
> # Node ID 90fcc0df5d5b949ec574bccfdb64778f0945bb51
> # Parent  0ce2cbebd74964ffe61e79de8941461bccc9371b
> hgweb: use separate CSS class for navigation links in footer

Queued, thanks.

Patch

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
@@ -31,7 +31,7 @@  changelog |
 
 {entries%changelogentry}
 
-<div class="page_nav">
+<div class="extra_nav">
 {changenav%nav}<br/>
 </div>
 
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
@@ -43,7 +43,7 @@  revisions |
 {entries%filelogentry}
 </table>
 
-<div class="page_nav">
+<div class="extra_nav">
 <a href="{url|urlescape}log/{symrev}/{file|urlescape}{lessvars%urlparameter}">less</a>
 <a href="{url|urlescape}log/{symrev}/{file|urlescape}{morevars%urlparameter}">more</a>
 {nav%filenav}
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
@@ -99,7 +99,7 @@  graph.render(data);
 // stop hiding script -->
 </script>
 
-<div class="page_nav">
+<div class="extra_nav">
 <a href="{url|urlescape}graph/{symrev}{lessvars%urlparameter}">less</a>
 <a href="{url|urlescape}graph/{symrev}{morevars%urlparameter}">more</a>
 | {changenav%navgraph}
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
@@ -33,7 +33,7 @@  shortlog |
 {entries%shortlogentry}
 </table>
 
-<div class="page_nav">
+<div class="extra_nav">
 {changenav%navshort}
 </div>
 
diff --git a/mercurial/templates/static/style-gitweb.css b/mercurial/templates/static/style-gitweb.css
--- a/mercurial/templates/static/style-gitweb.css
+++ b/mercurial/templates/static/style-gitweb.css
@@ -11,6 +11,12 @@  div.page_nav {
     align-items: center;
 }
 div.page_nav a:visited { color:#0000cc; }
+div.extra_nav {
+    padding: 8px;
+}
+div.extra_nav a:visited {
+    color: #0000cc;
+}
 div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px}
 div.page_footer { padding:4px 8px; background-color: #d9d8d1; }
 div.page_footer_text { float:left; color:#555555; font-style:italic; }
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
@@ -1832,7 +1832,7 @@  Overviews
   // stop hiding script -->
   </script>
   
-  <div class="page_nav">
+  <div class="extra_nav">
   <a href="/graph/tip?revcount=30&style=gitweb">less</a>
   <a href="/graph/tip?revcount=120&style=gitweb">more</a>
   | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a> 
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -340,7 +340,7 @@  static file
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
   200 Script output follows
-  content-length: 8265
+  content-length: 8349
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
@@ -356,6 +356,12 @@  static file
       align-items: center;
   }
   div.page_nav a:visited { color:#0000cc; }
+  div.extra_nav {
+      padding: 8px;
+  }
+  div.extra_nav a:visited {
+      color: #0000cc;
+  }
   div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px}
   div.page_footer { padding:4px 8px; background-color: #d9d8d1; }
   div.page_footer_text { float:left; color:#555555; font-style:italic; }