{% extends "page.html" %}


{% block subtitle %}{{ h.humanize_entity_type('group', group_type, 'page title') or _('Groups') }}{% endblock %}

{% block breadcrumb_content %}
  <li class="active">{% link_for h.humanize_entity_type('group', group_type, 'breadcrumb') or _('Groups'), named_route=group_type+'.index' %}</li>
{% endblock %}

{% block content_action %}
  {% if h.check_access('group_create') %}
    {% link_for h.humanize_entity_type('group', group_type, 'add link') or _('Add Group'), named_route=group_type+'.new', class_='btn btn-primary float-md-end', icon='plus-square' %}
  {% endif %}
{% endblock %}

{% block page_header %}{% endblock %}
{% block page_primary_action %}{% endblock %}

{% block primary_content_inner %}
  <h1>{% block page_heading %}{{ h.humanize_entity_type('group', group_type, 'page title') or _('Groups') }}{% endblock %}</h1>
  {% block groups_search_form %}
    {% snippet 'snippets/search_form.html', form_id='group-search-form', type=group_type, query=q, sorting_selected=sort_by_selected, count=page.item_count, placeholder=h.humanize_entity_type('group', group_type, 'search placeholder') or _('Search groups...'), show_empty=request.args, no_bottom_border=true if page.items, sorting = [(_('Name Ascending'), 'title asc'), (_('Name Descending'), 'title desc')] %}
  {% endblock %}
  {% block groups_list %}
    {% if page.items or request.args %}
      {% if page.items %}
        {% snippet "group/snippets/group_list.html", groups=page.items %}
      {% endif %}
    {% else %}
      <p class="empty">
        {{ h.humanize_entity_type('group', group_type, 'no any objects') or _('There are currently no groups for this site') }}.
      </p>
    {% endif %}
  {% endblock %}
  {% block page_pagination %}
    {{ page.pager(q=q or '', sort=sort_by_selected or '') }}
  {% endblock %}
{% endblock %}

{% block secondary_content %}
  {% snippet "group/snippets/helper.html", group_type=group_type %}
{% endblock %}
