changeset 25543:09ec4220a839

hgweb: split some long lines in paper, gitweb and monoblue styles This will ease future patches for the templates. As a result of this patch, paper style has one visual change in log/shortlog/file log view: the spacing between commit message and the first tag (or branch name, or bookmark) is now roughly who spaces wide instead of one space wide. This spacing is consistent with the one between branch names/tags/bookmarks themselves, so it looks better. In gitweb style, the change from non-breakable space to regular space is consistent with other elements. In monoblue the change is not noticeable.
author Anton Shestakov <engored@ya.ru>
date Fri, 15 May 2015 02:07:43 +0800 (2015-05-14)
parents 149cc7663ac8
children f3e0a5784ca8
files mercurial/templates/gitweb/map mercurial/templates/monoblue/map mercurial/templates/paper/filelogentry.tmpl mercurial/templates/paper/shortlogentry.tmpl tests/test-hgweb-commands.t tests/test-hgweb-filelog.t
diffstat 6 files changed, 63 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -296,8 +296,12 @@
       </a>
     </td>
     <td class="link">
-      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> {rename%filelogrename}</td>
-    </tr>'
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+      <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+      {rename%filelogrename}
+    </td>
+  </tr>'
 archiveentry = ' | <a href="{url|urlescape}archive/{node|short}{extension}{ifeq(path,'/','',path|urlescape)}">{type|escape}</a> '
 indexentry = '
   <tr class="parity{parity}">
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -244,7 +244,11 @@
 filelogentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
-    <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td>
+    <td>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
+        {desc|strip|firstline|escape|nonempty}
+      </a>
+    </td>
     <td class="nowrap">
       <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
       {rename%filelogrename}
--- a/mercurial/templates/paper/filelogentry.tmpl
+++ b/mercurial/templates/paper/filelogentry.tmpl
@@ -1,5 +1,8 @@
  <tr>
   <td class="age">{date|rfc822date}</td>
   <td class="author">{author|person}</td>
-  <td class="description"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{rename%filelogrename}</td>
+  <td class="description">
+   <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>
+   {inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{rename%filelogrename}
+  </td>
  </tr>
--- a/mercurial/templates/paper/shortlogentry.tmpl
+++ b/mercurial/templates/paper/shortlogentry.tmpl
@@ -1,5 +1,8 @@
  <tr>
   <td class="age">{date|rfc822date}</td>
   <td class="author">{author|person}</td>
-  <td class="description"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{bookmarks%changelogtag}</td>
+  <td class="description">
+   <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>
+   {inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{bookmarks%changelogtag}
+  </td>
  </tr>
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -762,22 +762,34 @@
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/cad8025a2e87">branch commit with null character: </a><span class="branchhead">unstable</span> <span class="tag">tip</span> <span class="tag">something</span> </td>
+    <td class="description">
+     <a href="/rev/cad8025a2e87">branch commit with null character: </a>
+     <span class="branchhead">unstable</span> <span class="tag">tip</span> <span class="tag">something</span> 
+    </td>
    </tr>
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> </td>
+    <td class="description">
+     <a href="/rev/1d22e65f027e">branch</a>
+     <span class="branchhead">stable</span> 
+    </td>
    </tr>
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td>
+    <td class="description">
+     <a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a>
+     <span class="branchhead">default</span> 
+    </td>
    </tr>
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> <span class="tag">anotherthing</span> </td>
+    <td class="description">
+     <a href="/rev/2ef0ac749a14">base</a>
+     <span class="tag">1.0</span> <span class="tag">anotherthing</span> 
+    </td>
    </tr>
   
   </tbody>
@@ -1024,7 +1036,10 @@
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> <span class="tag">anotherthing</span> </td>
+    <td class="description">
+     <a href="/rev/2ef0ac749a14">base</a>
+     <span class="tag">1.0</span> <span class="tag">anotherthing</span> 
+    </td>
    </tr>
   
   </tbody>
--- a/tests/test-hgweb-filelog.t
+++ b/tests/test-hgweb-filelog.t
@@ -191,12 +191,18 @@
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
+    <td class="description">
+     <a href="/rev/01de2d66a28d">second a</a>
+     
+    </td>
    </tr>
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+    <td class="description">
+     <a href="/rev/5ed941583260">first a</a>
+     
+    </td>
    </tr>
   
   </tbody>
@@ -302,12 +308,18 @@
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
+    <td class="description">
+     <a href="/rev/01de2d66a28d">second a</a>
+     
+    </td>
    </tr>
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+    <td class="description">
+     <a href="/rev/5ed941583260">first a</a>
+     
+    </td>
    </tr>
   
   </tbody>
@@ -413,7 +425,10 @@
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+    <td class="description">
+     <a href="/rev/5ed941583260">first a</a>
+     
+    </td>
    </tr>
   
   </tbody>
@@ -519,7 +534,10 @@
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
-    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+    <td class="description">
+     <a href="/rev/5ed941583260">first a</a>
+     
+    </td>
    </tr>
   
   </tbody>