[PATCH 5 of 5 STABLE] hgweb: align entries in "changelog" and "revisions" pages of "spartan" style

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Wed Apr 16 19:42:26 CDT 2014


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1397694969 -32400
#      Thu Apr 17 09:36:09 2014 +0900
# Branch stable
# Node ID b8b6290a43fb6739c7ae9fcb7824989407a78429
# Parent  68c7dfb8906d8968ede7bf7d1fda6282fa24a141
hgweb: align entries in "changelog" and "revisions" pages of "spartan" style

Before this patch, each log entries in "changelog" and "revisions"
pages of "spartan" style are not aligned by column, because:

  - each log entries are separated "<table>" entries, and
  - there are no fixed "width" information for each "<th>"/"<td>" entries

This patch aligns entries in "changelog" and "revisions" pages of
"spartan" style by:

  - adding 'label' class to '<th>' for 'age' information, and
  - setting 'width' of '<th class="label">' with fixed size

'class="age"' is not used for this purpose, because it is also used to
set "bold" font-weight

"16em" seems to be wide enough to show date information fully, when
web browser disables (or doesn't support) javascript.

diff --git a/mercurial/templates/spartan/changelogentry.tmpl b/mercurial/templates/spartan/changelogentry.tmpl
--- a/mercurial/templates/spartan/changelogentry.tmpl
+++ b/mercurial/templates/spartan/changelogentry.tmpl
@@ -1,6 +1,6 @@
 <table class="logEntry parity{parity}">
  <tr>
-  <th><span class="age">{date|rfc822date}</span>:</th>
+  <th class="label"><span class="age">{date|rfc822date}</span>:</th>
   <th class="firstline">{desc|strip|firstline|escape|nonempty}</th>
  </tr>
  <tr>
diff --git a/mercurial/templates/spartan/filelogentry.tmpl b/mercurial/templates/spartan/filelogentry.tmpl
--- a/mercurial/templates/spartan/filelogentry.tmpl
+++ b/mercurial/templates/spartan/filelogentry.tmpl
@@ -1,6 +1,6 @@
 <table class="logEntry parity{parity}">
  <tr>
-  <th><span class="age">{date|rfc822date}</span>:</th>
+  <th class="label"><span class="age">{date|rfc822date}</span>:</th>
   <th class="firstline"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></th>
  </tr>
  <tr>
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
@@ -41,6 +41,7 @@
 /* Changelog/Filelog entries */
 .logEntry { width: 100%; }
 .logEntry .age { width: 15%; }
+.logEntry th.label { width: 16em; }
 .logEntry th { font-weight: normal; text-align: right; vertical-align: top; }
 .logEntry th.age, .logEntry th.firstline { font-weight: bold; }
 .logEntry th.firstline { text-align: left; width: inherit; }
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
@@ -1477,6 +1477,7 @@
   /* Changelog/Filelog entries */
   .logEntry { width: 100%; }
   .logEntry .age { width: 15%; }
+  .logEntry th.label { width: 16em; }
   .logEntry th { font-weight: normal; text-align: right; vertical-align: top; }
   .logEntry th.age, .logEntry th.firstline { font-weight: bold; }
   .logEntry th.firstline { text-align: left; width: inherit; }
diff --git a/tests/test-hgweb-filelog.t b/tests/test-hgweb-filelog.t
--- a/tests/test-hgweb-filelog.t
+++ b/tests/test-hgweb-filelog.t
@@ -639,7 +639,7 @@
   
   <table class="logEntry parity0">
    <tr>
-    <th><span class="age">Thu, 01 Jan 1970 00:00:00 +0000</span>:</th>
+    <th class="label"><span class="age">Thu, 01 Jan 1970 00:00:00 +0000</span>:</th>
     <th class="firstline"><a href="/rev/b7682196df1c?style=spartan">change c</a></th>
    </tr>
    <tr>
@@ -664,7 +664,7 @@
   
   <table class="logEntry parity1">
    <tr>
-    <th><span class="age">Thu, 01 Jan 1970 00:00:00 +0000</span>:</th>
+    <th class="label"><span class="age">Thu, 01 Jan 1970 00:00:00 +0000</span>:</th>
     <th class="firstline"><a href="/rev/1a6696706df2?style=spartan">mv b</a></th>
    </tr>
    <tr>


More information about the Mercurial-devel mailing list