{% extends 'base.html' %}
{% load i18n sizeformat %}
{% block title %}{% trans "Backup Details" %}{% endblock %}

{% block page_header %}
  {% include "horizon/common/_page_header.html" with title=_("Backup Details: ")|add:backup.name %}
{% endblock page_header %}

{% block main %}
<div class="row">
  <div class="col-sm-12">
    <h3>{% trans "Backup Overview" %}</h3>

    <div class="status row detail">
      <h4>{% trans "Info" %}</h4>
      <hr class="header_rule">
      <dl>
        <dt>{% trans "Name" %}</dt>
        <dd>{{ backup.name }}</dd>
        <dt>{% trans "Description" %}</dt>
        <dd>{{ backup.description|linebreaksbr }}</dd>
        <dt>{% trans "ID" %}</dt>
        <dd>{{ backup.id }}</dd>
        {% if backup.datastore %}
            <dt>{% trans "Datastore" %}</dt>
            <dd>{{ backup.datastore.type }}</dd>
            <dt>{% trans "Datastore Version" %}</dt>
            <dd>{{ backup.datastore.version }}</dd>
        {% endif %}
        <dt>{% trans "Status" %}</dt>
        <dd>{{ backup.status|title }}</dd>
        <dt>{% trans "Backup File Location" %}</dt>
        <dd>{{ backup.locationRef }}</dd>
        <dt>{% trans "Initial Volume Size" %}</dt>
        <dd>{{ backup.size }} {% trans "GB" %}</dd>
        <dt>{% trans "Created" %}</dt>
        <dd>{{ backup.created|parse_isotime }}</dd>
        <dt>{% trans "Updated" %}</dt>
        <dd>{{ backup.updated|parse_isotime }}</dd>
        <dt>{% trans "Backup Duration" %}</dt>
        <dd>{{ backup.duration }}</dd>
      </dl>
    </div>

    {% if backup.parent %}
    <div class="status row-fluid detail">
      <h4>{% trans "Incremental Backup" %}</h4>
      <hr class="header_rule">
      <dl>
        <dt>{% trans "Parent Backup" %}</dt>
        <dd>
           {% url 'horizon:project:database_backups:detail' backup.parent.id as parent_url %}
           <a href="{{ parent_url }}">{{ backup.parent.name }}</a>
        </dd>
      </dl>
    </div>
    {% endif %}

    {% if instance %}
    <div class="addresses row detail">
      <h4>{% trans "Database Info" %}</h4>
      <hr class="header_rule">
      <dl>
        <dt>{% trans "Name" %}</dt>
        <dd>{{ instance.name }}</dd>
        <dt>{% trans "ID" %}</dt>
        <dd>
          {% url 'horizon:project:databases:detail' instance.id as instance_url %}
          <a href="{{ instance_url }}">{{ instance.id }}</a>
        </dd>
        <dt>{% trans "Status" %}</dt>
        <dd>{{ instance.status|title }}</dd>
      </dl>
    </div>
    {% endif %}
  </div>
</div>
{% endblock %}
