From 906b5264c07c4369edf58b1715ca90ba2a98915b Mon Sep 17 00:00:00 2001 From: Aron Carroll Date: Wed, 30 May 2012 12:42:21 +0100 Subject: [PATCH] [2474] Move group items and item templates into partials --- ckan/templates/group/index.html | 20 +------------------ ckan/templates/group/partials/group_item.html | 15 ++++++++++++++ ckan/templates/group/partials/group_list.html | 5 +++++ 3 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 ckan/templates/group/partials/group_item.html create mode 100644 ckan/templates/group/partials/group_list.html diff --git a/ckan/templates/group/index.html b/ckan/templates/group/index.html index 8afc633a8a6..d37d50d8a4f 100644 --- a/ckan/templates/group/index.html +++ b/ckan/templates/group/index.html @@ -18,25 +18,7 @@

{{ _('Groups') }}

- + {% include "group/partials/group_list.html" %}
{{ c.page.pager() }}
diff --git a/ckan/templates/group/partials/group_item.html b/ckan/templates/group/partials/group_item.html new file mode 100644 index 00000000000..56ea3fd7dd3 --- /dev/null +++ b/ckan/templates/group/partials/group_item.html @@ -0,0 +1,15 @@ +{% set url = h.url_for(group.type ~ '_read', action='read', id=group.name) %} +
  • +

    + + {{ group.display_name }} + +

    + + {% if group.description %} +

    {{ h.truncate(group.description, length=80, whole_word=True) }}

    + {% else %} +

    {{ _('This group has no description') }}

    + {% endif %} + {{ ungettext('{num} Dataset', '{num} Datasets', group.packages).format(num=group.packages) }} +
  • diff --git a/ckan/templates/group/partials/group_list.html b/ckan/templates/group/partials/group_list.html new file mode 100644 index 00000000000..210a9bf97e7 --- /dev/null +++ b/ckan/templates/group/partials/group_list.html @@ -0,0 +1,5 @@ +