Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#368] New template for revision diff
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{% extends "page.html" %} | ||
|
||
{% set pkg = c.pkg %} | ||
{% set group = c.group %} | ||
|
||
{% block subtitle %}{{ _('Differences')}}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
{% if c.diff_entity == 'package' %} | ||
{% set dataset = pkg.title or pkg.name %} | ||
<li>{% link_for _('Datasets'), controller='package', action='search', highlight_actions = 'new index' %}</li> | ||
<li>{% link_for dataset, controller='package', action='read', id=pkg.name %}</li> | ||
<li class="active"><a href="" title="{{ _('Revision Differences') }}">{{ _('Revision Differences') }}</a></li> | ||
{% elif c.diff_entity == 'group' %} | ||
{% set group = group.display_name or group.name %} | ||
<li>{% link_for _('Groups'), controller='group', action='index' %}</li> | ||
<li>{% link_for group, controller='group', action='read', id=group.name %}</li> | ||
<li class="active"><a href="" title="{{ _('Revision Differences') }}">{{ _('Revision Differences') }}</a></li> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block primary %} | ||
<section class="module prose"> | ||
<section class="module-content"> | ||
<h1>{{ _('Revision Differences') }} - | ||
{% if c.diff_entity == 'package' %} | ||
{% link_for pkg.title, controller='package', action='read', id=pkg.name %} | ||
{% elif c.diff_entity == 'group' %} | ||
{% link_for group.display_name, controller='group', action='read', id=group.name %} | ||
{% endif %} | ||
</h1> | ||
|
||
<p> | ||
<strong>From:</strong> {% link_for c.revision_from.id, controller='revision', action='read', id=c.revision_from.id %} - | ||
{{ h.render_datetime(c.revision_from.timestamp, with_hours=True) }} | ||
</p> | ||
<p> | ||
<strong>To:</strong> {% link_for c.revision_to.id, controller='revision', action='read', id=c.revision_to.id %} - | ||
{{ h.render_datetime(c.revision_to.timestamp, with_hours=True) }} | ||
</p> | ||
|
||
{% if c.diff %} | ||
<table class="table table-bordered table-striped"> | ||
<tr> | ||
<th>{{ _('Field') }}</th> | ||
<th>{{ _('Difference') }}</th> | ||
</tr> | ||
{% for field, diff in c.diff %} | ||
<tr> | ||
<td>{{ field }}</td> | ||
<td><pre>{{ diff }}</pre></td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% else %} | ||
<h3>{{ _('No Differences') }}</h3> | ||
{% endif %} | ||
</section> | ||
</section> | ||
{% endblock %} |