Skip to content

Commit

Permalink
[#477] Show additional info on group/org about pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 31, 2013
1 parent da7b780 commit 0290e08
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ckan/templates/group/about.html
Expand Up @@ -12,5 +12,9 @@ <h1>{% block page_heading %}{{ c.group_dict.display_name }}{% endblock %}</h1>
<p class="empty">{{ _('There is no description for this group') }}</p>
{% endif %}
{% endblock %}

{% block group_extras %}
{% snippet 'snippets/additional_info.html', extras = h.sorted_extras(c.group_dict.extras) %}
{% endblock %}
</section>
{% endblock %}
4 changes: 4 additions & 0 deletions ckan/templates/organization/about.html
Expand Up @@ -12,5 +12,9 @@ <h1>{% block page_heading %}{{ c.group_dict.display_name }}{% endblock %}</h1>
<p class="empty">{{ _('There is no description for this organization') }}</p>
{% endif %}
{% endblock %}

{% block organization_extras %}
{% snippet 'snippets/additional_info.html', extras = h.sorted_extras(c.group_dict.extras) %}
{% endblock %}
</section>
{% endblock %}
25 changes: 25 additions & 0 deletions ckan/templates/snippets/additional_info.html
@@ -0,0 +1,25 @@
{# This snippet creates an Additional Info Table

extras is a list of tuples of the form (key, value)

#}
{% if extras %}
<h3>{{ _('Additional Info') }}</h3>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th scope="col">{{ _('Field') }}</th>
<th scope="col">{{ _('Value') }}</th>
</tr>
</thead>
<tbody>
{% for extra in extras %}
{% set key, value = extra %}
<tr rel="dc:relation" resource="_:extra{{ i }}">
<th scope="row" class="dataset-label" property="rdfs:label">{{ _(key) }}</th>
<td class="dataset-details" property="rdf:value">{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}

0 comments on commit 0290e08

Please sign in to comment.