{% load i18n sizeformat %}

<div class="detail">
  <dl class="dl-horizontal">
    <dt>{% trans "Name" %}</dt>
    <dd data-display="{{ stack.stack_name|default:stack.id }}">{{ stack.stack_name }}</dd>
    <dt>{% trans "ID" %}</dt>
    <dd>{{ stack.id }}</dd>
    <dt>{% trans "Description" %}</dt>
    <dd>{{ stack.description }}</dd>
  </dl>

  <h4>{% trans "Status" %}</h4>
  <hr class="header_rule">
  <dl class="dl-horizontal">
    <dt>{% trans "Created" %}</dt>
    <dd>{{ stack.creation_time|parse_isotime|timesince_or_never }}</dd>
    <dt>{% trans "Last Updated" %}</dt>
    <dd>{{ stack.updated_time|parse_isotime|timesince_or_never }}</dd>
    <dt>{% trans "Status" %}</dt>
    <dd>
      {% blocktrans with stack_status_title=stack.stack_status|title stack_status_reason=stack.stack_status_reason %}{{ stack_status_title }}: {{ stack_status_reason }}{% endblocktrans %}
    </dd>
  </dl>

  <h4>{% trans "Outputs" %}</h4>
  <hr class="header_rule">
  <dl class="dl-horizontal">
    {% for output in stack.outputs %}
    <dt>{{ output.output_key }}</dt>
    <dd>{{ output.description }}</dd>
    <dd>
    {{ output.output_value|stack_output }}
    </dd>
    {% endfor %}
  </dl>

  <h4>{% trans "Stack Parameters" %}</h4>
  <hr class="header_rule">
  <dl class="dl-horizontal">
    {% for key, value in stack.parameters.items %}
    <dt>{{ key }}</dt>
    <dd>{{ value }}</dd>
    {% endfor %}
  </dl>

  <h4>{% trans "Launch Parameters" %}</h4>
  <hr class="header_rule">
  <dl class="dl-horizontal">
    <dt>{% trans "Timeout" %}</dt>
    <dd>{{ stack.timeout_mins }} {% trans "Minutes" %}</dd>
    <dt>{% trans "Rollback" %}</dt>
    <dd>{% if stack.disable_rollback %}{% trans "Disabled" %}{% else %}{% trans "Enabled" %}{% endif %}</dd>
  </dl>
</div>
