{% extends "page.html" %}
{% block subtitle -%}
{{ ui.subtitle_item(h.humanize_entity_type('group', group_type, 'page title') or _('Groups')) }}
{%- endblock %}
{% block breadcrumb_content -%}
{{ ui.breadcrumb(h.humanize_entity_type('group', group_type, 'breadcrumb') or _('Groups'), href=h.url_for(group_type+'.index'), active=request.endpoint == group_type~".index") }}
{%- endblock %}
{% block content_action -%}
{{ ui.content_action(h.humanize_entity_type('group', group_type, 'add link') or _('Add Group'), href=h.url_for(group_type ~ '.new'), icon="add") if h.check_access('group_create') }}
{%- endblock %}
{%- set page_heading | trim -%}
{% block page_heading %}{{ h.humanize_entity_type('group', group_type, 'page title') or _('Groups') }}{% endblock %}
{%- endset %}
{% block primary_content_inner %}
{%- call ui.util.call(ui.section, title=page_heading, level=1) -%}
{% block groups_list %}
{% if page.items or request.args %}
{% if page.items %}
{%- call ui.util.call(ui.group_list) -%}
{%- for group in page.items -%}
{{ ui.group(group=group) }}
{%- endfor %}
{%- endcall %}
{% endif %}
{% else %}
{{ ui.empty(_('There are currently no groups for this site')) }}
{% endif %}
{% endblock %}
{% block page_pagination %}
{{ ui.pagination(page=page.page, total=page.last_page, url_params={"q": q or "", "sort": sort_by_selected or ''}) }}
{% endblock %}
{%- endcall %}
{% endblock %}
{%- block secondary_content -%}
{%- call ui.util.call(ui.filters) -%}
{% block groups_search_form %}
{%- call ui.util.call(ui.facet_section, title=_("Query")) -%}
{{ ui.input(name="q", placeholder=_("Search"), value=q) }}
{%- endcall %}
{%- call ui.util.call(ui.facet_section, title=_("Sort by")) -%}
{{ ui.search_sort_control(selected=sort_by_selected, label=null, options=[(_('Name Ascending'), 'title asc'), (_('Name Descending'), 'title desc')]) }}
{%- endcall %}
{% endblock %}
{%- endcall %}
{%- endblock %}