Skip to content

Commit

Permalink
[#368] New template for revision diff
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Feb 19, 2013
1 parent d1cb93f commit eda8a85
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions ckan/templates/revision/diff.html
@@ -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 %}

0 comments on commit eda8a85

Please sign in to comment.