{% extends "user/dashboard.html" %}
{% set group_type = h.default_group_type('group') %}
{%- 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')) if h.check_access('group_create') }}
{%- endblock %}
{%- set page_heading = h.humanize_entity_type('group', group_type, 'my label') or _('My Groups') -%}
{% block primary_content_inner %}
{%- call ui.util.call(ui.section, title=page_heading, level=1) -%}
{% set groups = h.groups_available(am_member=True, include_dataset_count=True, include_member_count=True) %}
{% if groups %}
{%- call ui.util.call(ui.group_list) -%}
{%- for group in groups -%}
{{ ui.group(group=group) }}
{%- endfor %}
{%- endcall %}
{% else %}
{%- call ui.util.call(ui.empty) -%}
{{ h.humanize_entity_type('group', group_type, 'you not member') or _('You are not a member of any groups.') }}
{{ ui.link(_('Create one now?'), href=h.url_for(group_type ~ '.new')) if h.check_access('group_create')}}
{%- endcall %}
{% endif %}
{%- endcall %}
{% endblock %}