Patchwork [STABLE] hgweb: show ages in repos' Last modified column in monoblue and gitweb

login
register
mail settings
Submitter Anton Shestakov
Date July 25, 2015, 4:12 p.m.
Message ID <20ed56771b21dcaa232e.1437840769@neuro>
Download mbox | patch
Permalink /patch/10060/
State Accepted
Headers show

Comments

Anton Shestakov - July 25, 2015, 4:12 p.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1437840683 -28800
#      Sun Jul 26 00:11:23 2015 +0800
# Branch stable
# Node ID 20ed56771b21dcaa232e58a83f0fe934a839717f
# Parent  3de48ff627338a8abab1efc85e2a52add7f90abc
hgweb: show ages in repos' Last modified column in monoblue and gitweb

Index page, which shows the list of available repositories, has a column where
the last modification date for each repo is shown. paper, coal and spartan
already show the dates in relative format (e.g. "2 weeks ago"), because these
styles have the required process_dates() js function call in their footer
templates, which are included on every page. But monoblue and gitweb styles
have more things in the footer templates, such as repo name and its atom/rss
links, so they don't include the footer on index page (as this page doesn't
have a single repo context).

Let's call process_dates() without including the footer.
Matt Mackall - July 25, 2015, 5:25 p.m.
On Sun, 2015-07-26 at 00:12 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1437840683 -28800
> #      Sun Jul 26 00:11:23 2015 +0800
> # Branch stable
> # Node ID 20ed56771b21dcaa232e58a83f0fe934a839717f
> # Parent  3de48ff627338a8abab1efc85e2a52add7f90abc
> hgweb: show ages in repos' Last modified column in monoblue and gitweb

Queued for stable, thanks.

Patch

diff --git a/mercurial/templates/gitweb/index.tmpl b/mercurial/templates/gitweb/index.tmpl
--- a/mercurial/templates/gitweb/index.tmpl
+++ b/mercurial/templates/gitweb/index.tmpl
@@ -22,5 +22,6 @@ 
 <div class="page_footer">
 {motd}
 </div>
+<script type="text/javascript">process_dates()</script>
 </body>
 </html>
diff --git a/mercurial/templates/monoblue/index.tmpl b/mercurial/templates/monoblue/index.tmpl
--- a/mercurial/templates/monoblue/index.tmpl
+++ b/mercurial/templates/monoblue/index.tmpl
@@ -35,5 +35,6 @@ 
     <div id="corner-bottom-right"></div>
 
 </div>
+<script type="text/javascript">process_dates()</script>
 </body>
 </html>