Skip to content

Commit

Permalink
[#368] New template for group history
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Mar 6, 2013
1 parent f0fd58f commit dd7b29c
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ckan/templates/group/history.html
@@ -0,0 +1,12 @@
{% extends "group/read_base.html" %}

{% block subtitle %}{{ _('History') }} - {{ c.group_dict.display_name }}{% endblock %}

{% block primary_content_inner %}
<section class="module-content">
<h1 class="hide-heading">{{ _('History') }}</h1>
{% block group_history_revisions %}
{% snippet "group/snippets/history_revisions.html", group_dict=c.group_dict, group_revisions=c.group_revisions %}
{% endblock %}
</section>
{% endblock %}
12 changes: 12 additions & 0 deletions ckan/templates/group/snippets/history_revisions.html
@@ -0,0 +1,12 @@
{% import 'macros/form.html' as form %}

<form class="dataset-form dataset-resource-form form-horizontal" method="post" data-module="basic-form">

{{ form.errors(error_summary) }}

<input type="hidden" name="group_name" value="{{ group_dict.name }}"/>
{% snippet 'group/snippets/revisions_table.html', group_dict=group_dict, group_revisions=group_revisions %}

<button class="btn btn-primary" name="diff" value="go-resources" type="submit">{{ _('Compare') }}</button>

</form>
31 changes: 31 additions & 0 deletions ckan/templates/group/snippets/revisions_table.html
@@ -0,0 +1,31 @@
{% import 'macros/form.html' as form %}

<table class="table table-striped table-bordered">
<thead>
<tr>
<th></th>
<th>{{ _('Revision') }}</th>
<th>{{ _('Timestamp') }}</th>
<th>{{ _('Author') }}</th>
<th>{{ _('Log Message') }}</th>
</tr>
</thead>
<tbody>
{% for rev in group_revisions %}
<tr>
<td nowrap="nowrap">
{{ h.radio('selected1', rev.id, checked=(loop.first)) }}
{{ h.radio('selected2', rev.id, checked=(loop.last)) }}
</td>
<td class="dataset-label">
{% link_for rev.id | truncate(6), controller='revision', action='read', id=rev.id %}
</td>
<td class="dataset-details">
<a href="{{ h.url_for(controller='group', action='read',id='%s@%s' % (group_dict.name, rev.timestamp))}}" title="{{_('Read group as of %s') % rev.timestamp }}">{{ h.render_datetime(rev.timestamp, with_hours=True) }}</a>
</td>
<td class="dataset-details">{{ h.linked_user(rev.author) }}</td>
<td class="dataset-details">{{ rev.message }}</td>
</tr>
{% endfor %}
</tbody>
</table>

0 comments on commit dd7b29c

Please sign in to comment.