-
Notifications
You must be signed in to change notification settings - Fork 2k
/
group_item.html
42 lines (39 loc) · 1.41 KB
/
group_item.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{#
Renders a media item for a group. This should be used in a list.
group - A group dict.
Example:
<ul class="media-grid">
{% for group in groups %}
{% snippet "group/snippets/group_item.html", group=group %}
{% endfor %}
</ul>
#}
{% set url = h.url_for(group.type ~ '_read', action='read', id=group.name) %}
<li class="media-item">
{% block image %}
<img src="{{ group.image_url or h.url_for_static('/base/images/placeholder-group.png') }}" alt="{{ group.name }}" class="media-image">
{% endblock %}
{% block title %}
<h3 class="media-heading">{{ group.display_name }}</h3>
{% endblock %}
{% block description %}
{% if group.description %}
<p>{{ h.markdown_extract(group.description, extract_length=80) }}</p>
{% else %}
<p class="empty">{{ _('This group has no description') }}</p>
{% endif %}
{% endblock %}
{% block datasets %}
{% if group.packages %}
<strong class="count">{{ ungettext('{num} Dataset', '{num} Datasets', group.packages).format(num=group.packages) }}</strong>
{% else %}
<span class="count">{{ _('0 Datasets') }}</span>
{% endif %}
{% endblock %}
<a href="{{ url }}" title="{{ _('View {name}').format(name=group.display_name) }}" class="media-view">
<span>{{ _('View {name}').format(name=group.display_name) }}</span>
</a>
</li>
{% if position is divisibleby 3 %}
<li class="clearfix js-hide"></li>
{% endif %}