{% extends "freeadmin/generic_model_datagrid.html" %}
{% block actions_static_pane %}
{% if pool %}
  <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top', splitter: false" style="background-color: white;height: 60px; margin: 7px;" doLayout="false">
    {% if pool.resilver.status and pool.resilver.status != "NONE" %}
    <strong>{% trans "Resilver" %}</strong><br />
    <p style="padding: 3px;">{% trans "Status" %}: {{ pool.resilver.status_verbose }}</p>
      {% if pool.resilver.status == "IN_PROGRESS" %}
      <p style="padding: 3px;">
        {% if pool.resilver.progress %}{% trans "Progress" %}: {{ pool.resilver.progress }}% &nbsp; &nbsp; {% endif %}
        {% if pool.resilver.scanned %}{% trans "Scan" %}: {% blocktrans with scanned=pool.resilver.scanned total=pool.resilver.total %}{{ scanned }} out of {{ total }}{% endblocktrans %} &nbsp; &nbsp; {% endif %}
      </p>
      {% endif %}
      {% if pool.resilver.status == "COMPLETED" %}
      <p style="padding: 3px;">
        {% if pool.resilver.errors %}{% trans "Errors" %}: {{ pool.resilver.errors }} &nbsp; &nbsp; {% endif %}
        {% if pool.resilver.date %}{% trans "Date" %}: {{ pool.resilver.date }} &nbsp; &nbsp; {% endif %}
      </p>
      {% endif %}
    {% else %}
    <strong>{% trans "Scrub" %}</strong><br />
    <p style="padding: 3px;">{% trans "Status" %}: {{ pool.scrub.status_verbose }}</p>
      <!-- comment this till one can find a auto refresh method
      {% if pool.scrub.status == "IN_PROGRESS" or pool.scrub.status == "PAUSED" %}
      <p style="padding: 3px;">
        {% if pool.scrub.progress %}{% trans "Progress" %}: {{ pool.scrub.progress }}% &nbsp; &nbsp; {% endif %}
        {% if pool.scrub.scanned %}{% trans "Scan" %}: {% blocktrans with scanned=pool.scrub.scanned total=pool.scrub.total %}{{ scanned }} out of {{ total }}{% endblocktrans %} &nbsp; &nbsp; {% endif %}
      </p>
      {% endif %}
      -->
      {% if pool.scrub.status == "COMPLETED" %}
      <p style="padding: 3px;">
        {% if pool.scrub.errors %}{% trans "Errors" %}: {{ pool.scrub.errors }} &nbsp; &nbsp; {% endif %}
        {% if pool.scrub.repaired %}{% trans "Repaired" %}: {{ pool.scrub.repaired }} &nbsp; &nbsp; {% endif %}
        {% if pool.scrub.date %}{% trans "Date" %}: {{ pool.scrub.date }} &nbsp; &nbsp; {% endif %}
      </p>
      {% endif %}
    {% endif %}
  </div>
{% endif %}
{% endblock %}
