Skip to content

Commit

Permalink
[#368] Show sidebar on revisions pages
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Mar 6, 2013
1 parent 2462f82 commit 6d2d499
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 106 deletions.
70 changes: 33 additions & 37 deletions ckan/templates/revision/diff.html
@@ -1,4 +1,4 @@
{% extends "page.html" %}
{% extends "revision/read_base.html" %}

{% set pkg = c.pkg %}
{% set group = c.group %}
Expand All @@ -19,42 +19,38 @@
{% 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>
{% block primary_content_inner %}
<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>
<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>
{% 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 %}
{% endblock %}
21 changes: 8 additions & 13 deletions ckan/templates/revision/list.html
@@ -1,24 +1,19 @@
{% extends "page.html" %}
{% extends "revision/read_base.html" %}

{% block subtitle %}{{ _('Revision History') }}{% endblock %}

{% block breadcrumb_content %}
<li class="active"><a href="" title="{{ _('Revision History') }}">{{ _('Revisions') }}</a></li>
{% endblock %}

{% block primary %}
<section class="module prose">
<section class="module-content">
<h1>{{ _('Revision History') }}</h1>
{% block primary_content_inner %}
<h1>{{ _('Revision History') }}</h1>

{{ c.page.pager() }}
{{ c.page.pager() }}

{% block revisions_list %}
{% snippet "revision/snippets/revisions_list.html", revisions=c.page.items %}
{% endblock %}
{% block revisions_list %}
{% snippet "revision/snippets/revisions_list.html", revisions=c.page.items %}
{% endblock %}

{{ c.page.pager() }}

</section>
</section>
{{ c.page.pager() }}
{% endblock %}
108 changes: 52 additions & 56 deletions ckan/templates/revision/read.html
@@ -1,4 +1,4 @@
{% extends "page.html" %}
{% extends "revision/read_base.html" %}

{% set rev = c.revision %}

Expand Down Expand Up @@ -34,64 +34,60 @@
{% endif %}
{% endblock %}

{% block primary %}
<section class="module prose">
<section class="module-content">
<h1>{{ _('Revision') }}: {{ rev.id }}</h1>
{% block primary_content_inner %}
<h1>{{ _('Revision') }}: {{ rev.id }}</h1>

<div class="state-{{ rev.state }}">
<div class="embedded-content">
{% if rev.state != 'active' %}
<p class="state-notice">
{{ rev.state }}
</p>
{% endif %}
<div class="state-{{ rev.state }}">
<div class="embedded-content">
{% if rev.state != 'active' %}
<p class="state-notice">
{{ rev.state }}
</p>
{% endif %}

<p>
<strong>{{ _('Author') }}:</strong> {{ h.linked_user(rev.author) }}
</p>
<p>
<strong>{{ _('Timestamp') }}:</strong> {{ h.render_datetime(rev.timestamp, with_hours=True) }}
</p>
<p>
<strong>{{ _('Log Message') }}:</strong>
</p>
<p>
{{ rev.message }}
</p>
</div>
<p>
<strong>{{ _('Author') }}:</strong> {{ h.linked_user(rev.author) }}
</p>
<p>
<strong>{{ _('Timestamp') }}:</strong> {{ h.render_datetime(rev.timestamp, with_hours=True) }}
</p>
<p>
<strong>{{ _('Log Message') }}:</strong>
</p>
<p>
{{ rev.message }}
</p>
</div>

<div class="embedded-content">
<h2>{{ _('Changes') }}</h2>
<h3>{{ _('Datasets') }}</h3>
<ul>
{% for pkg in c.packages %}
<li>
{{ h.link_to(pkg.name, h.url_for(controller='package', action='read', id=pkg.name)) }}
</li>
{% endfor %}
</ul>
<div class="embedded-content">
<h2>{{ _('Changes') }}</h2>
<h3>{{ _('Datasets') }}</h3>
<ul>
{% for pkg in c.packages %}
<li>
{{ h.link_to(pkg.name, h.url_for(controller='package', action='read', id=pkg.name)) }}
</li>
{% endfor %}
</ul>

<h3>{{ _('Datasets\' Tags') }}</h3>
<ul>
{% for pkgtag in c.pkgtags %}
<li>
Dataset - {{ h.link_to(pkgtag.package.name, h.url_for(controller='package', action='read', id=pkgtag.package.name)) }},
Tag - {{ h.link_to(pkgtag.tag.name, h.url_for(controller='tag', action='read', id=pkgtag.tag.name)) }}
</li>
{% endfor %}
</ul>
<h3>{{ _('Datasets\' Tags') }}</h3>
<ul>
{% for pkgtag in c.pkgtags %}
<li>
Dataset - {{ h.link_to(pkgtag.package.name, h.url_for(controller='package', action='read', id=pkgtag.package.name)) }},
Tag - {{ h.link_to(pkgtag.tag.name, h.url_for(controller='tag', action='read', id=pkgtag.tag.name)) }}
</li>
{% endfor %}
</ul>

<h3>{{ _('Groups') }}</h3>
<ul>
{% for group in c.groups %}
<li>
{{ h.link_to(group.name, h.url_for(controller='group', action='read', id=group.name)) }}
</li>
{% endfor %}
</ul>
</div>
</div>
</section>
</section>
<h3>{{ _('Groups') }}</h3>
<ul>
{% for group in c.groups %}
<li>
{{ h.link_to(group.name, h.url_for(controller='group', action='read', id=group.name)) }}
</li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}
19 changes: 19 additions & 0 deletions ckan/templates/revision/read_base.html
@@ -0,0 +1,19 @@
{% extends "page.html" %}

{% block secondary_content %}

{% block secondary_help_content %}{% endblock %}

{% block package_social %}
{% snippet "snippets/social.html" %}
{% endblock %}

{% endblock %}

{% block primary_content %}
<article class="module prose">
<section class="module-content">
{% block primary_content_inner %}{% endblock %}
</section>
</article>
{% endblock %}

0 comments on commit 6d2d499

Please sign in to comment.