{% extends "page.html" %}

{% block subtitle %}{{ _('Groups of Datasets') }}{% endblock %}

{% block breadcrumb_content %}
  <li class="active">{% link_for _('Groups'), controller='group', action='index' %}</li>
{% endblock %}

{% block add_action_content %}
  {% if h.check_access('group_create') %}
    {% link_for _('Add Group'), controller='group', action='new', class_='btn btn-primary', icon='plus-sign-alt' %}
  {% endif %}
{% endblock %}

{% block primary_content %}
  <div class="module">
    <div class="module-content">
      <h1>{{ _('Groups') }}</h1>
      {% if c.page.items or request.params %}
        {% snippet "group/snippets/group_list.html", groups=c.page.items %}
      {% else %}
        <p class="empty">
          {{ _('There are currently no groups for this site') }}.
          {% if h.check_access('group_create') %}
            {% link_for _('How about creating one?'), controller='group', action='new' %}</a>.
          {% endif %}
        </p>
      {% endif %}
    </div>
    {{ c.page.pager() }}
  </div>
{% endblock %}

{% block secondary_content %}
  <div class="module module-narrow module-shallow">
    <h2 class="module-heading">
      <i class="icon-info-sign"></i>
      {{ _('What are Groups?') }}
    </h2>
    <div class="module-content">
      {% trans %}
        <p>Groups allow you to group together datasets under a community (for
          example, Civil Liberty data) or topic (e.g. Transport, Health,
          Environment) to make it easier for users to browse datasets by theme.
          Datasets can be part of a group, but do not belong to the group for
          editing or authorisation purposes.</p>
      {% endtrans %}
    </div>
  </div>
{% endblock %}
