Permalink
Browse files

Change firmware upgrade form to use progress steps

  • Loading branch information...
1 parent d7bbd9c commit 9aaef7b5242812261e18a1f17f5a14f4cb394f2f @william-gr william-gr committed Jun 28, 2013
Showing with 34 additions and 27 deletions.
  1. +34 −27 gui/templates/system/wizard.html
@@ -1,29 +1,36 @@
{% load freeadmin %}<div data-dojo-type="dijit.layout.ContentPane" class="objrefresh" doLayout="false">
- <h1>{% blocktrans with step=wizard.steps.step1 step_count=wizard.steps.count %}Step {{ step }} of {{ step_count }}{% endblocktrans %}</h1>
- <form data-dojo-type="dijit.form.Form" action="." enctype="multipart/form-data" method="post">{% csrf_token %}
- <script type="dojo/event" event="onSubmit" args="e">
- doSubmit({
- form: this,
- event: e,
- url: '{{ request.path }}',
- progressbar: true
- });
- </script>
- <table class="form">
- {% block form %}
- {% dojo_render wizard.management_form %}
- {% admin_form wizard.form %}
- {% endblock %}
- <tr>
- <td colspan="2">
- <button class="submitform" data-dojo-type="dijit.form.Button" type="submit" data-dojo-props="type:'submit'">
- {% trans "Apply Update" %}
- <script type="dojo/method" event="onClick" args="evt">
- this.set('label', '{% trans "Please wait..."|force_escape|force_escape %}');
- </script>
- </button>
- </td>
- </tr>
- </table>
- </form>
+ <h1>{% blocktrans with step=wizard.steps.step1 step_count=wizard.steps.count %}Step {{ step }} of {{ step_count }}{% endblocktrans %}</h1>
+ <form data-dojo-type="dijit.form.Form" action="." enctype="multipart/form-data" method="post">{% csrf_token %}
+ <script type="dojo/event" event="onSubmit" args="e">
+ doSubmit({
+ form: this,
+ event: e,
+ url: '{{ request.path }}',
+ progressbar: {
+ steps: [
+ {"label": "Uploading firmware"},
+ {"label": "Extracting firmware"},
+ {"label": "Writing new firmware"}
+ ],
+ poolUrl: '{% url "system_firmware_progress" %}'
+ }
+ });
+ </script>
+ <table class="form">
+ {% block form %}
+ {% dojo_render wizard.management_form %}
+ {% admin_form wizard.form %}
+ {% endblock %}
+ <tr>
+ <td colspan="2">
+ <button class="submitform" data-dojo-type="dijit.form.Button" type="submit" data-dojo-props="type:'submit'">
+ {% trans "Apply Update" %}
+ <script type="dojo/method" event="onClick" args="evt">
+ this.set('label', '{% trans "Please wait..."|escapejs %}');
+ </script>
+ </button>
+ </td>
+ </tr>
+ </table>
+ </form>
</div>

0 comments on commit 9aaef7b

Please sign in to comment.