rename job new to submit
authorMaciej Tronowski <mtro@man.poznan.pl>
Fri, 24 Apr 2015 09:04:32 +0000 (11:04 +0200)
committerMaciej Tronowski <mtro@man.poznan.pl>
Fri, 24 Apr 2015 09:04:32 +0000 (11:04 +0200)
qcg/static/qcg/main.css
qcg/templates/qcg/base.html
qcg/templates/qcg/job_new.html [deleted file]
qcg/templates/qcg/job_submit.html [new file with mode: 0644]
qcg/urls.py
qcg/views.py

index 3a47bf9..a27898f 100644 (file)
@@ -29,7 +29,7 @@ footer.navbar-fixed-bottom {
 }
 
 
-/* new job view */
+/* submit job view */
 
 textarea {
     resize: vertical;
index 8318ed3..eeb792c 100644 (file)
@@ -32,8 +32,8 @@
                         <li{% ifequal request.resolver_match.url_name 'jobs' %} class="active"{% endifequal %}>
                             <a href="{% url 'jobs' %}">Zadania</a>
                         </li>
-                        <li{% ifequal request.resolver_match.url_name 'job_new' %} class="active"{% endifequal %}>
-                            <a href="{% url 'job_new' %}">Zleć zadanie</a>
+                        <li{% ifequal request.resolver_match.url_name 'job_submit' %} class="active"{% endifequal %}>
+                            <a href="{% url 'job_submit' %}">Zleć zadanie</a>
                         </li>
                         <li{% ifequal request.resolver_match.url_name 'gridftp' %} class="active"{% endifequal %}>
                             <a href="{% url 'gridftp' %}">GridFTP</a>
diff --git a/qcg/templates/qcg/job_new.html b/qcg/templates/qcg/job_new.html
deleted file mode 100644 (file)
index 77f6fc7..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-{% extends 'qcg/base.html' %}
-{% load staticfiles bootstrap3 qcg_utils %}
-
-{% block extra_css %}
-    <link href="{% static 'qcg/selectize/selectize.bootstrap3.css' %}" rel="stylesheet">
-{% endblock %}
-
-{% block extra_js %}
-    <script src="{% static 'qcg/selectize/selectize.min.js' %}"></script>
-    <script src="{% static 'qcg/formset/jquery.formset.js' %}"></script>
-
-    {% include 'filex/source.js.html' %}
-
-    <script>
-        var filex = filex || {};
-
-        $(function () {
-            'use strict';
-
-            var gridftpButton = $('<button/>', {
-                'type': 'button',
-                'class': 'btn btn-default pull-right',
-                'text': 'Wybierz',
-                'data-toggle': 'modal',
-                'data-target': '#gridftp'
-            });
-
-            function fullPath(path, file) {
-                var res = path + file.get('name');
-
-                if (file.isDir())
-                    res += '/';
-
-                return res;
-            }
-
-            $('#id_master_file,#id_executable,#id_input,#id_preprocess_script,#id_postprocess_script').before(function() {
-                var target = this;
-                return gridftpButton.clone().click(function() {
-                    $('#select-btn').off().click(function() {
-                        var selected = filex.selectedFiles();
-
-                        if (selected.length != 1 || !selected[0].isFile()) {
-                            alert('Wybierz dokładnie jeden plik.');
-                            return;
-                        }
-
-                        var file = fullPath(filex.host + '/' + filex.path.full() + '/', selected[0]);
-
-                        target.selectize.clear();
-                        target.selectize.addOption({value: file, text: file});
-                        target.selectize.addItem(file);
-                        target.selectize.refreshItems();
-
-                        $('#gridftp').modal('hide');
-                        filex.clearSelection();
-                    });
-                });
-            }).wrap('<div style="margin-right: 80px"></div>');
-
-            $('#id_stage_in').before(function() {
-                var target = this;
-                return gridftpButton.clone().click(function() {
-                    $('#select-btn').off().click(function() {
-                        var path = filex.host + '/' + filex.path.full() + '/';
-
-                        _.each(filex.selectedFiles(), function(item) {
-                            var file = fullPath(path, item);
-                            target.selectize.addOption({value: file, text: file});
-                            target.selectize.addItem(file);
-                        });
-                        target.selectize.refreshItems();
-
-                        $('#gridftp').modal('hide');
-                        filex.clearSelection();
-                    });
-                });
-            }).wrap('<div style="margin-right: 80px"></div>');
-
-            $('#id_application').selectize();
-            $('#id_arguments,#id_properties,#id_native').selectize({
-                plugins: ['remove_button'],
-                create: true,
-                render: {
-                    option_create: function(data, escape) {
-                        return '<div class="create">Dodaj <strong>' + escape(data.input) + '</strong>&hellip;</div>';
-                    }
-                }
-            });
-            $('#id_queue').selectize({
-                create: true,
-                render: {
-                    option_create: function(data, escape) {
-                        return '<div class="create">Wybierz <strong>' + escape(data.input) + '</strong>&hellip;</div>';
-                    }
-                }
-            });
-            $('#id_modules,#id_hosts,#id_master_file,#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').selectize({
-                plugins: ['remove_button']
-            });
-
-            // hide delete checkbox in empty env form
-            $('#env-form-empty').find('div.form-group:last-of-type').hide();
-            $('#env-controls').find('> div').formset({
-                formTemplate: '#env-form-empty',
-                parent: '#env-controls',
-                addLinkParent: '#add-env-form',
-                addText: 'dodaj »',
-                addCssClass: 'add-btn',
-                deleteText: 'Usuń',
-                deleteCssClass: 'delete-btn btn btn-xs btn-danger'
-            });
-
-            $('input[name="notify_type"],input[name="watch_output_type"],input[name="preprocess_type"],input[name="postprocess_type"]').on('change', function () {
-                $(this).tab('show');
-            }).each(function() {
-                $(this).parent().toggleClass('active', this.checked);
-
-                if (this.checked)
-                    $(this).tab('show');
-            });
-
-            $('#toggle-advanced').click(function(e) {
-                e.preventDefault();
-                $('form .collapse').collapse('toggle');
-                $(this).find('span').text(this.text == "Pokaż zaawansowane" ? "Ukryj zaawansowane" : "Pokaż zaawansowane");
-            });
-
-            $('#gridftp').one('show.bs.modal', function() {
-                filex.initialLoad();
-            });
-        });
-    </script>
-{% endblock %}
-
-{% block container %}
-    <h1 class="page-header">{% block title %}Zleć zadanie{% endblock %}</h1>
-
-    {% if errors %}
-        <div class="alert alert-danger">
-            <strong>Uwaga!</strong> Formularz zawiera błędy.
-            {{ form.non_field_errors }}
-            {{ env_formset.non_field_errors }}
-        </div>
-    {% endif %}
-
-    <form action="." method="post" class="form-horizontal">
-        {% csrf_token %}
-
-        <!-- Nav tabs -->
-        <ul class="nav nav-tabs" style="margin-bottom: 20px">
-            <li role="presentation" class="active"><a href="#basic" data-toggle="tab">Podstawowe</a></li>
-            <li role="presentation"><a href="#resources" data-toggle="tab">Zasoby</a></li>
-            <li role="presentation"><a href="#files" data-toggle="tab">Pliki</a></li>
-            <li role="presentation"><a href="#environment" data-toggle="tab">Środowisko</a></li>
-            <li role="presentation"><a href="#monitoring" data-toggle="tab">Powiadomienia</a></li>
-            <li role="presentation"><a href="#other" data-toggle="tab">Inne</a></li>
-        </ul>
-
-        <div class="tab-content">
-            <fieldset id="basic" class="tab-pane active" role="tabpanel">
-                {% bootstrap_field form.application layout="horizontal" %}
-                {% bootstrap_field form.master_file layout="horizontal" %}
-                {% bootstrap_field form.executable layout="horizontal" form_group_class="form-group collapse" %}
-                {% bootstrap_field form.script layout="horizontal" form_group_class="form-group collapse" %}
-                {% bootstrap_field form.arguments layout="horizontal" %}
-                {% bootstrap_field form.note layout="horizontal" %}
-                {% bootstrap_field form.grant layout="horizontal" form_group_class="form-group collapse" %}
-            </fieldset>
-
-            <fieldset id="resources" class="tab-pane" role="tabpanel">
-                {% bootstrap_field form.hosts layout="horizontal" %}
-                {% bootstrap_field form.queue layout="horizontal" %}
-                {% bootstrap_field form.properties layout="horizontal" form_group_class="form-group collapse" %}
-                {% bootstrap_field form.modules layout="horizontal" form_group_class="form-group collapse" %}
-                {% bootstrap_field form.procs layout="horizontal" %}
-                {% bootstrap_field form.nodes layout="horizontal" form_group_class="form-group collapse" %}
-                {% bootstrap_field form.wall_time layout="horizontal" form_group_class="form-group timerange" %}
-                {% bootstrap_field form.memory layout="horizontal" form_group_class="form-group collapse" %}
-                {% bootstrap_field form.memory_per_slot layout="horizontal" form_group_class="form-group collapse" %}
-                {% bootstrap_field form.reservation layout="horizontal" form_group_class="form-group collapse" %}
-            </fieldset>
-
-            <fieldset id="files" class="tab-pane" role="tabpanel">
-                {% bootstrap_field form.input layout="horizontal" %}
-                {% bootstrap_field form.stage_in layout="horizontal" %}
-{#                {% bootstrap_field form.stage_out layout="horizontal" form_group_class="form-group collapse" %}#}
-            </fieldset>
-
-            <fieldset id="environment" class="tab-pane" role="tabpanel">
-                {{ env_formset.management_form }}
-
-                <div class="form-group">
-                    <label class="col-sm-3 col-md-4 control-label">Zmienne środowiskowe</label>
-                    <div class="col-sm-9 col-md-6">
-                        <div id="env-controls">
-                            {% for env_form in env_formset %}
-                                <div>{% bootstrap_form env_form layout='inline' %}</div>
-                            {% endfor %}
-                        </div>
-                        <div id="add-env-form"></div>
-                        <div id="env-form-empty" style="display: none">
-                            {% bootstrap_form env_formset.empty_form layout='inline' %}
-                        </div>
-                    </div>
-                </div>
-            </fieldset>
-
-            <fieldset id="monitoring" class="tab-pane" role="tabpanel">
-                {% bootstrap_checkbox form.monitoring %}
-
-                <div class="form-group">
-                    <label class="col-sm-3 col-md-4 control-label">Monitorowanie stanu</label>
-                    <div class="col-sm-9 col-md-6">
-                        <div class="btn-group" data-toggle="buttons">
-                            {% for option in form.notify_type %}
-                                <label class="btn btn-default">
-                                    <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
-                                            {% if option.is_checked %}checked{% endif %}
-                                            data-target=".notify-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
-                                </label>
-                            {% endfor %}
-                        </div>
-                    </div>
-                </div>
-
-                <div class="tab-content">
-                    <div class="tab-pane notify-type-0"></div>
-
-                    <div class="tab-pane notify-type-1 notify-type-2" style="margin-top: 15px">
-                        {% bootstrap_field form.notify_address layout="horizontal" %}
-                    </div>
-                </div>
-
-                <div class="collapse">
-                    <div class="form-group">
-                        <label class="col-sm-3 col-md-4 control-label">Monitorowanie wyjścia</label>
-                        <div class="col-sm-9 col-md-6">
-                            <div class="btn-group" data-toggle="buttons">
-                                {% for option in form.watch_output_type %}
-                                    <label class="btn btn-default">
-                                        <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
-                                                {% if option.is_checked %}checked{% endif %}
-                                                data-target=".watch-output-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
-                                    </label>
-                                {% endfor %}
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="tab-content">
-                        <div class="tab-pane watch-output-type-0"></div>
-
-                        <div class="tab-pane watch-output-type-1 watch-output-type-2" style="margin-top: 15px">
-                            {% bootstrap_field form.watch_output_address layout="horizontal" %}
-                            {% bootstrap_field form.watch_output_pattern layout="horizontal" %}
-                        </div>
-                    </div>
-                </div>
-            </fieldset>
-
-            <fieldset id="other" class="tab-pane" role="tabpanel">
-                <div class="form-group">
-                    <label class="col-sm-3 col-md-4 control-label">Preprocessing</label>
-                    <div class="col-sm-9 col-md-6">
-                        <div class="btn-group" data-toggle="buttons">
-                            {% for option in form.preprocess_type %}
-                                <label class="btn btn-default">
-                                    <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
-                                            {% if option.is_checked %}checked{% endif %}
-                                            data-target=".preprocess-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
-                                </label>
-                            {% endfor %}
-                        </div>
-                    </div>
-                </div>
-
-                <div class="tab-content">
-                    <div class="tab-pane preprocess-type-0"></div>
-
-                    <div class="tab-pane preprocess-type-1" style="margin-top: 15px">
-                        {% bootstrap_field form.preprocess_cmd layout="horizontal" %}
-                    </div>
-
-                    <div class="tab-pane preprocess-type-2" style="margin-top: 15px">
-                        {% bootstrap_field form.preprocess_script layout="horizontal" %}
-                    </div>
-                </div>
-
-                <div class="form-group">
-                    <label class="col-sm-3 col-md-4 control-label">Postprocessing</label>
-                    <div class="col-sm-9 col-md-6">
-                        <div class="btn-group" data-toggle="buttons">
-                            {% for option in form.postprocess_type %}
-                                <label class="btn btn-default">
-                                    <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
-                                            {% if option.is_checked %}checked{% endif %}
-                                            data-target=".postprocess-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
-                                </label>
-                            {% endfor %}
-                        </div>
-                    </div>
-                </div>
-
-                <div class="tab-content">
-                    <div class="tab-pane postprocess-type-0"></div>
-
-                    <div class="tab-pane postprocess-type-1" style="margin-top: 15px">
-                        {% bootstrap_field form.postprocess_cmd layout="horizontal" %}
-                    </div>
-
-                    <div class="tab-pane postprocess-type-2" style="margin-top: 15px">
-                        {% bootstrap_field form.postprocess_script layout="horizontal" %}
-                    </div>
-                </div>
-
-                {% bootstrap_field form.native layout="horizontal" %}
-                {% bootstrap_checkbox form.persistent %}
-            </fieldset>
-        </div>
-
-        <hr>
-
-        <div class="row">
-            <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-6">
-                <button type="submit" class="btn btn-primary">Zleć zadanie</button>
-                <button type="reset" class="btn btn-warning">Resetuj</button>
-                <a id="toggle-advanced" href="#"><span class="text-muted">Pokaż zaawansowane</span></a>
-            </div>
-        </div>
-    </form>
-
-    <div id="gridftp" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
-        <div class="modal-dialog modal-lg">
-            <div class="modal-content">
-                <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
-                    <h4 class="modal-title" id="modal-label">Wybierz plik</h4>
-                </div>
-                <div class="modal-body">
-                    {% include 'filex/source.html' %}
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-default" data-dismiss="modal">Anuluj</button>
-                    <button id="select-btn" type="button" class="btn btn-primary">Wybierz</button>
-                </div>
-            </div>
-        </div>
-    </div>
-
-{% endblock %}
diff --git a/qcg/templates/qcg/job_submit.html b/qcg/templates/qcg/job_submit.html
new file mode 100644 (file)
index 0000000..77f6fc7
--- /dev/null
@@ -0,0 +1,351 @@
+{% extends 'qcg/base.html' %}
+{% load staticfiles bootstrap3 qcg_utils %}
+
+{% block extra_css %}
+    <link href="{% static 'qcg/selectize/selectize.bootstrap3.css' %}" rel="stylesheet">
+{% endblock %}
+
+{% block extra_js %}
+    <script src="{% static 'qcg/selectize/selectize.min.js' %}"></script>
+    <script src="{% static 'qcg/formset/jquery.formset.js' %}"></script>
+
+    {% include 'filex/source.js.html' %}
+
+    <script>
+        var filex = filex || {};
+
+        $(function () {
+            'use strict';
+
+            var gridftpButton = $('<button/>', {
+                'type': 'button',
+                'class': 'btn btn-default pull-right',
+                'text': 'Wybierz',
+                'data-toggle': 'modal',
+                'data-target': '#gridftp'
+            });
+
+            function fullPath(path, file) {
+                var res = path + file.get('name');
+
+                if (file.isDir())
+                    res += '/';
+
+                return res;
+            }
+
+            $('#id_master_file,#id_executable,#id_input,#id_preprocess_script,#id_postprocess_script').before(function() {
+                var target = this;
+                return gridftpButton.clone().click(function() {
+                    $('#select-btn').off().click(function() {
+                        var selected = filex.selectedFiles();
+
+                        if (selected.length != 1 || !selected[0].isFile()) {
+                            alert('Wybierz dokładnie jeden plik.');
+                            return;
+                        }
+
+                        var file = fullPath(filex.host + '/' + filex.path.full() + '/', selected[0]);
+
+                        target.selectize.clear();
+                        target.selectize.addOption({value: file, text: file});
+                        target.selectize.addItem(file);
+                        target.selectize.refreshItems();
+
+                        $('#gridftp').modal('hide');
+                        filex.clearSelection();
+                    });
+                });
+            }).wrap('<div style="margin-right: 80px"></div>');
+
+            $('#id_stage_in').before(function() {
+                var target = this;
+                return gridftpButton.clone().click(function() {
+                    $('#select-btn').off().click(function() {
+                        var path = filex.host + '/' + filex.path.full() + '/';
+
+                        _.each(filex.selectedFiles(), function(item) {
+                            var file = fullPath(path, item);
+                            target.selectize.addOption({value: file, text: file});
+                            target.selectize.addItem(file);
+                        });
+                        target.selectize.refreshItems();
+
+                        $('#gridftp').modal('hide');
+                        filex.clearSelection();
+                    });
+                });
+            }).wrap('<div style="margin-right: 80px"></div>');
+
+            $('#id_application').selectize();
+            $('#id_arguments,#id_properties,#id_native').selectize({
+                plugins: ['remove_button'],
+                create: true,
+                render: {
+                    option_create: function(data, escape) {
+                        return '<div class="create">Dodaj <strong>' + escape(data.input) + '</strong>&hellip;</div>';
+                    }
+                }
+            });
+            $('#id_queue').selectize({
+                create: true,
+                render: {
+                    option_create: function(data, escape) {
+                        return '<div class="create">Wybierz <strong>' + escape(data.input) + '</strong>&hellip;</div>';
+                    }
+                }
+            });
+            $('#id_modules,#id_hosts,#id_master_file,#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').selectize({
+                plugins: ['remove_button']
+            });
+
+            // hide delete checkbox in empty env form
+            $('#env-form-empty').find('div.form-group:last-of-type').hide();
+            $('#env-controls').find('> div').formset({
+                formTemplate: '#env-form-empty',
+                parent: '#env-controls',
+                addLinkParent: '#add-env-form',
+                addText: 'dodaj »',
+                addCssClass: 'add-btn',
+                deleteText: 'Usuń',
+                deleteCssClass: 'delete-btn btn btn-xs btn-danger'
+            });
+
+            $('input[name="notify_type"],input[name="watch_output_type"],input[name="preprocess_type"],input[name="postprocess_type"]').on('change', function () {
+                $(this).tab('show');
+            }).each(function() {
+                $(this).parent().toggleClass('active', this.checked);
+
+                if (this.checked)
+                    $(this).tab('show');
+            });
+
+            $('#toggle-advanced').click(function(e) {
+                e.preventDefault();
+                $('form .collapse').collapse('toggle');
+                $(this).find('span').text(this.text == "Pokaż zaawansowane" ? "Ukryj zaawansowane" : "Pokaż zaawansowane");
+            });
+
+            $('#gridftp').one('show.bs.modal', function() {
+                filex.initialLoad();
+            });
+        });
+    </script>
+{% endblock %}
+
+{% block container %}
+    <h1 class="page-header">{% block title %}Zleć zadanie{% endblock %}</h1>
+
+    {% if errors %}
+        <div class="alert alert-danger">
+            <strong>Uwaga!</strong> Formularz zawiera błędy.
+            {{ form.non_field_errors }}
+            {{ env_formset.non_field_errors }}
+        </div>
+    {% endif %}
+
+    <form action="." method="post" class="form-horizontal">
+        {% csrf_token %}
+
+        <!-- Nav tabs -->
+        <ul class="nav nav-tabs" style="margin-bottom: 20px">
+            <li role="presentation" class="active"><a href="#basic" data-toggle="tab">Podstawowe</a></li>
+            <li role="presentation"><a href="#resources" data-toggle="tab">Zasoby</a></li>
+            <li role="presentation"><a href="#files" data-toggle="tab">Pliki</a></li>
+            <li role="presentation"><a href="#environment" data-toggle="tab">Środowisko</a></li>
+            <li role="presentation"><a href="#monitoring" data-toggle="tab">Powiadomienia</a></li>
+            <li role="presentation"><a href="#other" data-toggle="tab">Inne</a></li>
+        </ul>
+
+        <div class="tab-content">
+            <fieldset id="basic" class="tab-pane active" role="tabpanel">
+                {% bootstrap_field form.application layout="horizontal" %}
+                {% bootstrap_field form.master_file layout="horizontal" %}
+                {% bootstrap_field form.executable layout="horizontal" form_group_class="form-group collapse" %}
+                {% bootstrap_field form.script layout="horizontal" form_group_class="form-group collapse" %}
+                {% bootstrap_field form.arguments layout="horizontal" %}
+                {% bootstrap_field form.note layout="horizontal" %}
+                {% bootstrap_field form.grant layout="horizontal" form_group_class="form-group collapse" %}
+            </fieldset>
+
+            <fieldset id="resources" class="tab-pane" role="tabpanel">
+                {% bootstrap_field form.hosts layout="horizontal" %}
+                {% bootstrap_field form.queue layout="horizontal" %}
+                {% bootstrap_field form.properties layout="horizontal" form_group_class="form-group collapse" %}
+                {% bootstrap_field form.modules layout="horizontal" form_group_class="form-group collapse" %}
+                {% bootstrap_field form.procs layout="horizontal" %}
+                {% bootstrap_field form.nodes layout="horizontal" form_group_class="form-group collapse" %}
+                {% bootstrap_field form.wall_time layout="horizontal" form_group_class="form-group timerange" %}
+                {% bootstrap_field form.memory layout="horizontal" form_group_class="form-group collapse" %}
+                {% bootstrap_field form.memory_per_slot layout="horizontal" form_group_class="form-group collapse" %}
+                {% bootstrap_field form.reservation layout="horizontal" form_group_class="form-group collapse" %}
+            </fieldset>
+
+            <fieldset id="files" class="tab-pane" role="tabpanel">
+                {% bootstrap_field form.input layout="horizontal" %}
+                {% bootstrap_field form.stage_in layout="horizontal" %}
+{#                {% bootstrap_field form.stage_out layout="horizontal" form_group_class="form-group collapse" %}#}
+            </fieldset>
+
+            <fieldset id="environment" class="tab-pane" role="tabpanel">
+                {{ env_formset.management_form }}
+
+                <div class="form-group">
+                    <label class="col-sm-3 col-md-4 control-label">Zmienne środowiskowe</label>
+                    <div class="col-sm-9 col-md-6">
+                        <div id="env-controls">
+                            {% for env_form in env_formset %}
+                                <div>{% bootstrap_form env_form layout='inline' %}</div>
+                            {% endfor %}
+                        </div>
+                        <div id="add-env-form"></div>
+                        <div id="env-form-empty" style="display: none">
+                            {% bootstrap_form env_formset.empty_form layout='inline' %}
+                        </div>
+                    </div>
+                </div>
+            </fieldset>
+
+            <fieldset id="monitoring" class="tab-pane" role="tabpanel">
+                {% bootstrap_checkbox form.monitoring %}
+
+                <div class="form-group">
+                    <label class="col-sm-3 col-md-4 control-label">Monitorowanie stanu</label>
+                    <div class="col-sm-9 col-md-6">
+                        <div class="btn-group" data-toggle="buttons">
+                            {% for option in form.notify_type %}
+                                <label class="btn btn-default">
+                                    <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
+                                            {% if option.is_checked %}checked{% endif %}
+                                            data-target=".notify-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
+                                </label>
+                            {% endfor %}
+                        </div>
+                    </div>
+                </div>
+
+                <div class="tab-content">
+                    <div class="tab-pane notify-type-0"></div>
+
+                    <div class="tab-pane notify-type-1 notify-type-2" style="margin-top: 15px">
+                        {% bootstrap_field form.notify_address layout="horizontal" %}
+                    </div>
+                </div>
+
+                <div class="collapse">
+                    <div class="form-group">
+                        <label class="col-sm-3 col-md-4 control-label">Monitorowanie wyjścia</label>
+                        <div class="col-sm-9 col-md-6">
+                            <div class="btn-group" data-toggle="buttons">
+                                {% for option in form.watch_output_type %}
+                                    <label class="btn btn-default">
+                                        <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
+                                                {% if option.is_checked %}checked{% endif %}
+                                                data-target=".watch-output-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
+                                    </label>
+                                {% endfor %}
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="tab-content">
+                        <div class="tab-pane watch-output-type-0"></div>
+
+                        <div class="tab-pane watch-output-type-1 watch-output-type-2" style="margin-top: 15px">
+                            {% bootstrap_field form.watch_output_address layout="horizontal" %}
+                            {% bootstrap_field form.watch_output_pattern layout="horizontal" %}
+                        </div>
+                    </div>
+                </div>
+            </fieldset>
+
+            <fieldset id="other" class="tab-pane" role="tabpanel">
+                <div class="form-group">
+                    <label class="col-sm-3 col-md-4 control-label">Preprocessing</label>
+                    <div class="col-sm-9 col-md-6">
+                        <div class="btn-group" data-toggle="buttons">
+                            {% for option in form.preprocess_type %}
+                                <label class="btn btn-default">
+                                    <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
+                                            {% if option.is_checked %}checked{% endif %}
+                                            data-target=".preprocess-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
+                                </label>
+                            {% endfor %}
+                        </div>
+                    </div>
+                </div>
+
+                <div class="tab-content">
+                    <div class="tab-pane preprocess-type-0"></div>
+
+                    <div class="tab-pane preprocess-type-1" style="margin-top: 15px">
+                        {% bootstrap_field form.preprocess_cmd layout="horizontal" %}
+                    </div>
+
+                    <div class="tab-pane preprocess-type-2" style="margin-top: 15px">
+                        {% bootstrap_field form.preprocess_script layout="horizontal" %}
+                    </div>
+                </div>
+
+                <div class="form-group">
+                    <label class="col-sm-3 col-md-4 control-label">Postprocessing</label>
+                    <div class="col-sm-9 col-md-6">
+                        <div class="btn-group" data-toggle="buttons">
+                            {% for option in form.postprocess_type %}
+                                <label class="btn btn-default">
+                                    <input type="radio" autocomplete="off" name="{{ option.name }}" value="{{ option.choice_value }}"
+                                            {% if option.is_checked %}checked{% endif %}
+                                            data-target=".postprocess-type-{{ forloop.counter0 }}"> {{ option.choice_label }}
+                                </label>
+                            {% endfor %}
+                        </div>
+                    </div>
+                </div>
+
+                <div class="tab-content">
+                    <div class="tab-pane postprocess-type-0"></div>
+
+                    <div class="tab-pane postprocess-type-1" style="margin-top: 15px">
+                        {% bootstrap_field form.postprocess_cmd layout="horizontal" %}
+                    </div>
+
+                    <div class="tab-pane postprocess-type-2" style="margin-top: 15px">
+                        {% bootstrap_field form.postprocess_script layout="horizontal" %}
+                    </div>
+                </div>
+
+                {% bootstrap_field form.native layout="horizontal" %}
+                {% bootstrap_checkbox form.persistent %}
+            </fieldset>
+        </div>
+
+        <hr>
+
+        <div class="row">
+            <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-6">
+                <button type="submit" class="btn btn-primary">Zleć zadanie</button>
+                <button type="reset" class="btn btn-warning">Resetuj</button>
+                <a id="toggle-advanced" href="#"><span class="text-muted">Pokaż zaawansowane</span></a>
+            </div>
+        </div>
+    </form>
+
+    <div id="gridftp" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
+        <div class="modal-dialog modal-lg">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                    <h4 class="modal-title" id="modal-label">Wybierz plik</h4>
+                </div>
+                <div class="modal-body">
+                    {% include 'filex/source.html' %}
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Anuluj</button>
+                    <button id="select-btn" type="button" class="btn btn-primary">Wybierz</button>
+                </div>
+            </div>
+        </div>
+    </div>
+
+{% endblock %}
index 3bb2d7d..798950b 100644 (file)
@@ -13,7 +13,7 @@ urlpatterns = patterns('',
 
     url(r'^$', views.index, name='index'),
     url(r'^jobs/$', views.jobs_list, name='jobs'),
-    url(r'^job/new/$', views.job_new, name='job_new'),
+    url(r'^job/submit/$', views.job_submit, name='job_submit'),
     url(r'^job/(?P<job_id>[\w]+)/?$', views.job_details, name='job'),
     url(r'^job/(?P<job_id>[\w]+)/(?P<task_id>[\w]+)/?$', views.task_details, name='task'),
 
index a1986ad..09812a4 100644 (file)
@@ -155,7 +155,7 @@ def task_details(request, job_id, task_id):
 
 
 @login_required
-def job_new(request):
+def job_submit(request):
     if request.method == 'POST':
         form = JobDescriptionForm(request.POST)
         env_formset = EnvFormSet(request.POST)
@@ -181,7 +181,7 @@ def job_new(request):
 
     errors = form.errors or (env_formset.is_bound and not env_formset.is_valid)
 
-    return render(request, 'qcg/job_new.html', {'form': form, 'env_formset': env_formset, 'errors': errors})
+    return render(request, 'qcg/job_submit.html', {'form': form, 'env_formset': env_formset, 'errors': errors})
 
 
 @login_required