{% extends "freeadmin/generic_model_datagrid.html" %}

{% block actions_static_buttons %}
{{ block.super }}
    <div class="gridAdd left">
      <button id="datagridBtn_Boot_Add" data-dojo-type="dijit.form.Button" type="button">
          {% blocktrans with name=verbose_name %}Create{% endblocktrans %}
      <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
          editObject('{% trans "Create Boot"|escapejs %}', '{% url "system_bootenv_add" %}', [this,]);
      </script>
      </button>
      <button id="datagridBtn_Boot_Scrub" data-dojo-type="dijit.form.Button" type="button">
          {% blocktrans %}Scrub Boot{% endblocktrans %}
      <script type="dojo/method" data-dojo-event="onClick">
          editObject('Boot Scrub', '{% url "system_bootenv_scrub" %}', [this,]);
      </script>
      <button id="datagridBtn_Status" data-dojo-type="dijit.form.Button" type="button">
          {% blocktrans %}Status{% endblocktrans %}
      <script type="dojo/method" data-dojo-event="onClick">
          viewModel('Boot Status', '{% url "freeadmin_system_bootstatus_datagrid" %}', [this,]);
      </script>
      </button>
    </div>
    {% if bootme %}
      <div class="gridAdd left" style="padding-left: 10px">
        <strong>{% trans "Boot Volume Condition" %}: {{ stats.0 }} {{ stats.1 }}</strong><br />
          {% if bootme.scrub.status == "IN_PROGRESS" %}
            <p style="padding: 3px;">{% trans "Scrub Status" %}: {{ bootme.scrub.status_verbose }}</p>
            <!-- comment this till one can find a auto refresh method
            <p style="padding: 3px;">
              {% if bootme.scrub.progress %}{% trans "Progress" %}: {{ bootme.scrub.progress }}% &nbsp; &nbsp; {% endif %}
              {% if bootme.scrub.scanned %}{% trans "Scan" %}: {% blocktrans with scanned=bootme.scrub.scanned total=bootme.scrub.total %}{{ scanned }} out of {{ total }}{% endblocktrans %} &nbsp; &nbsp; {% endif %}
            </p>
            -->
          {% endif %}
        <p>{% if bootme.scrub.date %}{% trans "Last Scrub Run on" %}: {{ bootme.scrub.date }} &nbsp; &nbsp; {% endif %}</p>
      </div>
    {% endif %}
{% endblock %}
