{#
/**
 * @file
 *
 * Default theme implementation for profiles.
 *
 * Available variables:
 * - content: Items for the content of the profile.
 *   Use 'content' to print them all, or print a subset such as
 *   'content.title'. Use the following code to exclude the
 *   printing of a given child element:
 *   @code
 *   {{ content|without('title') }}
 *   @endcode
 * - attributes: HTML attributes for the wrapper.
 * - profile: The profile object.
 * - url: The profile URL.
 * - join: The join method actions.
 *
 * @ingroup themeable
 */
#}
{{ attach_library('socialbase/hero')}}

{%
  set cover_classes = [
    'cover',
    group_hero_styled_image_url ? 'cover-img cover-img-gradient',
  ]
%}

{%
  set cover_wrap_classes = 'cover-wrap'
%}

<div{{ attributes.addClass(cover_classes) }} {% if group_hero_styled_image_url %} style="background-image: url('{{ group_hero_styled_image_url }}');" {% endif %}>
  <div class="hero__bgimage-overlay"></div>
  {% if group_edit_url %}
    <div class="hero-action-button">
      <a href="{{ group_edit_url }}" title="{% trans %}Edit group{% endtrans %}" class="btn btn-default btn-floating">
        <svg class="icon-gray icon-medium" aria-hidden="true">
          <title>{% trans %}Edit group{% endtrans %}</title>
          <use xlink:href="#icon-edit"></use>
        </svg>
      </a>
    </div>
  {% endif %}
  <div class="{{ cover_wrap_classes }}">
    <header class="page-title">
      <h1>
          {% if closed_group_lock %}
              <svg class="icon-white icon-medium" aria-hidden="true">
                <title>{% trans %} Closed group {% endtrans %}</title>
                  <use xlink:href="#icon-lock"></use>
              </svg>
          {% elseif secret_group_shield %}
              <svg class="icon-white icon-medium" aria-hidden="true">
                <title>{% trans %} Secret group {% endtrans %}</title>
                  <use xlink:href="#icon-shield"></use>
              </svg>
          {% endif %}
          <span>{{ title }}</span></h1>
        {% if group_type %}
          <span>{{ group_type }}</span>
        {% endif %}
          {% if group_settings_help %}
            <span>
              {{ group_settings_help }}
            </span>
          {% endif %}
        &bullet;
        <span>
          {% trans %}1 member {% plural group_members %} @count members{% endtrans %}
        </span>
    </header>
    <footer class="hero-footer">
      <div class="hero-footer__text">
        {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %}
          <svg class="hero-footer-icon">
            <title>{% trans %} Located at {% endtrans %}</title>
            <use xlink:href="#icon-location"></use>
          </svg>
        {% endif %}
        <span class="inline-center">
          {{ content.field_group_location }}
          {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %} &bullet;{% endif %}
          {{ content.field_group_address }} </span>
      </div>

      {{ join }}
    </footer>
  </div> {# cover-wrap #}
</div> {# cover #}
