Download:
child 76:0bf0068a51dd
parent 74:e0a1f3f2a7a3
75:a784221a989b
Anton Shestakov <av6@dwimlabs.net>, Wed, 29 Jun 2016 09:00:24 +0800
viewer: add proper markup to changeset date so it's picked up by moment.js

3 файлов изменено, 9 вставок(+), 5 удалений(-) [+]
candolint/uimodules.py file | annotate | diff | comparison | revisions
templates/check.html file | annotate | diff | comparison | revisions
templates/project.html file | annotate | diff | comparison | revisions
--- a/candolint/uimodules.py Tue Jun 28 22:36:05 2016 +0800
+++ b/candolint/uimodules.py Wed Jun 29 09:00:24 2016 +0800
@@ -2,9 +2,13 @@
class Time(UIModule):
- def render(self, value):
- datetime = value.isoformat() + 'Z'
- text = value.strftime('%Y-%m-%d %H:%M:%S') + ' UTC'
+ def render(self, value, format_=True):
+ if format_:
+ datetime = value.isoformat() + 'Z'
+ text = value.strftime('%Y-%m-%d %H:%M:%S') + ' UTC'
+ else:
+ datetime = value
+ text = value
return self.render_string('ui/time.html', datetime=datetime, title=text, text=text)
--- a/templates/check.html Tue Jun 28 22:36:05 2016 +0800
+++ b/templates/check.html Wed Jun 29 09:00:24 2016 +0800
@@ -35,7 +35,7 @@
<dt>Author:</dt>
<dd>{{ change.author }}</dd>
<dt>Date:</dt>
- <dd><time>{{ change.date }}</time></dd>
+ <dd>{% module Time(change.date, False) %}</dd>
<dt>Description:</dt>
<dd>{{ change.message }}</dd>
</dl>
--- a/templates/project.html Tue Jun 28 22:36:05 2016 +0800
+++ b/templates/project.html Wed Jun 29 09:00:24 2016 +0800
@@ -24,7 +24,7 @@
<td>{{ change.rev }}:{{ change.node[:12] }} {{ change.branch }}</td>
<td>
<div>{{ change.message }}</div>
- <div>{{ change.author }}, <time>{{ change.date }}</time></div>
+ <div>{{ change.author }}, {% module Time(change.date, False) %}</div>
</td>
<td>{% module Time(check.started) %}</td>
<td>{% module Time(check.finished) %}</td>