Patchwork [v2] hgweb: avoid line wrap between revision and annotate-info (issue5398)

login
register
mail settings
Submitter Tooru Fujisawa
Date Oct. 8, 2016, 3:07 p.m.
Message ID <1e4ffe788b13fe6af586.1475939277@mako.unmht.org>
Download mbox | patch
Permalink /patch/16929/
State Accepted
Headers show

Comments

Tooru Fujisawa - Oct. 8, 2016, 3:07 p.m.
# HG changeset patch
# User Tooru Fujisawa <arai.unmht@gmail.com>
# Date 1475922774 -32400
#      Sat Oct 08 19:32:54 2016 +0900
# Node ID 1e4ffe788b13fe6af5862bdc87b588fffd49a4a5
# Parent  f18cc848b48e2de5536fc861007d78d7d5bae42b
hgweb: avoid line wrap between revision and annotate-info (issue5398)

Add white-space: nowrap to td.annotate to avoid wrapping div.annotate-info
into next line if there is revision number in the same cell, as it is hard to
mouse over div.annotate-info if it's wrapped into next line.
Augie Fackler - Oct. 8, 2016, 3:11 p.m.
> On Oct 8, 2016, at 17:07, Tooru Fujisawa <arai.unmht@gmail.com> wrote:
> 
> # HG changeset patch
> # User Tooru Fujisawa <arai.unmht@gmail.com>
> # Date 1475922774 -32400
> #      Sat Oct 08 19:32:54 2016 +0900
> # Node ID 1e4ffe788b13fe6af5862bdc87b588fffd49a4a5
> # Parent  f18cc848b48e2de5536fc861007d78d7d5bae42b
> hgweb: avoid line wrap between revision and annotate-info (issue5398)

Queued, many thanks.

Congrats on your first patch to Mercurial.

