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

{% block onSubmit %}
doSubmit({
    form: this,
    event: e,
    url: '{{ request.path }}',
    progressbar: {
      steps: [
         {"label": gettext("Verifying files n packages")},
      ],
      poolUrl: '{% url "system_verify_progress" %}',
      mode: 'single',
      fileUpload: false
    }
});
{% endblock %}

{% block form %}

{% if error %}
    <p style="font-size:16px;">The following Inconsistencies were found in your Current Install:</p>

    {% if checksums %}
      <div id="checksums_error_list">
        <p style="font-size:13px;">List of Checksum Mismatches: </p>
        <table>
          {% for error_dict in checksums %}
            <tr>
               <td style="word-wrap: break-word; word-break: break-word; width:1100px;">  {{  error_dict.path  }}  </td>
            </tr>
          {% endfor %}
        </table>
      </div>
    {% endif %}

    {% if notfound %}
      <div id="notfound_error_list">
        <p style="font-size:13px;">List of Files/Directories/Symlinks not Found: </p>
        <table>
          {% for error_dict in notfound %}
            <tr>
               <td style="word-wrap: break-word; word-break: break-word; width:1100px;">  {{  error_dict.path  }}  </td>
            </tr>
          {% endfor %}
        </table>
      </div>
    {% endif %}

    {% if wrongtype %}
      <div id="wrongtype_error_list">
        <p style="font-size:13px;">List of Incorrect Filetypes: </p>
        <table>
          {% for error_dict in wrongtype %}
            <tr>
               <td style="word-wrap: break-word; word-break: break-word; width:700px;">  {{  error_dict.path  }}  </td>
               <td style="word-wrap: break-word; word-break: break-word; width:400px;">  {{  error_dict.problem  }}  </td>
            </tr>
          {% endfor %}
        </table>
      </div>
    {% endif %}

    {% if perms %}
      <div id="perm_error_list">
        <p style="font-size:13px;">List of Permission Errors: </p>
        <table>
          {% for error_dict in perms %}
            <tr>
               <td style="word-wrap: break-word; word-break: break-word; width:700px;">  {{  error_dict.path  }}  </td>
               <td style="word-wrap: break-word; word-break: break-word; width:400px;">  {{  error_dict.problem|linebreaksbr  }}  </td>
            </tr>
          {% endfor %}
        </table>
      </div>
    {% endif %}

{% elif success %}
    {% blocktrans %}<bold>All files verified successfully!</bold>{% endblocktrans %}
{% else %}
    {% blocktrans %}Start the Verification process now?{% endblocktrans %}
    <br /><br />
{% endif %}
{% endblock %}

{% block oklabel %}
{% trans "OK" %}
{% endblock %}

{% block buttons %}
{% if error or success %}
<button id="btn_Update_Close" data-dojo-type="dijit.form.Button"type="button">
    {% trans "Close" %}
    <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
        cancelDialog(this);
    </script>
</button>
{% else %}
{{ block.super }}
{% endif %}
{% endblock %}
