Download:
child 240:3c02c1240134
parent 238:5a4ed43de4c6
239:d63d57df465c
Anton Shestakov <av6@dwimlabs.net>, Tue, 20 Sep 2016 18:56:49 +0800
templates: move table rows with project checks to a separate template

2 файлов изменено, 17 вставок(+), 16 удалений(-) [+]
templates/index.html file | annotate | diff | comparison | revisions
templates/ui/checks.html file | annotate | diff | comparison | revisions
--- a/templates/index.html Thu Sep 01 17:39:28 2016 +0800
+++ b/templates/index.html Tue Sep 20 18:56:49 2016 +0800
@@ -6,22 +6,7 @@
<div class="uk-container uk-container-center uk-margin-large-top">
<h2>Recently checked projects</h2>
<table class="uk-table uk-table-middle uk-text-nowrap">
- <tbody>
- {% for check in checks %}
- {% set project = check.project %}
- {% set change = check.change %}
- {% set adapter = project.get_adapter() %}
- <tr>
- <td>{% module Badges(check) %}</td>
- <td class="uk-width-1-1 uk-text-break"><a href="{{ project.get_url() }}">{{ project.get_title() }}</a></td>
- <td><a href="{{ project.get_url() }}/{{ check.ordinal }}">check #{{ check.ordinal }}</a></td>
- <td><a href="{{ adapter.get_branch_url(change) }}">{{ change.branch }}</a></td>
- <td><a href="{{ adapter.get_commit_url(change) }}">{% if change.rev is not None %}{{ change.rev }}:{% end %}{{ change.node[:12] }}</a></td>
- <td>{% module Time(check.finished) %}</td>
- <td>{{ check.get_duration() }}</td>
- </tr>
- {% end %}
- </tbody>
+ {% module Template('ui/checks.html', checks=recent) %}
</table>
</div>
{% end %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/ui/checks.html Tue Sep 20 18:56:49 2016 +0800
@@ -0,0 +1,16 @@
+<tbody>
+ {% for check in checks %}
+ {% set project = check.project %}
+ {% set change = check.change %}
+ {% set adapter = project.get_adapter() %}
+ <tr>
+ <td class="uk-text-right">{% module Badges(check) %}</td>
+ <td class="uk-width-1-1 uk-text-break"><a href="{{ project.get_url() }}">{{ project.get_title() }}</a></td>
+ <td><a href="{{ project.get_url() }}/{{ check.ordinal }}">check #{{ check.ordinal }}</a></td>
+ <td><a href="{{ adapter.get_branch_url(change) }}">{{ change.branch }}</a></td>
+ <td><a href="{{ adapter.get_commit_url(change) }}">{% if change.rev is not None %}{{ change.rev }}:{% end %}{{ change.node[:12] }}</a></td>
+ <td>{% module Time(check.finished) %}</td>
+ <td>{{ check.get_duration() }}</td>
+ </tr>
+ {% end %}
+</tbody>