mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
templater: put 'ago' inside the age template filter
This commit is contained in:
parent
93317651a4
commit
2f9a035003
@ -43,7 +43,7 @@ def age(date):
|
||||
for t, s in agescales:
|
||||
n = delta // s
|
||||
if n >= 2 or s == 1:
|
||||
return fmt(t, n)
|
||||
return '%s ago' % fmt(t, n)
|
||||
|
||||
para_re = None
|
||||
space_re = None
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div>
|
||||
<a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}"><span class="age">{date|age} ago</span>{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
|
||||
<a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}"><span class="age">{date|age}</span>{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
|
||||
</div>
|
||||
<div class="title_text">
|
||||
<div class="log_link">
|
||||
|
@ -29,7 +29,7 @@ changeset |
|
||||
<div class="title_text">
|
||||
<table cellspacing="0">
|
||||
<tr><td>author</td><td>{author|obfuscate}</td></tr>
|
||||
<tr><td></td><td>{date|date} ({date|age} ago)</td></tr>
|
||||
<tr><td></td><td>{date|date} ({date|age})</td></tr>
|
||||
{branch%changesetbranch}
|
||||
<tr><td>changeset {rev}</td><td style="font-family:monospace">{node|short}</td></tr>
|
||||
{parent%changesetparent}
|
||||
|
@ -36,7 +36,7 @@ annotate |
|
||||
<td>{author|obfuscate}</td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{date|date} ({date|age} ago)</td></tr>
|
||||
<td>{date|date} ({date|age})</td></tr>
|
||||
{branch%filerevbranch}
|
||||
<tr>
|
||||
<td>changeset {rev}</td>
|
||||
|
@ -36,7 +36,7 @@ file |
|
||||
<td>{author|obfuscate}</td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{date|date} ({date|age} ago)</td></tr>
|
||||
<td>{date|date} ({date|age})</td></tr>
|
||||
{branch%filerevbranch}
|
||||
<tr>
|
||||
<td>changeset {rev}</td>
|
||||
|
@ -150,7 +150,7 @@ fileannotatechild = '
|
||||
tags = tags.tmpl
|
||||
tagentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="age"><i>{date|age} ago</i></td>
|
||||
<td class="age"><i>{date|age}</i></td>
|
||||
<td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{tag|escape}</b></a></td>
|
||||
<td class="link">
|
||||
<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
|
||||
@ -161,7 +161,7 @@ tagentry = '
|
||||
branches = branches.tmpl
|
||||
branchentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="age"><i>{date|age} ago</i></td>
|
||||
<td class="age"><i>{date|age}</i></td>
|
||||
<td><a class="list" href="{url}shortlog/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></a></td>
|
||||
<td class="{status}">{branch|escape}</td>
|
||||
<td class="link">
|
||||
@ -204,7 +204,7 @@ branchtag = '<span class="branchtag" title="{name}">{name}</span> '
|
||||
inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
|
||||
shortlogentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="age"><i>{date|age} ago</i></td>
|
||||
<td class="age"><i>{date|age}</i></td>
|
||||
<td><i>{author|person}</i></td>
|
||||
<td>
|
||||
<a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">
|
||||
@ -219,7 +219,7 @@ shortlogentry = '
|
||||
</tr>'
|
||||
filelogentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="age"><i>{date|age} ago</i></td>
|
||||
<td class="age"><i>{date|age}</i></td>
|
||||
<td>
|
||||
<a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">
|
||||
<b>{desc|strip|firstline|escape|nonempty}</b>
|
||||
@ -238,7 +238,7 @@ indexentry = '
|
||||
</td>
|
||||
<td>{description}</td>
|
||||
<td>{contact|obfuscate}</td>
|
||||
<td class="age">{lastchange|age} ago</td>
|
||||
<td class="age">{lastchange|age}</td>
|
||||
<td class="indexlinks">{archives%indexarchiveentry}</td>
|
||||
<td><div class="rss_logo"><a href="{url}rss-log">RSS</a> <a href="{url}atom-log">Atom</a></div></td>
|
||||
</tr>\n'
|
||||
|
@ -1,6 +1,6 @@
|
||||
<h3 class="changelog"><a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
|
||||
<ul class="changelog-entry">
|
||||
<li class="age">{date|age} ago</li>
|
||||
<li class="age">{date|age}</li>
|
||||
<li>by <span class="name">{author|obfuscate}</span> <span class="revdate">[{date|rfc822date}] rev {rev}</span></li>
|
||||
<li class="description">{desc|strip|escape|addbreaks|nonempty}</li>
|
||||
</ul>
|
||||
|
@ -36,7 +36,7 @@
|
||||
<h2 class="no-link no-border">changeset</h2>
|
||||
|
||||
<h3 class="changeset"><a href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
|
||||
<p class="changeset-age"><span>{date|age} ago</span></p>
|
||||
<p class="changeset-age"><span>{date|age}</span></p>
|
||||
|
||||
<dl class="overview">
|
||||
<dt>author</dt>
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
<h2 class="no-link no-border">{file|escape}@{node|short} (annotated)</h2>
|
||||
<h3 class="changeset">{file|escape}</h3>
|
||||
<p class="changeset-age"><span>{date|age} ago</span></p>
|
||||
<p class="changeset-age"><span>{date|age}</span></p>
|
||||
|
||||
<dl class="overview">
|
||||
<dt>author</dt>
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
<h2 class="no-link no-border">{file|escape}@{node|short}</h2>
|
||||
<h3 class="changeset">{file|escape}</h3>
|
||||
<p class="changeset-age"><span>{date|age} ago</span></p>
|
||||
<p class="changeset-age"><span>{date|age}</span></p>
|
||||
|
||||
<dl class="overview">
|
||||
<dt>author</dt>
|
||||
|
@ -127,7 +127,7 @@ fileannotatechild = '
|
||||
tags = tags.tmpl
|
||||
tagentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="nowrap">{date|age} ago</td>
|
||||
<td class="nowrap">{date|age}</td>
|
||||
<td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a></td>
|
||||
<td class="nowrap">
|
||||
<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
|
||||
@ -138,7 +138,7 @@ tagentry = '
|
||||
branches = branches.tmpl
|
||||
branchentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="nowrap">{date|age} ago</td>
|
||||
<td class="nowrap">{date|age}</td>
|
||||
<td><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
|
||||
<td class="{status}">{branch|escape}</td>
|
||||
<td class="nowrap">
|
||||
@ -170,7 +170,7 @@ branchtag = '<span class="branchtag" title="{name}">{name}</span> '
|
||||
inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
|
||||
shortlogentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="nowrap">{date|age} ago</td>
|
||||
<td class="nowrap">{date|age}</td>
|
||||
<td>{author|person}</td>
|
||||
<td>
|
||||
<a href="{url}rev/{node|short}{sessionvars%urlparameter}">
|
||||
@ -185,7 +185,7 @@ shortlogentry = '
|
||||
</tr>'
|
||||
filelogentry = '
|
||||
<tr class="parity{parity}">
|
||||
<td class="nowrap">{date|age} ago</td>
|
||||
<td class="nowrap">{date|age}</td>
|
||||
<td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td>
|
||||
<td class="nowrap">
|
||||
<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> | <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> | <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
|
||||
@ -198,7 +198,7 @@ indexentry = '
|
||||
<td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td>
|
||||
<td>{description}</td>
|
||||
<td>{contact|obfuscate}</td>
|
||||
<td>{lastchange|age} ago</td>
|
||||
<td>{lastchange|age}</td>
|
||||
<td class="indexlinks">{archives%indexarchiveentry}</td>
|
||||
<td>
|
||||
<div class="rss_logo">
|
||||
|
@ -45,7 +45,7 @@ files, or words in the commit message</div>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="date">date</th>
|
||||
<td class="date">{date|date} ({date|age} ago)</td></tr>
|
||||
<td class="date">{date|date} ({date|age})</td></tr>
|
||||
<tr>
|
||||
<th class="author">parents</th>
|
||||
<td class="author">{parent%changesetparent}</td>
|
||||
|
@ -50,7 +50,7 @@ files, or words in the commit message</div>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="date">date</th>
|
||||
<td class="date">{date|date} ({date|age} ago)</td>
|
||||
<td class="date">{date|date} ({date|age})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="author">parents</th>
|
||||
|
@ -49,7 +49,7 @@ files, or words in the commit message</div>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>date</th>
|
||||
<td>{date|date} ({date|age} ago)</td>
|
||||
<td>{date|date} ({date|age})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>parents</th>
|
||||
|
@ -49,7 +49,7 @@ files, or words in the commit message</div>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="date">date</th>
|
||||
<td class="date">{date|date} ({date|age} ago)</td>
|
||||
<td class="date">{date|date} ({date|age})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="author">parents</th>
|
||||
|
@ -176,7 +176,7 @@ indexentry = '
|
||||
<td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td>
|
||||
<td>{description}</td>
|
||||
<td>{contact|obfuscate}</td>
|
||||
<td class="age">{lastchange|age} ago</td>
|
||||
<td class="age">{lastchange|age}</td>
|
||||
<td class="indexlinks">{archives%indexarchiveentry}</td>
|
||||
</tr>\n'
|
||||
indexarchiveentry = '<a href="{url}archive/{node|short}{extension|urlescape}"> ↓{type|escape}</a>'
|
||||
|
@ -1,6 +1,6 @@
|
||||
<table class="logEntry parity{parity}">
|
||||
<tr>
|
||||
<th class="age">{date|age} ago:</th>
|
||||
<th class="age">{date|age}:</th>
|
||||
<th class="firstline">{desc|strip|firstline|escape|nonempty}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -30,7 +30,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="date">date:</th>
|
||||
<td class="date">{date|date} ({date|age} ago)</td>
|
||||
<td class="date">{date|date} ({date|age})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="files">files:</th>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<td>{author|obfuscate}</td></tr>
|
||||
<tr>
|
||||
<td class="metatag">date:</td>
|
||||
<td>{date|date} ({date|age} ago)</td>
|
||||
<td>{date|date} ({date|age})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="metatag">permissions:</td>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<table class="logEntry parity{parity}">
|
||||
<tr>
|
||||
<th class="age">{date|age} ago:</th>
|
||||
<th class="age">{date|age}:</th>
|
||||
<th class="firstline"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<td>{author|obfuscate}</td></tr>
|
||||
<tr>
|
||||
<td class="metatag">date:</td>
|
||||
<td>{date|date} ({date|age} ago)</td></tr>
|
||||
<td>{date|date} ({date|age})</td></tr>
|
||||
<tr>
|
||||
<td class="metatag">permissions:</td>
|
||||
<td>{permissions|permissions}</td></tr>
|
||||
|
@ -161,7 +161,7 @@ h3 {
|
||||
border-bottom: 1px solid #999;
|
||||
}
|
||||
.bigtable tr { border: none; }
|
||||
.bigtable .age { width: 6em; }
|
||||
.bigtable .age { width: 7em; }
|
||||
.bigtable .author { width: 12em; }
|
||||
.bigtable .description { }
|
||||
.bigtable .node { width: 5em; font-family: monospace;}
|
||||
|
@ -210,17 +210,17 @@ files, or words in the commit message</div>
|
||||
<th class="description">description</th>
|
||||
</tr>
|
||||
<tr class="parity0">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> </td>
|
||||
</tr>
|
||||
<tr class="parity1">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</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>
|
||||
</tr>
|
||||
<tr class="parity0">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
|
||||
</tr>
|
||||
@ -764,7 +764,7 @@ graph |
|
||||
<script>
|
||||
<!-- hide script content
|
||||
|
||||
var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "many years", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "many years", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "many years", ["default", false], ["1.0"]]];
|
||||
var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "many years ago", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "many years ago", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "many years ago", ["default", false], ["1.0"]]];
|
||||
var graph = new Graph();
|
||||
graph.scale(39);
|
||||
|
||||
|
@ -148,12 +148,12 @@ files, or words in the commit message</div>
|
||||
<th class="description">description</th>
|
||||
</tr>
|
||||
<tr class="parity0">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
|
||||
</tr>
|
||||
<tr class="parity1">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/5ed941583260">first a</a></td>
|
||||
</tr>
|
||||
@ -231,12 +231,12 @@ files, or words in the commit message</div>
|
||||
<th class="description">description</th>
|
||||
</tr>
|
||||
<tr class="parity0">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
|
||||
</tr>
|
||||
<tr class="parity1">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/5ed941583260">first a</a></td>
|
||||
</tr>
|
||||
@ -314,7 +314,7 @@ files, or words in the commit message</div>
|
||||
<th class="description">description</th>
|
||||
</tr>
|
||||
<tr class="parity0">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/5ed941583260">first a</a></td>
|
||||
</tr>
|
||||
@ -392,7 +392,7 @@ files, or words in the commit message</div>
|
||||
<th class="description">description</th>
|
||||
</tr>
|
||||
<tr class="parity0">
|
||||
<td class="age">many years</td>
|
||||
<td class="age">many years ago</td>
|
||||
<td class="author">test</td>
|
||||
<td class="description"><a href="/rev/5ed941583260">first a</a></td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user