> 
> Add white-space: nowrap to td.annotate to avoid wrapping div.annotate-info
> into next line if there is revision number in the same cell, as it is hard to
> mouse over div.annotate-info if it's wrapped into next line.
> 
> 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
> @@ -50,16 +50,19 @@ td.indexlinks a {
> }
> td.indexlinks a:hover { background-color: #6666aa; }
> div.pre { font-family:monospace; font-size:12px; white-space:pre; }
> div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
> div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
> div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
> tr.thisrev a { color:#999999; text-decoration: none; }
> tr.thisrev pre { color:#009900; }
> +td.annotate {
> +  white-space: nowrap;
> +}
> div.annotate-info {
>   display: none;
>   position: absolute;
>   background-color: #FFFFFF;
>   border: 1px solid #d9d8d1;
>   text-align: left;
>   color: #000000;
>   padding: 5px;
> 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
> @@ -330,16 +330,19 @@ td.source {
> .lineno a {
>   color: #999;
> }
> td.linenr {
>   width: 60px;
> }
> tr.thisrev a { color:#999999; text-decoration: none; }
> tr.thisrev td.source { color:#009900; }
> +td.annotate {
> +  white-space: nowrap;
> +}
> div.annotate-info {
>   display: none;
>   position: absolute;
>   background-color: #FFFFFF;
>   border: solid 1px #CCC;
>   text-align: left;
>   color: #666;
>   padding: 5px;
> 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
> @@ -205,16 +205,19 @@ h3 {
> .bigtable .node { width: 5em; font-family: monospace;}
> .bigtable .permissions { width: 8em; text-align: left;}
> .bigtable .size { width: 5em; text-align: right; }
> .bigtable .annotate { text-align: right; }
> .bigtable td.annotate { font-size: smaller; }
> .bigtable td.source { font-size: inherit; }
> tr.thisrev a { color:#999999; text-decoration: none; }
> tr.thisrev td.source { color:#009900; }
> +td.annotate {
> +  white-space: nowrap;
> +}
> div.annotate-info {
>   display: none;
>   position: absolute;
>   background-color: #FFFFFF;
>   border: 1px solid #999;
>   text-align: left;
>   color: #000000;
>   padding: 5px;
> 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
> @@ -7,16 +7,19 @@ a { text-decoration:none; }
> .lineno { width: 60px; color: #aaa; font-size: smaller;
>           text-align: right; }
> .plusline { color: green; }
> .minusline { color: red; }
> .atline { color: purple; }
> .annotate { font-size: smaller; text-align: right; padding-right: 1em; }
> tr.thisrev a { color:#999999; text-decoration: none; }
> tr.thisrev pre { color:#009900; }
> +td.annotate {
> +  white-space: nowrap;
> +}
> div.annotate-info {
>   display: none;
>   position: absolute;
>   background-color: #FFFFFF;
>   border: 1px solid #888;
>   text-align: left;
>   color: #000000;
>   padding: 5px;
> 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
> @@ -1960,16 +1960,19 @@ Static files
>   .lineno { width: 60px; color: #aaa; font-size: smaller;
>             text-align: right; }
>   .plusline { color: green; }
>   .minusline { color: red; }
>   .atline { color: purple; }
>   .annotate { font-size: smaller; text-align: right; padding-right: 1em; }
>   tr.thisrev a { color:#999999; text-decoration: none; }
>   tr.thisrev pre { color:#009900; }
> +  td.annotate {
> +    white-space: nowrap;
> +  }
>   div.annotate-info {
>     display: none;
>     position: absolute;
>     background-color: #FFFFFF;
>     border: 1px solid #888;
>     text-align: left;
>     color: #000000;
>     padding: 5px;
> diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
> --- a/tests/test-hgweb.t
> +++ b/tests/test-hgweb.t
> @@ -335,17 +335,17 @@ Test the access/error files are opened i
> 
>   $ $PYTHON -c "print len(file('access.log').readlines()), 'log lines written'"
>   14 log lines written
> 
> static file
> 
>   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
>   200 Script output follows
> -  content-length: 6947
> +  content-length: 6986
>   content-type: text/css
> 
>   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
>   a { color:#0000cc; }
>   a:hover, a:visited, a:active { color:#880000; }
>   div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
>   div.page_header a:visited { color:#0000cc; }
>   div.page_header a:hover { color:#880000; }
> @@ -395,16 +395,19 @@ static file
>   }
>   td.indexlinks a:hover { background-color: #6666aa; }
>   div.pre { font-family:monospace; font-size:12px; white-space:pre; }
>   div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
>   div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
>   div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
>   tr.thisrev a { color:#999999; text-decoration: none; }
>   tr.thisrev pre { color:#009900; }
> +  td.annotate {
> +    white-space: nowrap;
> +  }
>   div.annotate-info {
>     display: none;
>     position: absolute;
>     background-color: #FFFFFF;
>     border: 1px solid #d9d8d1;
>     text-align: left;
>     color: #000000;
>     padding: 5px;

Patch

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
@@ -50,16 +50,19 @@  td.indexlinks a {
 }
 td.indexlinks a:hover { background-color: #6666aa; }
 div.pre { font-family:monospace; font-size:12px; white-space:pre; }
 div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
 div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
 div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
 tr.thisrev a { color:#999999; text-decoration: none; }
 tr.thisrev pre { color:#009900; }
+td.annotate {
+  white-space: nowrap;
+}
 div.annotate-info {
   display: none;
   position: absolute;
   background-color: #FFFFFF;
   border: 1px solid #d9d8d1;
   text-align: left;
   color: #000000;
   padding: 5px;
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
@@ -330,16 +330,19 @@  td.source {
 .lineno a {
   color: #999;
 }
 td.linenr {
   width: 60px;
 }
 tr.thisrev a { color:#999999; text-decoration: none; }
 tr.thisrev td.source { color:#009900; }
+td.annotate {
+  white-space: nowrap;
+}
 div.annotate-info {
   display: none;
   position: absolute;
   background-color: #FFFFFF;
   border: solid 1px #CCC;
   text-align: left;
   color: #666;
   padding: 5px;
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
@@ -205,16 +205,19 @@  h3 {
 .bigtable .node { width: 5em; font-family: monospace;}
 .bigtable .permissions { width: 8em; text-align: left;}
 .bigtable .size { width: 5em; text-align: right; }
 .bigtable .annotate { text-align: right; }
 .bigtable td.annotate { font-size: smaller; }
 .bigtable td.source { font-size: inherit; }
 tr.thisrev a { color:#999999; text-decoration: none; }
 tr.thisrev td.source { color:#009900; }
+td.annotate {
+  white-space: nowrap;
+}
 div.annotate-info {
   display: none;
   position: absolute;
   background-color: #FFFFFF;
   border: 1px solid #999;
   text-align: left;
   color: #000000;
   padding: 5px;
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
@@ -7,16 +7,19 @@  a { text-decoration:none; }
 .lineno { width: 60px; color: #aaa; font-size: smaller;
           text-align: right; }
 .plusline { color: green; }
 .minusline { color: red; }
 .atline { color: purple; }
 .annotate { font-size: smaller; text-align: right; padding-right: 1em; }
 tr.thisrev a { color:#999999; text-decoration: none; }
 tr.thisrev pre { color:#009900; }
+td.annotate {
+  white-space: nowrap;
+}
 div.annotate-info {
   display: none;
   position: absolute;
   background-color: #FFFFFF;
   border: 1px solid #888;
   text-align: left;
   color: #000000;
   padding: 5px;
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
@@ -1960,16 +1960,19 @@  Static files
   .lineno { width: 60px; color: #aaa; font-size: smaller;
             text-align: right; }
   .plusline { color: green; }
   .minusline { color: red; }
   .atline { color: purple; }
   .annotate { font-size: smaller; text-align: right; padding-right: 1em; }
   tr.thisrev a { color:#999999; text-decoration: none; }
   tr.thisrev pre { color:#009900; }
+  td.annotate {
+    white-space: nowrap;
+  }
   div.annotate-info {
     display: none;
     position: absolute;
     background-color: #FFFFFF;
     border: 1px solid #888;
     text-align: left;
     color: #000000;
     padding: 5px;
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -335,17 +335,17 @@  Test the access/error files are opened i
 
   $ $PYTHON -c "print len(file('access.log').readlines()), 'log lines written'"
   14 log lines written
 
 static file
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
   200 Script output follows
-  content-length: 6947
+  content-length: 6986
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
   a { color:#0000cc; }
   a:hover, a:visited, a:active { color:#880000; }
   div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
   div.page_header a:visited { color:#0000cc; }
   div.page_header a:hover { color:#880000; }
@@ -395,16 +395,19 @@  static file
   }
   td.indexlinks a:hover { background-color: #6666aa; }
   div.pre { font-family:monospace; font-size:12px; white-space:pre; }
   div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
   div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
   div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
   tr.thisrev a { color:#999999; text-decoration: none; }
   tr.thisrev pre { color:#009900; }
+  td.annotate {
+    white-space: nowrap;
+  }
   div.annotate-info {
     display: none;
     position: absolute;
     background-color: #FFFFFF;
     border: 1px solid #d9d8d1;
     text-align: left;
     color: #000000;
     padding: 5px;