{% load i18n sizeformat %}

<div class="detail">
    <dl class="dl-horizontal">
        <dt>{% trans "Name" %}</dt>
        <dd>{{ template.name }}</dd>
        <dt>{% trans "Project ID" %}</dt>
        {% if template.tenant_id %}
        <dd>{{ template.tenant_id }}</dd>
        {% else %}
        <dd>{{ template.project_id }}</dd>
        {% endif %}
        <dt>{% trans "ID" %}</dt>
        <dd>{{ template.id }}</dd>
        <dt>{% trans "Description" %}</dt>
        <dd>{{ template.description|default:_("None") }}</dd>
        <dt>{% trans "Public" %}</dt>
        <dd>{{ template.is_public|yesno }}</dd>
        <dt>{% trans "Protected" %}</dt>
        <dd>{{ template.is_protected|yesno }}</dd>
        <dt>{% trans "Base Image" %}</dt>
        {% if template.image_id and base_image_name %}
            <dd><a href="{% url 'horizon:project:images:images:detail' template.image_id %}">{{ base_image_name }}</a></dd>
        {% else %}
            <dd>{% trans "No image specified" %}</dd>
        {% endif %}

    </dl>
    <dl class="dl-horizontal">
        <dt>{% trans "Flavor" %}</dt>
        <dd>{{ flavor.name }}</dd>
    </dl>
    {% if template.availability_zone %}
    <dl class="dl-horizontal">
        <dt>{% trans "Availability Zone" %}</dt>
        <dd>{{ template.availability_zone }}</dd>
    </dl>
    {% endif %}
    {% if template.floating_ip_pool %}
    <dl class="dl-horizontal">
        <dt>{% trans "Floating IP Pool" %}</dt>
        <dd><a href="{% url 'horizon:project:networks:detail' template.floating_ip_pool %}">{{ floating_ip_pool_name }}</a></dd>
    </dl>
    {% endif %}
    <dl class="dl-horizontal">
        <dt>{% trans "Plugin" %}</dt>
        <dd><a href="{% url 'horizon:project:data_processing.jobs:details' template.plugin_name %}">{{ template.plugin_name }}</a></dd>
        <dt>{% trans "Version" %}</dt>
        <dd>{{ template.hadoop_version }}</dd>
    </dl>

    <dl class="dl-horizontal">
        <dt>{% trans "Use auto-configuration" %}</dt>
        <dd>{{ template.use_autoconfig }}</dd>
    </dl>
  <dl class="dl-horizontal">
    <dt>{% trans "Proxy Gateway" %}</dt>
    <dd>{{ template.is_proxy_gateway }}</dd>
  </dl>

  <dl class="dl-horizontal">
    <dt>{% trans "Auto Security Group" %}</dt>
    <dd>{{ template.auto_security_group }}</dd>
  </dl>

  <dl class="dl-horizontal">
  {% if show_bfv %}
    <dt>{% trans "Boot from Volume" %}</dt>
    <dd>{{ template.boot_from_volume }}</dd>
    {% if template.boot_from_volume %}
      <dt>{% trans "Boot Volume type" %}</dt>
      <dd>{{ template.boot_volume_type }}</dd>
      <dt>{% trans "Boot Volume AZ" %}</dt>
      <dd>{{ template.boot_volume_availability_zone }}</dd>
      <dt>{% trans "Boot Volume locality" %}</dt>
      <dd>{{ template.boot_volume_local_to_instance }}</dd>
    {% endif %}
  {% endif %}
  </dl>

  <dl class="dl-horizontal">
    <dt>{% trans "Security Groups" %}</dt>
    <dd>
        <ul class="list-bullet">
            {% for group in security_groups %}
                {% if group.id %}
                    <li><a href="{% url 'horizon:project:security_groups:detail' group.id %}">{{ group.name }}</a></li>
                {% else %}
                    <li>{{ group.name }}</li>
                {% endif %}
            {% endfor %}
        </ul>
    </dd>
  </dl>

  <dl class="dl-horizontal">
    <dt>{% trans "Node Processes" %}</dt>
    <dd>
        <ul class="list-bullet">
            {% for process in template.node_processes %}
                <li>{{ process }}</li>
            {% endfor %}
        </ul>
    </dd>
  </dl>
  <dl class="dl-horizontal">
    <h4>{% trans "HDFS placement" %}</h4>
    {% if template.volumes_per_node %}
    <h6>{% trans "Cinder volumes" %}</h6>
    <dt>{% trans "Volumes per node" %}</dt>
    <dd>{{ template.volumes_per_node }}</dd>
    <dt>{% trans "Volumes size" %}</dt>
    <dd>{{ template.volumes_size }}</dd>
    <dt>{% trans "Volumes type" %}</dt>
    <dd>{{ template.volume_type }}</dd>
    <dt>{% trans "Volumes local to instance" %}</dt>
    <dd>{{ template.volume_local_to_instance }}</dd>
    {% if template.volumes_availability_zone %}
      <dt>{% trans "Volumes Availability Zone" %}</dt>
      <dd>{{ template.volumes_availability_zone }}</dd>
    {% endif %}
    {% else %}
    <h6>{% trans "Ephemeral drive" %}</h6>
    {% endif %}
  </dl>
</div>
