master file as form field
authorMaciej Tronowski <mtro@man.poznan.pl>
Mon, 23 Mar 2015 10:22:49 +0000 (11:22 +0100)
committerMaciej Tronowski <mtro@man.poznan.pl>
Mon, 23 Mar 2015 10:22:49 +0000 (11:22 +0100)
qcg/forms.py
qcg/templates/qcg/job_new.html

index f66ada6..33eeeaf 100644 (file)
@@ -117,6 +117,7 @@ class JobDescriptionForm(forms.Form):
     )
 
     application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False)  # TODO choices
+    master_file = forms.CharField(label=u"Plik główny", max_length=500, required=False)  # TODO grid ftp
     executable = forms.CharField(label=u"Plik wykonywalny", max_length=500, required=False)  # TODO grid ftp
     script = forms.CharField(label=u"Skrypt", widget=forms.Textarea(attrs={'rows': 2, 'cols': 40}), required=False)  # TODO saving to grid ftp
     arguments = forms.MultipleChoiceField(label=u"Argumenty", required=False)
index fca86fe..eb3d973 100644 (file)
@@ -13,7 +13,7 @@
 
     <script>
         $(function() {
-            $('#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').before(function() {
+            $('#id_master_file,#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').before(function() {
                 var target = this;
                 return $('<button/>', {
                     'type': 'button',
@@ -49,7 +49,7 @@
                     }
                 }
             });
-            $('#id_modules,#id_hosts,#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').selectize({
+            $('#id_modules,#id_hosts,#id_master_file,#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').selectize({
                 plugins: ['remove_button']
             });
 
         <div class="tab-content">
             <fieldset id="basic" class="tab-pane active" role="tabpanel">
                 {% bootstrap_field form.application layout="horizontal" %}
-                <div class="row" style="margin-top: -15px; margin-bottom: 15px">
-                    <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-6">
-                        {# TODO grid ftp #}
-                        <a id="add-main-file" href="#">wybierz plik główny &raquo;</a>
-                    </div>
-                </div>
-
+                {% 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" %}