{% load i18n sizeformat parse_date %}

<h3>{% trans "Share Instance Overview" %}</h3>
<div class="detail">
  <hr class="header_rule">
  <dl class="dl-horizontal">
    <dt>{% trans "ID" %}</dt>
    <dd>{{ share_instance.id }}</dd>
    <dt>{% trans "Status" %}</dt>
    <dd>{{ share_instance.status|capfirst }}</dd>
    <dt>{% trans "Export locations" %}</dt>
    {% if share_instance.export_locations %}
    {% for el in share_instance.export_locations %}
      <dd><p>
        <div><b>Path:</b>
            <input type="text" readonly="true"
                   value="{{ el.path }}" size="{{ share_instance.el_size }}"
                   onClick="this.setSelectionRange(0, this.value.length)">
        </div>
        <div><b>Preferred:</b> {{ el.preferred }}</div>
        {% if el.is_admin_only == True or el.is_admin_only == False %}
        <div><b>Is admin only:</b> {{ el.is_admin_only }}</div>
        {% endif %}
      </p></dd>
    {% endfor %}
    {% endif %}
    <dt>{% trans "Host" %}</dt>
    <dd>{{ share_instance.host}}</dd>
    <dt>{% trans "Availability Zone" %}</dt>
    <dd>{{ share_instance.availability_zone}}</dd>
    <dt>{% trans "Share ID" %}</dt>
    {% url 'horizon:project:shares:detail' share_instance.share_id as share_url %}
    <dd><a href="{{ share_url }}">{{ share_instance.share_id }}</a></dd>
    {% if share_instance.share_network_id %}
    <dt>{% trans "Share network" %}</dt>
    {% url 'horizon:project:shares:share_network_detail' share_instance.share_network_id as sn_url%}
    <dd><a href="{{ sn_url }}">{{ share_instance.share_network_id }}</a></dd>
    {% endif %}
    {% if share_instance.share_server_id %}
    <dt>{% trans "Share server" %}</dt>
    {% url 'horizon:admin:shares:share_server_detail' share_instance.share_server_id as share_server_url%}
    <dd><a href="{{ share_server_url }}">{{ share_instance.share_server_id }}</a></dd>
    {% endif %}
    <dt>{% trans "Created" %}</dt>
    <dd>{{ share_instance.created_at|parse_date }}</dd>
  </dl>
</div>
