Patchwork hgweb: recreate old DOM structure for css in monoblue style

login
register
mail settings
Submitter Anton Shestakov
Date Feb. 12, 2015, 3:23 a.m.
Message ID <0cfff4c42c9a146a0987.1423711434@neuro>
Download mbox | patch
Permalink /patch/7795/
State Accepted
Headers show

Comments

Anton Shestakov - Feb. 12, 2015, 3:23 a.m.
# HG changeset patch
# User Anton Shestakov <engored@ya.ru>
# Date 1423708713 -28800
#      Thu Feb 12 10:38:33 2015 +0800
# Node ID 0cfff4c42c9a146a09877cefee5a839cd70c6a2f
# Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
hgweb: recreate old DOM structure for css in monoblue style

There's a "p.changeset-age span" css block in style-monoblue.css with quite a
bit of rules, including position. They were all unused, since there weren't
matching span element inside the p.changeset-age.

The span was removed in b24e5a708fad (as it seemed meaningless at the time?)
and since then relative changeset age text looked weird and broken.

"age" class is used for calculating relative changeset age in javascript: all
content of such element is replaced with human-friendly text (e.g.
"yesterday"). So the new span gets the age class.
Yuya Nishihara - Feb. 12, 2015, 4:02 p.m.
On Thu, 12 Feb 2015 11:23:54 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <engored@ya.ru>
> # Date 1423708713 -28800
> #      Thu Feb 12 10:38:33 2015 +0800
> # Node ID 0cfff4c42c9a146a09877cefee5a839cd70c6a2f
> # Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
> hgweb: recreate old DOM structure for css in monoblue style
> 
> There's a "p.changeset-age span" css block in style-monoblue.css with quite a
> bit of rules, including position. They were all unused, since there weren't
> matching span element inside the p.changeset-age.
> 
> The span was removed in b24e5a708fad (as it seemed meaningless at the time?)
> and since then relative changeset age text looked weird and broken.
> 
> "age" class is used for calculating relative changeset age in javascript: all
> content of such element is replaced with human-friendly text (e.g.
> "yesterday"). So the new span gets the age class.

Looks correct. I think this is good for stable.

Regards,
Augie Fackler - Feb. 13, 2015, 5:36 p.m.
On Fri, Feb 13, 2015 at 01:02:39AM +0900, Yuya Nishihara wrote:
> On Thu, 12 Feb 2015 11:23:54 +0800, Anton Shestakov wrote:
> > # HG changeset patch
> > # User Anton Shestakov <engored@ya.ru>
> > # Date 1423708713 -28800
> > #      Thu Feb 12 10:38:33 2015 +0800
> > # Node ID 0cfff4c42c9a146a09877cefee5a839cd70c6a2f
> > # Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
> > hgweb: recreate old DOM structure for css in monoblue style
> >
> > There's a "p.changeset-age span" css block in style-monoblue.css with quite a
> > bit of rules, including position. They were all unused, since there weren't
> > matching span element inside the p.changeset-age.
> >
> > The span was removed in b24e5a708fad (as it seemed meaningless at the time?)
> > and since then relative changeset age text looked weird and broken.
> >
> > "age" class is used for calculating relative changeset age in javascript: all
> > content of such element is replaced with human-friendly text (e.g.
> > "yesterday"). So the new span gets the age class.
>
> Looks correct. I think this is good for stable.

Agreed. Queued for stable after manual inspection of monoblue output.

>
> Regards,
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/templates/monoblue/changeset.tmpl b/mercurial/templates/monoblue/changeset.tmpl
--- a/mercurial/templates/monoblue/changeset.tmpl
+++ b/mercurial/templates/monoblue/changeset.tmpl
@@ -39,7 +39,7 @@ 
     <h2 class="no-link no-border">changeset</h2>
 
     <h3 class="changeset"><a href="{url|urlescape}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3>
-    <p class="changeset-age age">{date|rfc822date}</p>
+    <p class="changeset-age"><span class="age">{date|rfc822date}</span></p>
 
     <dl class="overview">
         <dt>author</dt>
diff --git a/mercurial/templates/monoblue/fileannotate.tmpl b/mercurial/templates/monoblue/fileannotate.tmpl
--- a/mercurial/templates/monoblue/fileannotate.tmpl
+++ b/mercurial/templates/monoblue/fileannotate.tmpl
@@ -41,7 +41,7 @@ 
 
     <h2 class="no-link no-border">{file|escape}@{node|short} (annotated)</h2>
     <h3 class="changeset">{file|escape}</h3>
-    <p class="changeset-age age">{date|rfc822date}</p>
+    <p class="changeset-age"><span class="age">{date|rfc822date}</span></p>
 
     <dl class="overview">
         <dt>author</dt>
diff --git a/mercurial/templates/monoblue/filerevision.tmpl b/mercurial/templates/monoblue/filerevision.tmpl
--- a/mercurial/templates/monoblue/filerevision.tmpl
+++ b/mercurial/templates/monoblue/filerevision.tmpl
@@ -41,7 +41,7 @@ 
 
     <h2 class="no-link no-border">{file|escape}@{node|short}</h2>
     <h3 class="changeset">{file|escape}</h3>
-    <p class="changeset-age age">{date|rfc822date}</p>
+    <p class="changeset-age"><span class="age">{date|rfc822date}</span></p>
 
     <dl class="overview">
         <dt>author</dt>