Merge branch 'master' of mmka.chem.univ.gda.pl:qcg-portal
authorDawid Jagieła <lightnir@gmail.com>
Sat, 5 Sep 2015 21:22:30 +0000 (23:22 +0200)
committerDawid Jagieła <lightnir@gmail.com>
Sat, 5 Sep 2015 21:22:30 +0000 (23:22 +0200)
1  2 
qcg/forms.py
qcg/templates/qcg/job_submit.html
qcg/templates/qcg/job_submit_form.html

diff --combined qcg/forms.py
@@@ -91,8 -91,7 +91,7 @@@ class JobDescriptionForm(forms.Form)
  
      APPLICATION_CHOICES = (
          CHOICES_PLACEHOLDER,
-         ('bash', 'BASH'),
-         ('python', 'Python'),
+         ('unres32', 'UNRES 3.2'),
      )
          
      QUEUE_CHOICES = (
      ntwx = forms.IntegerField(label=u"NTWX", help_text=u"Częstość zapisu współrzędnych w krokach", min_value=0, initial=1000, required=False)
      dt = forms.DecimalField(label=u"DT", help_text=u"Krok czasowy. Wartość kroku równa jedności to 48.9 fs", max_digits=5, decimal_places=2, min_value=0.01, initial=0.1, required=False)
      damax = forms.DecimalField(label=u"DAMAX", help_text=u"Maksymalna dopuszczalna zmiana przyspieszenia podczas jednego kroku czasowego", max_digits=5, decimal_places=2, min_value=0.01, initial=1.0, required=False)
-     force_field = forms.ChoiceField(choices=FORCE_FIELD_CHOICES, label=u"Pole siłowe", required=False)
+     force_field = forms.ChoiceField(choices=FORCE_FIELD_CHOICES, label=u"Pole siłowe", required=False, initial='GAB')
      nrep = forms.IntegerField(label=u"NREP", help_text=u"Liczba replik", min_value=2, initial=16, required=False)
      nstex = forms.IntegerField(label=u"NSTEX", help_text=u"Liczba kroków po których następuje wymiana replik", min_value=2, initial=1000, required=False)
      pdb_file = forms.CharField(label=u"Plik PDB", max_length=500, required=False)
+     retmin = forms.IntegerField(label=u"RETMIN", help_text=u"Dolny zakres temparatur dla wymiany replik", min_value=2, initial=250, required=False)
+     retmax = forms.IntegerField(label=u"RETMAX", help_text=u"Górny zakres temperatur dla wymiany replik", min_value=2, initial=450, required=False)
      
-     application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False)  # TODO choices
+     application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False, initial='unres32')  # TODO choices
      master_file = forms.CharField(label=u"Plik główny", max_length=500, required=False)
      executable = forms.CharField(label=u"Plik wykonywalny", max_length=500, required=False)
      script = forms.CharField(label=u"Skrypt", widget=forms.Textarea(attrs={'rows': 2, 'cols': 40}), required=False)
  
      def clean(self):
          data = super(JobDescriptionForm, self).clean()
 +            
 +        force_field = data.get('force_field')
 +        if force_field == self.FORCE_FIELD_CHOICES[0]:
 +            data['application'] = [u'unres-gab']
 +        else:
 +            data['application'] = [u'unres-e0ll2y']
  
 -        if bool(data['application']) + bool(data['executable']) + bool(data['script']) != 1:
 -            self.add_error(None, u"Dokładnie jedno z następujących pól jest wymagane do uruchomienia zadania: "
 -                                 u"Aplikacja, Plik wykonywalny lub Skrypt.")
 -
 -        if data['application'] and not data['master_file']:
 -            self.add_error('master_file', u"W trybie uruchamiania aplikacji należy podać plik główny")
 +        if data['master_file']:
 +            self.add_error('master_file', u"Należy podać plik główny")
  
          if data['procs'] and data['nodes']:
              self.add_error(None, u"Zdefiniuj tylko jedno z pól: liczbę procesów lub topologię węzłów")
@@@ -95,7 -95,7 +95,9 @@@
                      }
                  }
              });
-             $('#id_modules,#id_hosts,#id_master_file,#id_pdb_file,#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').selectize({
++
+             $('#id_modules,#id_hosts,#id_pdb_file,#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.force_field layout="horizontal" %}
          {% bootstrap_field form.nstep layout="horizontal" %}
          {% bootstrap_field form.ntwe layout="horizontal" form_group_class="form-group collapse" %}
          {% bootstrap_field form.ntwx layout="horizontal" form_group_class="form-group collapse" %}
          {% bootstrap_field form.dt layout="horizontal" form_group_class="form-group collapse" %}
          {% bootstrap_field form.damax layout="horizontal" form_group_class="form-group collapse" %}
          {% bootstrap_field form.nrep layout="horizontal" %}
          {% bootstrap_field form.nstex layout="horizontal" form_group_class="form-group collapse" %}
          {% bootstrap_field form.pdb_file layout="horizontal" %}
++
+         {% bootstrap_field form.retmin layout="horizontal" form_group_class="form-group collapse" %}
+         {% bootstrap_field form.retmax layout="horizontal" form_group_class="form-group collapse" %}
+         
+         {% bootstrap_field form.application layout="horizontal" %}
++
          {% bootstrap_field form.master_file layout="horizontal" %}
 +        <!-- {% bootstrap_field form.application 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" %} -->
+         {% bootstrap_field form.grant layout="horizontal" form_group_class="form-group collapse" %}
      </fieldset>
  
      <fieldset id="resources" class="tab-pane" role="tabpanel">