66 lines
2.4 KiB
HTML
66 lines
2.4 KiB
HTML
{#
|
|
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>
|
|
#}
|
|
|
|
|
|
{# Updated By Francesco Mangiacrapa, related to breadcrumb for Group #}
|
|
{% set type = group.type or 'group' %}
|
|
{% set url = h.url_for(type ~ '_read', action='read', id=group.name) %}
|
|
{% block item %}
|
|
<li class="media-item">
|
|
{% block breadcrumb %}
|
|
<div id="group_breadcrumb" style="font-size: 12px !important;">
|
|
{% set parents = h.d4science_theme_get_parents_for_group(group.name) %}
|
|
{% for parent in parents recursive %}
|
|
<span>
|
|
{% link_for parent.title, controller='group', action='read', id=parent.name %}
|
|
{% if loop.last == False %}
|
|
{% endif %}
|
|
</span>
|
|
{% endfor %}
|
|
</div>
|
|
{% endblock %}
|
|
{% block item_inner %}
|
|
{% block image %}
|
|
<img src="{{ group.image_display_url or h.url_for_static('/base/images/placeholder-group.png') }}" alt="{{ group.name }}" class="media-image">
|
|
{% endblock %}
|
|
{% block title %}
|
|
<a href="{{ url }}" title="{{ _('View {name}').format(name=group.display_name) }}"><h3 class="media-heading">{{ group.display_name }} <span style="font-size: 12px;"></span></h3></a>
|
|
{% endblock %}
|
|
{% block description %}
|
|
{% if group.description %}
|
|
<p>{{ h.d4science_theme_markdown_extract_html(group.description, extract_length=80, allow_html=True) }}</p>
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% block datasets %}
|
|
{% if group.package_count %}
|
|
<strong class="count">{{ ungettext('{num} Dataset', '{num} Datasets', group.package_count).format(num=group.package_count) }}</strong>
|
|
{% elif group.package_count == 0 %}
|
|
<!-- <span class="count">{# {{ _('0 Datasets') }} #}</span>-->
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% if group.user_member %}
|
|
{# Added By Francesco Mangiacrapa, related to Task #5196 #}
|
|
{% set username_id = c.userobj.id %}
|
|
{% set role_for_user = h.d4science_theme_get_user_role_for_group_or_org(group.id, username_id) %}
|
|
{% if role_for_user and role_for_user == 'admin' %}
|
|
<input name="group_remove.{{ group.id }}" value="{{ _('Remove') }}" type="submit" class="btn btn-danger btn-small media-edit" title="{{ _('Remove dataset from this group') }}"/>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
</li>
|
|
{% endblock %}
|
|
{% if position is divisibleby 3 %}
|
|
<li class="clearfix js-hide"></li>
|
|
{% endif %}
|