From eb7af6bf08d80b721d6ac8d0b100f02ac4ae29f6 Mon Sep 17 00:00:00 2001 From: Rachel TORCHET <racheltorchet@users.noreply.github.com> Date: Fri, 7 Jul 2017 13:34:18 +0200 Subject: [PATCH] update templates Former-commit-id: f31ef950947bb3d677eba3e44a76ac42630ba412 --- ippisite/ippidb/forms.py | 3 +- ippisite/ippidb/static/css/ippidb.css | 2 - ippisite/ippidb/static/js/ippidb.js | 10 +- .../ippidb/templates/BibliographyForm.html | 94 +++++++++---------- ippisite/ippidb/templates/IdForm.html | 37 ++++---- ippisite/ippidb/templates/PDBForm.html | 27 +++--- ippisite/ippidb/templates/PpiForm.html | 29 +++--- .../templates/ProteinDomainComplexForm.html | 27 +++--- .../ProteinDomainComplexTypeForm.html | 67 ++++++------- ippisite/ippidb/templates/ProteinForm.html | 31 +++--- 10 files changed, 165 insertions(+), 162 deletions(-) diff --git a/ippisite/ippidb/forms.py b/ippisite/ippidb/forms.py index 67f5eefe..4e179130 100644 --- a/ippisite/ippidb/forms.py +++ b/ippisite/ippidb/forms.py @@ -68,7 +68,8 @@ class ProteinDomainComplexTypeForm(forms.Form): archi = forms.CharField( label="PPI Architecture Type", widget=forms.Select( - choices=ARCHI_TYPE) + choices=ARCHI_TYPE, + ) ) inhibited = forms.ChoiceField( widget=forms.RadioSelect, diff --git a/ippisite/ippidb/static/css/ippidb.css b/ippisite/ippidb/static/css/ippidb.css index 204111fe..ac0da657 100644 --- a/ippisite/ippidb/static/css/ippidb.css +++ b/ippisite/ippidb/static/css/ippidb.css @@ -783,13 +783,11 @@ body { } .image-inhibited label span{ - background-image: url('/static/images/PPITypes/Inhibited/{{radio.choice_label|cut:" "}}_Apo.png'); background-position: center; background-repeat: no-repeat; } .image-inhibited label span:hover { - background-image: url('/static/images/PPITypes/Inhibited/{{radio.choice_label|cut:" "}}_Halo.png'); background-position: center; background-repeat: no-repeat; } diff --git a/ippisite/ippidb/static/js/ippidb.js b/ippisite/ippidb/static/js/ippidb.js index 084b2751..dbb17171 100644 --- a/ippisite/ippidb/static/js/ippidb.js +++ b/ippisite/ippidb/static/js/ippidb.js @@ -20,15 +20,15 @@ $(document).ready(function() { $(document).ready(function(){ $('#id_ProteinDomainComplexTypeForm-archi').on('change', function() { - if ( this.value === "stabilized") + if ( this.value === "inhibited") { - $("#stabilized").show(); - $("#inhibited").hide(); + $("#inhibited").show(); + $("#stabilized").hide(); } else { - $("#stabilized").hide(); - $("#inhibited").show(); + $("#inhibited").hide(); + $("#stabilized").show(); } }); }); \ No newline at end of file diff --git a/ippisite/ippidb/templates/BibliographyForm.html b/ippisite/ippidb/templates/BibliographyForm.html index 65770458..f7f005e5 100644 --- a/ippisite/ippidb/templates/BibliographyForm.html +++ b/ippisite/ippidb/templates/BibliographyForm.html @@ -14,58 +14,56 @@ </div> <div id="Form"> <div class="step_desc"> - <p>Based on the ID you have provided, we have identified the following information concerning your bibliographic source. -Please check that the information below is correct (Title, Authors etc. ) and answer the few questions about the content of your bibliographic source.</p> + <p>Based on the ID you have provided, we have identified the following information concerning your bibliographic source. + Please check that the information below is correct (Title, Authors etc. ) and answer the few questions about the content of your bibliographic source.</p> </div> <form action="" method="post"> {% csrf_token %} <table> - {{ wizard.management_form }} - {{ wizard.form.errors}} - {{ wizard.form.non_field_errors}} - {% block custom_form %}{% endblock %} + {{ wizard.management_form }} + {{ wizard.form.errors}} + {{ wizard.form.non_field_errors}} + {% block custom_form %}{% endblock %} + + {% if wizard.form.forms %} + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} + {{ form }} + {% endfor %} + {% else %} + <div class="readonlyfields"> + {{ wizard.form.source }}<br/> + {{ wizard.form.id_source }}<br/> + {{ wizard.form.title }}<br/> + {{ wizard.form.journal_name }}<br/> + </div> + <p> This publication contains :<br/></p> + <div id="ck-button"> + <label> + <input type="checkbox"><span>{{ wizard.form.cytotox.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_silico.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_vitro.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_vivo.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_cellulo.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.pharmacokinetic.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.xray.label }}</span> + </label> + </div> + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - <div class="readonlyfields"> - {{ wizard.form.source }}<br/> - {{ wizard.form.id_source }}<br/> - {{ wizard.form.title }}<br/> - {{ wizard.form.journal_name }}<br/> - </div> - <p> This publication contains :<br/></p> - <div id="ck-button"> - <label> - <input type="checkbox"><span>{{ wizard.form.cytotox.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_silico.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_vitro.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_vivo.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_cellulo.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.pharmacokinetic.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.xray.label }}</span> - </label> -</div> -{% endif %} -</table> -{% if wizard.steps.prev %} - -{% endif %} - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/IdForm.html b/ippisite/ippidb/templates/IdForm.html index d8c8ec70..977a4fc3 100644 --- a/ippisite/ippidb/templates/IdForm.html +++ b/ippisite/ippidb/templates/IdForm.html @@ -23,24 +23,25 @@ {{ wizard.form.errors}} {{ wizard.form.non_field_errors}} {% block custom_form %}{% endblock %} + + {% if wizard.form.forms %} + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} + {{ form }} + {% endfor %} + {% else %} + <div id="id_IdForm-source"> + {% for radio in wizard.form.source %} + {{ radio.tag }} + <label for="{{ radio.id_for_label }}"> + <span>{{ radio.choice_label }}</span> + </label> + {% endfor %} + </div> + {{ wizard.form.id_source}} + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - <div id="id_IdForm-source"> - {% for radio in wizard.form.source %} - {{ radio.tag }} - <label for="{{ radio.id_for_label }}"> - <span>{{ radio.choice_label }}</span> - </label> - {% endfor %} - </div> - {{ wizard.form.id_source}} -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/PDBForm.html b/ippisite/ippidb/templates/PDBForm.html index 4f938db4..1efe561d 100644 --- a/ippisite/ippidb/templates/PDBForm.html +++ b/ippisite/ippidb/templates/PDBForm.html @@ -23,19 +23,20 @@ {{ wizard.form.errors}} {{ wizard.form.non_field_errors}} {% block custom_form %}{% endblock %} + + {% if wizard.form.forms %} + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} + {{ form }} + {% endfor %} + {% else %} + <div class="input_fields_wrap"> + <div class="input_size">{{ wizard.form.pdb_id }} + <div class="add_field_button"><img class="small_icon" src="/static/images/Other/AddMore.png"></div></div> + </div> + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - <div class="input_fields_wrap"> - <div class="input_size">{{ wizard.form.pdb_id }} - <div class="add_field_button"><img class="small_icon" src="/static/images/Other/AddMore.png"></div></div> - </div> -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/PpiForm.html b/ippisite/ippidb/templates/PpiForm.html index f377c4c1..ad7ec0c7 100644 --- a/ippisite/ippidb/templates/PpiForm.html +++ b/ippisite/ippidb/templates/PpiForm.html @@ -23,20 +23,21 @@ {{ wizard.form.errors}} {{ wizard.form.non_field_errors}} {% block custom_form %}{% endblock %} + + {% if wizard.form.forms %} + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} + {{ form }} + {% endfor %} + {% else %} + {{ wizard.form }} + {% endif %} + </table> + {% if wizard.steps.prev %} + <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button> + <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "previous step" %}</button> + {% endif %} + <input type="submit" value="{% trans "submit" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - {{ wizard.form }} -{% endif %} -</table> -{% if wizard.steps.prev %} - <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button> - <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "previous step" %}</button> -{% endif %} - <input type="submit" value="{% trans "submit" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/ProteinDomainComplexForm.html b/ippisite/ippidb/templates/ProteinDomainComplexForm.html index 3c22c48d..49d2af59 100644 --- a/ippisite/ippidb/templates/ProteinDomainComplexForm.html +++ b/ippisite/ippidb/templates/ProteinDomainComplexForm.html @@ -25,19 +25,20 @@ If your PPI complex is not among them, please select « Create you Own »</p> {{ wizard.form.errors}} {{ wizard.form.non_field_errors}} {% block custom_form %}{% endblock %} - </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - {{ wizard.form }} -{% endif %} -</table> -{% if wizard.steps.prev %} + + {% if wizard.form.forms %} + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} + {{ form }} + {% endfor %} + {% else %} + {{ wizard.form }} + {% endif %} + </table> + {% if wizard.steps.prev %} -{% endif %} - <input type="submit" value="{% trans "Next step" %}"/> + {% endif %} + <input type="submit" value="{% trans "Next step" %}"/> + </form> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html b/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html index 6b3c93c9..976d058c 100644 --- a/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html +++ b/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html @@ -24,39 +24,40 @@ If your PPI complex is not among them, please select « Create you Own »</p> {{ wizard.form.errors}} {{ wizard.form.non_field_errors}} {% block custom_form %}{% endblock %} - </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {% endfor %} -{% else %} - {{ wizard.form.archi }} - <div id='inhibited' name='inhibited' class="type_style"> - <div class="type_title"> - <h1>Inhibited</h1> - </div> - <div id="id_ProteinDomainComplexTypeForm-inhibited" class="image-inhibited"> - {% for radio in wizard.form.inhibited %} - {{ radio.tag }} - <label for="{{ radio.id_for_label }}"> - <span>{{ radio.choice_label}}</span> - </label> - {% endfor %} - </div> - </div> - <div id="stabilized" class="type_style"> - <div class="type_title"><h1>Stabilized</h1></div> - <div id="id_ProteinDomainComplexTypeForm-stabilized"> - {% for radio in wizard.form.stabilized %} - {{ radio.tag }} - <label style="background-image: url('/static/images/DimericsPPI/Stabilized/{{radio.choice_label|cut:" "}}.png');" for="{{ radio.id_for_label }}"> - <span>{{ radio.choice_label}}</span> - </label> + + {% if wizard.form.forms %} + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} {% endfor %} - </div> - </div> -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> + {% else %} + {{ wizard.form.archi }} + <div id='inhibited' name='inhibited' class="type_style"> + <div class="type_title"> + <h1>Inhibited</h1> + </div> + <div id="id_ProteinDomainComplexTypeForm-inhibited" class="image-inhibited"> + {% for radio in wizard.form.inhibited %} + {{ radio.tag }} + <label style="background-image: url('/static/images/PPITypes/Inhibited/{{radio.choice_label|cut:" "}}_Apo.png');" for="{{ radio.id_for_label }}"> + <span>{{ radio.choice_label}}</span> + </label> + {% endfor %} + </div> + </div> + <div id="stabilized" class="type_style"> + <div class="type_title"><h1>Stabilized</h1></div> + <div id="id_ProteinDomainComplexTypeForm-stabilized"> + {% for radio in wizard.form.stabilized %} + {{ radio.tag }} + <label style="background-image: url('/static/images/DimericsPPI/Stabilized/{{radio.choice_label|cut:" "}}.png');" for="{{ radio.id_for_label }}"> + <span>{{ radio.choice_label}}</span> + </label> + {% endfor %} + </div> + </div> + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> + </form> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/ProteinForm.html b/ippisite/ippidb/templates/ProteinForm.html index e6966f9b..68a4279c 100644 --- a/ippisite/ippidb/templates/ProteinForm.html +++ b/ippisite/ippidb/templates/ProteinForm.html @@ -23,21 +23,22 @@ {{ wizard.form.errors}} {{ wizard.form.non_field_errors}} {% block custom_form %}{% endblock %} + + {% if wizard.form.forms %} + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} + {{ form }} + {% endfor %} + {% else %} + {{ wizard.form.management_form }} + {% for form in formset %} + {% for field in form %} + {{ field.label_tag }} {{ field }} + {% endfor %} + {% endfor %} + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - {{ formset.management_form }} - {% for form in formset %} - {% for field in form %} - {{ field.label_tag }} {{ field }} - {% endfor %} - {% endfor %} -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file -- GitLab