Skip to content

Commit

Permalink
[#1301] Adds template blocks to resource listings
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Nov 19, 2013
1 parent 4005856 commit 570f7fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions ckan/templates/package/snippets/resource_item.html
Expand Up @@ -9,13 +9,15 @@
{{ h.popular('views', res.tracking_summary.total, min=10) }}
</a>
{% endblock %}
<p class="description">
{% if res.description %}
{{ h.markdown_extract(res.description, extract_length=80) }}
{% else %}
<span class="empty">{{ _('No description for this resource') }}</span>
{% endif %}
</p>
{% block resource_item_description %}
<p class="description">
{% if res.description %}
{{ h.markdown_extract(res.description, extract_length=80) }}
{% else %}
<span class="empty">{{ _('No description for this resource') }}</span>
{% endif %}
</p>
{% endblock %}
{% block resource_item_explore %}
{% if not url_is_edit %}
<div class="dropdown btn-group">
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/snippets/resources_list.html
Expand Up @@ -13,7 +13,7 @@
<h3>{{ _('Data and Resources') }}</h3>
{% block resource_list %}
{% if resources %}
<ul class="resource-list">
<ul class="{% block resource_list_class %}resource-list{% endblock %}">
{% block resource_list_inner %}
{% for resource in resources %}
{% snippet 'package/snippets/resource_item.html', pkg=pkg, res=resource %}
Expand Down

0 comments on commit 570f7fc

Please sign in to comment.