{% extends "freeadmin/generic_form.html" %}
{% block onSubmit %}
doSubmit({
    form: this,
    event: e,
    url: '{{ request.path }}',
    longRunning: true,
    progressbar: {
      steps: [
         {"label": gettext("Downloading packages")},
         {"label": gettext("Installing packages")}
      ],
      poolUrl: '{% url "system_update_progress" %}',
      fileUpload: false
    }
});
{% endblock %}
{% block form %}
<tr>
  <td>
{% if update %}
{% if update.Notice %}
<strong>{% trans "NOTICE" %}: {{ update.Notice }}</strong>
{% endif %}
{% if update.Notes %}
{% for note, url_ in update.Notes.items %}
<p><a href="{{ url_ }}" target="_blank">{{ note }}</a></p>
{% endfor %}
{% endif %}

{% if changelog %}
{% trans "Changelog" %}:
<pre style="padding: 8px; margin: 4px; max-height: 100px; overflow: auto;">{{ changelog }}</pre>
{% endif %}

{% trans "The following packages will be downloaded:" %}
<pre style="padding: 8px; margin: 4px;">{{ handler.output }}</pre>
<p><input data-dojo-type="dijit.form.CheckBox" name="apply" type="checkbox" checked="checked" value="1" /> {% trans "Apply updates after downloading" %}{% if handler.reboot %} ({% trans "The system will reboot" %}){% endif %}</p>
{% trans "Do you want to continue?" %}
{% else %}
    {% if not network %}
    <p>{% trans "Update server could not be reached" %}</p>
    {% else %}
    <p>{% trans "No updates available" %}</p>
    {% endif %}
{% endif %}
  </td>
</tr>
{% endblock %}

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

{% block buttons %}
{% if update %}
{{ block.super }}
{% else %}
<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>
{% endif %}
{% endblock %}
