{% load i18n sizeformat parse_date %}

<h3>{% trans "Share Group Overview" %}</h3>
<div class="detail">
  <hr class="header_rule">
  <dl class="dl-horizontal">
    <dt>{% trans "ID" %}</dt>
    <dd>{{ share_group.id }}</dd>
    <dt>{% trans "Name" %}</dt>
    <dd>{{ share_group.name }}</dd>
    <dt>{% trans "Description" %}</dt>
    <dd>{{ share_group.description }}</dd>
    <dt>{% trans "Status" %}</dt>
    <dd>{{ share_group.status|capfirst }}</dd>
    <dt>{% trans "Created" %}</dt>
    <dd>{{ share_group.created_at|parse_date }}</dd>
    <dt>{% trans "Host" %}</dt>
    <dd>{{ share_group.host}}</dd>
    {% if share_group.source_share_group_snapshot_id %}
    <dt>{% trans "Source share group snapshot" %}</dt>
    <dd>{{ share_group.source_share_group_snapshot_id}}</dd>
    {% endif %}
    <dt>{% trans "Capabilities" %}</dt>
    <dd>
        {% if share_group.consistent_snapshot_support %}
            Consistent snapshots are supported at storage <b>
            {{ share_group.consistent_snapshot_support }} </b> level
        {% else %}
            None
        {% endif %}
    </dd>
    {% if share_group.availability_zone %}
    <dt>{% trans "Availability Zone" %}</dt>
    <dd>{{ share_group.availability_zone }}</dd>
    {% endif %}
    {% if share_group.share_network_id %}
    <dt>{% trans "Share network" %}</dt>
    {% url 'horizon:admin:share_networks:share_network_detail' share_group.share_network_id as sn_url%}
    <dd><a href="{{ sn_url }}">{{ share_group.share_network_id }}</a></dd>
    {% endif %}
    {% if share_group.share_server_id %}
    <dt>{% trans "Share server" %}</dt>
    {% url 'horizon:admin:share_servers:share_server_detail' share_group.share_server_id as share_server_url%}
    <dd><a href="{{ share_server_url }}">{{ share_group.share_server_id }}</a></dd>
    {% endif %}
    {% if share_group.share_group_type %}
    <dt>{% trans "Share Group Type" %}</dt>
    {% url 'horizon:admin:share_group_types:index' as sgts_url %}
    <dd>
        <div>
            <b>{% trans "Share Group Type Name:" %}</b>
            {{ share_group.share_group_type.name }}
        </div>
        <div>
            {% trans "Share Group Type ID:" %}
            <a href="{{ sgts_url}}">{{ share_group.share_group_type.id }}</a>
        </div>
        <div>
            {% trans "Share Group Type Specs:" %}
            {{ share_group.share_group_type.group_specs }}
        </div><p></p>
    </dd>
    {%  endif %}
    {% if share_group.share_types %}
    <dt>{% trans "Share Types" %}</dt>
    {% for st in share_group.share_types %}
      <dd>
          <div>
              <b>{%  trans "Share Type Name:" %}</b>
              {{ st.name }}
          </div>
        <div>
            {%  trans " Share Type Visibility:" %}
            {% if st.is_public %}Public{% else %}Private{% endif %}
        </div>
        <div>
            {%  trans "Network handling enabled:" %} {{ st.dhss }}
        </div>
      </dd><p></p>
    {% endfor %}
    {% endif %}
    {% if share_group.members %}
    <dt>{% trans "Shares" %}</dt>
    {% for m in share_group.members %}
      {% url 'horizon:admin:shares:detail' m.id as share_url%}
      <dd>
        <div>
          <a href="{{ share_url }}">{% if m.name %}{{ m.name }}{% else %}{{ m.id }}{% endif %}</a>
        </div>
      </dd>
    {% endfor %}
    {% endif %}
  </dl>
</div>
