{% extends "user/read_base.html" %}

{% set user = user_dict %}
{% set org_type = h.default_group_type('organization') %}
{% set orgs_available = h.organizations_available(permission='manage_group',
  include_dataset_count=True,
  include_member_count=True,
  user=user['name'])
%}

{% block primary_content_inner %}
  <h1>{{ h.humanize_entity_type('organization', org_type, 'facet label') or _('Organizations') }}</h1
  {% if orgs_available %}
    <div class="wide">
      {% snippet "organization/snippets/organization_list.html", organizations=orgs_available, show_capacity=True %}
    </div>
  {% else %}
    <p class="empty">
      {% if is_myself %}
        {{ h.humanize_entity_type('organization', org_type, 'you not member') or _('You are not a member of any organizations.') }}
      {% else %}
        {{ h.humanize_entity_type('organization', org_type, 'user not member') or _('User isn\'t a member of any organizations.') }}
      {% endif %}
    </p>
  {% endif %}
{% endblock %}
