Patchwork [1,of,2] hgweb: make .info a block element by default

login
register
mail settings
Submitter Anton Shestakov
Date Jan. 4, 2018, 6:49 a.m.
Message ID <3ecf6cb83ef66db56948.1515048594@neuro>
Download mbox | patch
Permalink /patch/26528/
State Accepted
Headers show

Comments

Anton Shestakov - Jan. 4, 2018, 6:49 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1514943661 -28800
#      Wed Jan 03 09:41:01 2018 +0800
# Node ID 3ecf6cb83ef66db56948d3b47142f06c941281e6
# Parent  e01549a7bf0a6a7adbbb317a5d4bfde36c205b4d
hgweb: make .info a block element by default

Using a <div> instead of a <span> with "display: block" makes more sense.

While at it, let's adjust top margin in monoblue so that text in .info doesn't
overlap changeset "tags" elements (they are quite large in monoblue).
Yuya Nishihara - Jan. 5, 2018, 5:56 a.m.
On Thu, 04 Jan 2018 14:49:54 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1514943661 -28800
> #      Wed Jan 03 09:41:01 2018 +0800
> # Node ID 3ecf6cb83ef66db56948d3b47142f06c941281e6
> # Parent  e01549a7bf0a6a7adbbb317a5d4bfde36c205b4d
> hgweb: make .info a block element by default

Queued, thanks.

Patch

diff --git a/mercurial/templates/gitweb/graphentry.tmpl b/mercurial/templates/gitweb/graphentry.tmpl
--- a/mercurial/templates/gitweb/graphentry.tmpl
+++ b/mercurial/templates/gitweb/graphentry.tmpl
@@ -3,5 +3,5 @@ 
   <a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"><b>{desc|strip|firstline|escape|nonempty}</b></a>
  </span>
  {alltags}
- <span class="info">{date|age}, by {author|person}</span>
+ <div class="info">{date|age}, by {author|person}</div>
 </li>
diff --git a/mercurial/templates/monoblue/graphentry.tmpl b/mercurial/templates/monoblue/graphentry.tmpl
--- a/mercurial/templates/monoblue/graphentry.tmpl
+++ b/mercurial/templates/monoblue/graphentry.tmpl
@@ -3,5 +3,5 @@ 
         <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>
     </span>
     {alltags}
-    <span class="info"><span class="age">{date|rfc822date}</span>, by {author|person}</span>
+    <div class="info"><span class="age">{date|rfc822date}</span>, by {author|person}</div>
 </li>
diff --git a/mercurial/templates/paper/graphentry.tmpl b/mercurial/templates/paper/graphentry.tmpl
--- a/mercurial/templates/paper/graphentry.tmpl
+++ b/mercurial/templates/paper/graphentry.tmpl
@@ -3,5 +3,5 @@ 
   <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>
  </span>
  {alltags}
- <span class="info"><span class="age">{date|rfc822date}</span>, by {author|person}</span>
+ <div class="info"><span class="age">{date|rfc822date}</span>, by {author|person}</div>
 </li>
diff --git a/mercurial/templates/spartan/graphentry.tmpl b/mercurial/templates/spartan/graphentry.tmpl
--- a/mercurial/templates/spartan/graphentry.tmpl
+++ b/mercurial/templates/spartan/graphentry.tmpl
@@ -2,5 +2,5 @@ 
  <span class="desc">
   <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>
  </span>
- <span class="info"><span class="age">{date|rfc822date}</span>, by {author|person}</span>
+ <div class="info"><span class="age">{date|rfc822date}</span>, by {author|person}</div>
 </li>
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
@@ -322,7 +322,6 @@  ul#graphnodes {
 }
 
 ul#graphnodes li .info {
-	display: block;
 	font-size: 100%;
 	font-style: italic;
 }
diff --git a/mercurial/templates/static/style-monoblue.css b/mercurial/templates/static/style-monoblue.css
--- a/mercurial/templates/static/style-monoblue.css
+++ b/mercurial/templates/static/style-monoblue.css
@@ -502,7 +502,7 @@  ul#graphnodes li, ul#nodebgs li {
 }
 
 ul#graphnodes li .info {
-	display: block;
+	margin-top: 2px;
 }
 /** end of canvas **/
 
diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -479,7 +479,6 @@  ul#graphnodes li, ul#nodebgs li {
 }
 
 ul#graphnodes li .info {
-	display: block;
 	font-size: 70%;
 }
 
diff --git a/mercurial/templates/static/style.css b/mercurial/templates/static/style.css
--- a/mercurial/templates/static/style.css
+++ b/mercurial/templates/static/style.css
@@ -115,6 +115,5 @@  ul#graphnodes {
 }
 
 ul#graphnodes li .info {
-	display: block;
 	font-size: 70%;
 }
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
@@ -1788,28 +1788,28 @@  Overviews
     <a class="list" href="/rev/cad8025a2e87?style=gitweb"><b>branch commit with null character: </b></a>
    </span>
    <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="branchtag" title="unstable">unstable</span> <span class="tagtag" title="tip">tip</span> <span class="bookmarktag" title="something">something</span> </span>
-   <span class="info">1970-01-01, by test</span>
+   <div class="info">1970-01-01, by test</div>
   </li>
   <li data-node="1d22e65f027e">
    <span class="desc">
     <a class="list" href="/rev/1d22e65f027e?style=gitweb"><b>branch</b></a>
    </span>
    <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="branchtag" title="stable">stable</span> </span>
-   <span class="info">1970-01-01, by test</span>
+   <div class="info">1970-01-01, by test</div>
   </li>
   <li data-node="a4f92ed23982">
    <span class="desc">
     <a class="list" href="/rev/a4f92ed23982?style=gitweb"><b>Added tag 1.0 for changeset 2ef0ac749a14</b></a>
    </span>
    <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="branchtag" title="default">default</span> </span>
-   <span class="info">1970-01-01, by test</span>
+   <div class="info">1970-01-01, by test</div>
   </li>
   <li data-node="2ef0ac749a14">
    <span class="desc">
     <a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>base</b></a>
    </span>
    <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="tagtag" title="1.0">1.0</span> <span class="bookmarktag" title="anotherthing">anotherthing</span> </span>
-   <span class="info">1970-01-01, by test</span>
+   <div class="info">1970-01-01, by test</div>
   </li>
   </ul>
   </div>
@@ -2079,7 +2079,6 @@  Static files
   }
   
   ul#graphnodes li .info {
-  	display: block;
   	font-size: 70%;
   }
 
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: 9152
+  content-length: 9135
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
@@ -667,7 +667,6 @@  static file
   }
   
   ul#graphnodes li .info {
-  	display: block;
   	font-size: 100%;
   	font-style: italic;
   }