diff --git a/ippisite/ippidb/forms.py b/ippisite/ippidb/forms.py index 168c54a42c30ce9551c0090b11614469f6f929bd..93b71be5b07b45b90350a30f43dc95e58fb1818f 100644 --- a/ippisite/ippidb/forms.py +++ b/ippisite/ippidb/forms.py @@ -64,27 +64,31 @@ class ProteinForm(ModelForm): ProteinFormSet = modelformset_factory( Protein, exclude=('recommended_name_long', 'short_name'), extra=0) +TYPE_COMPLEX = ( + ('inhibited', 'Inhibited'), + ('stabilized', 'Stabilized'), +) + TYPE_CHOICES = ( ('Hetero2merAB', 'Inhib_Hetero 2-mer AB'), - ('Homo2merA2', 'Inhib_Homo 2-mer A2'), - ('custom', 'Inhib_Custom your own'), - ('Hetero2merAB', 'Stab_Hetero 2-mer AB'), - ('Homo2merA2', 'Stab_Homo 2-mer A2'), - ('HomoLike2mer', 'Stab_Homo-Like 2-mer A2'), - ('Homo3merA3', 'Stab_Homo 3-mer A3'), - ('Homo3merA2', 'Stab_Homo 3-mer A3 inhibited A2-dimer'), - ('Homo4merA4', 'Stab_Homo 4-mer A4'), - ('RingHomo3mer', 'Stab_Ring-Like 3-mer A3'), - ('RingHomo5mer', 'Stab_Ring-Like 5-mer A5'), - ('custom', 'Stab_Custom your own'), + ('Homo2merA2', 'Inhib_Homo 2-mer A2'), + ('custom', 'Inhib_Custom'), + ('Hetero2merAB', 'Stab_Hetero 2-mer AB'), + ('Homo2merA2', 'Stab_Homo 2-mer A2'), + ('HomoLike2mer', 'Stab_Homo-Like 2-mer A2'), + ('Homo3merA3', 'Stab_Homo 3-mer A3'), + ('Homo3merA2', 'Stab_Homo 3-mer A3 inhibited A2-dimer'), + ('Homo4merA4', 'Stab_Homo 4-mer A4'), + ('RingHomo3mer', 'Stab_Ring-Like 3-mer A3'), + ('RingHomo5mer', 'Stab_Ring-Like 5-mer A5'), + ('custom', 'Stab_Custom'), ) class ProteinDomainComplexTypeForm(forms.Form): - complexType = forms.ChoiceField( - widget=forms.RadioSelect, - choices=TYPE_CHOICES, - ) + complexChoice=forms.CharField(label="PPI Complex Type", widget=forms.Select(choices=TYPE_COMPLEX)) + complexType=forms.CharField(widget=forms.RadioSelect(choices=TYPE_CHOICES)) + class ProteinDomainComplexForm(ModelForm): diff --git a/ippisite/ippidb/static/css/ippidb.css b/ippisite/ippidb/static/css/ippidb.css index ac62c695fe185fcc38375438ed84907ef8fe0bd5..ef3272edf90cd996331cfb3c1a4002bde288f496 100644 --- a/ippisite/ippidb/static/css/ippidb.css +++ b/ippisite/ippidb/static/css/ippidb.css @@ -947,16 +947,16 @@ body { border-right: 1px solid #E3E9EB; } -.imageBack_Inhib_Customyourown input { +.imageBack_Inhib_Custom input { display:none; } -.imageBack_Inhib_Customyourown label span{ +.imageBack_Inhib_Custom label span{ display: inline-block; width: 180px; text-align: center; background-color: #FFFFFF; - background-image: url('/static/images/PPITypes/Inhibited/Customyourown_Apo.png'); + background-image: url('/static/images/PPITypes/Inhibited/Custom_Apo.png'); background-position: center; background-repeat: no-repeat; height: 180px; @@ -964,10 +964,10 @@ body { } -.imageBack_Inhib_Customyourown input:hover+label span{ +.imageBack_Inhib_Custom input:hover+label span{ cursor: pointer; background-color: #FFFFFF; - background-image: url('/static/images/PPITypes/Inhibited/Customyourown_Holo.png'); + background-image: url('/static/images/PPITypes/Inhibited/Custom_Holo.png'); background-position: center; background-repeat: no-repeat; color: #000000; @@ -977,9 +977,9 @@ body { border-right: 1px solid #E3E9EB; } -.imageBack_Inhib_Customyourown input[type="radio"]:checked+label span{ +.imageBack_Inhib_Custom input[type="radio"]:checked+label span{ background-color: #FFFFFF; - background-image: url('/static/images/PPITypes/Inhibited/Customyourown_Holo.png'); + background-image: url('/static/images/PPITypes/Inhibited/Custom_Holo.png'); background-position: center; background-repeat: no-repeat; color: #000000; @@ -1336,16 +1336,16 @@ body { } -.imageBack_Stab_Customyourown input { +.imageBack_Stab_Custom input { display:none; } -.imageBack_Stab_Customyourown label span{ +.imageBack_Stab_Custom label span{ display: inline-block; width: 180px; text-align: center; background-color: #FFFFFF; - background-image: url('/static/images/PPITypes/Stabilized/Customyourown_Apo.png'); + background-image: url('/static/images/PPITypes/Stabilized/Custom_Apo.png'); background-position: center; background-repeat: no-repeat; height: 180px; @@ -1353,10 +1353,10 @@ body { } -.imageBack_Stab_Customyourown input:hover+label span{ +.imageBack_Stab_Custom input:hover+label span{ cursor: pointer; background-color: #FFFFFF; - background-image: url('/static/images/PPITypes/Stabilized/Customyourown_Holo.png'); + background-image: url('/static/images/PPITypes/Stabilized/Custom_Holo.png'); background-position: center; background-repeat: no-repeat; color: #000000; @@ -1366,9 +1366,9 @@ body { border-right: 1px solid #E3E9EB; } -.imageBack_Stab_Customyourown input[type="radio"]:checked+label span{ +.imageBack_Stab_Custom input[type="radio"]:checked+label span{ background-color: #FFFFFF; - background-image: url('/static/images/PPITypes/Stabilized/Customyourown_Holo.png'); + background-image: url('/static/images/PPITypes/Stabilized/Custom_Holo.png'); background-position: center; background-repeat: no-repeat; color: #000000; diff --git a/ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Apo.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Custom_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Apo.png rename to ippisite/ippidb/static/images/PPITypes/Inhibited/Custom_Apo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Holo.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Custom_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Holo.png rename to ippisite/ippidb/static/images/PPITypes/Inhibited/Custom_Holo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Apo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Custom_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Apo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Custom_Apo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Holo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Custom_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Holo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Custom_Holo.png diff --git a/ippisite/ippidb/templates/ProteinDomainComplexForm.html b/ippisite/ippidb/templates/ProteinDomainComplexForm.html index 6401c925104d04f4f83584d03fbdbfbab3bb6368..07b1ea3d951966eee038fe006f48b5ce043a30c8 100644 --- a/ippisite/ippidb/templates/ProteinDomainComplexForm.html +++ b/ippisite/ippidb/templates/ProteinDomainComplexForm.html @@ -14,28 +14,91 @@ </div> <div id="Form"> - <div class="step_desc"> - <p>Now that you have listed ALL proteins and PFAM domains that participate to the PPI, you need to select an architecture for this PPI complex among the proposed schematics below.</br> -If your PPI complex is not among them, please select « Create you Own »</p> - </div> - <form action="" method="post"> - {% csrf_token %} - {{ 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 %} - <div class="inline_prot"> - <div class="inline_field"> {{ form.protein }}</div> - <div class="inline_field"> {{ form.domain }}</div> - <div class="inline_field"> {{ form.ppc_copy_nb }}</div> - </div> - {% endfor %} - {% endif %} + <form action="" method="post"> + {% csrf_token %} + {{ 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 %} + + + {{ complex_type }} - {{ complex_choice }} + {% if complex_type == "Hetero2merAB" %} + <div class="step_desc"> + <p>You have selected a <span style="color:#2d96fa;">Hetero 2-mer AB</span> that is <span style="color:#2d96fa;">inhibited</span> by the binding of PPI modulator.<br/> + According to this architecture you need to specify:<br/> + <span style="color:#2d96fa;">1</span> bound complex containing <span style="color:#2d96fa;">1</span> protein<br/> + <span style="color:#2d96fa;">1</span> partner complex containing <span style="color:#2d96fa;">1</span> protein<br/></p> + </div> + <div class=""> + <div class=""> {{ form.protein }}</div> + <div class=""> {{ form.domain }}</div> + <div class=""> {{ form.ppc_copy_nb }}</div> + </div> + <div class=""> + <div class=""> {{ form.protein }}</div> + <div class=""> {{ form.domain }}</div> + <div class=""> {{ form.ppc_copy_nb }}</div> + </div> + {% elif complex_type == "Homo2merA2" %} + <div class="step_desc"> + <p>You have selected a <span style="color:#2d96fa;">Homo 2-mer A2</span> that is <span style="color:#2d96fa;">inhibited</span> by the binding of PPI modulator.<br/> + According to this architecture you need to specify:<br/> + <span style="color:#2d96fa;">1</span> bound complex containing <span style="color:#2d96fa;">1</span> protein<br/> + <span style="color:#2d96fa;">0</span> partner complex containing <span style="color:#2d96fa;">0</span> protein<br/></p> + </div> + <div class=""> + <div class=""> {{ form.protein }}</div> + <div class=""> {{ form.domain }}</div> + <div class=""> {{ form.ppc_copy_nb }}</div> + </div> + {% elif complex_type == "Custom" %} + <div class="step_desc"> + <p>You have selected a <span style="color:#2d96fa;">Custom</span> that is <span style="color:#2d96fa;">...</span> by the binding of PPI modulator.<br/> + According to this architecture you need to specify:<br/> + <span style="color:#2d96fa;">...</span> bound complex containing <span style="color:#2d96fa;">...</span> protein<br/> + <span style="color:#2d96fa;">...</span> partner complex containing <span style="color:#2d96fa;">...</span> protein<br/></p> + </div> + <div class=""> + <div class=""> {{ form.protein }}</div> + <div class=""> {{ form.domain }}</div> + <div class=""> {{ form.ppc_copy_nb }}</div> + </div> + {% elif complex_type == "Hetero2merAB" %} + <div class="step_desc"> + <p>You have selected a <span style="color:#2d96fa;">Homo 2-mer A2</span> that is <span style="color:#2d96fa;">inhibited</span> by the binding of PPI modulator.<br/> + According to this architecture you need to specify:<br/> + <span style="color:#2d96fa;">1</span> bound complex containing <span style="color:#2d96fa;">1</span> protein<br/> + <span style="color:#2d96fa;">0</span> partner complex containing <span style="color:#2d96fa;">0</span> protein<br/></p> + </div> + <div class=""> + <div class=""> {{ form.protein }}</div> + <div class=""> {{ form.domain }}</div> + <div class=""> {{ form.ppc_copy_nb }}</div> + </div> + {% elif complex_type == "Homo2merA2" %} + <div class="step_desc"> + <p>You have selected a <span style="color:#2d96fa;">Homo 2-mer A2</span> that is <span style="color:#2d96fa;">inhibited</span> by the binding of PPI modulator.<br/> + According to this architecture you need to specify:<br/> + <span style="color:#2d96fa;">1</span> bound complex containing <span style="color:#2d96fa;">1</span> protein<br/> + <span style="color:#2d96fa;">0</span> partner complex containing <span style="color:#2d96fa;">0</span> protein<br/></p> + </div> + <div class=""> + <div class=""> {{ form.protein }}</div> + <div class=""> {{ form.domain }}</div> + <div class=""> {{ form.ppc_copy_nb }}</div> + </div> + {% else %} + {% endif %} + {% endif %} <input type="submit" value="{% trans "Next step" %}"/> - </form> + </form> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html b/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html index 1f42e708090c49ac01a901fb74cc98c93271f60c..36b5c4ca8c2fda83cc3ffe81ca575aaefb9198a6 100644 --- a/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html +++ b/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html @@ -15,7 +15,7 @@ <div id="Form"> <div class="step_desc"> <p>Now that you have listed ALL proteins and PFAM domains that participate to the PPI, you need to select an architecture for this PPI complex among the proposed schematics below.</br> -If your PPI complex is not among them, please select « Create you Own »</p> +If your PPI complex is not among them, please select « Custom »</p> </div> <form action="" method="post"> {% csrf_token %} @@ -27,15 +27,14 @@ If your PPI complex is not among them, please select « Create you Own »</p> {% if wizard.form.forms %} {{ wizard.form.management_form }} {% for form in wizard.form.forms %} - {% endfor %} {% else %} <div id="id_ProteinDomainComplexTypeForm-stabilized"> - PPI Complex Type: - <select> + PPI Complex Type: {{ form.complexChoice }} + <!--<select> <option value="inhibited">Inhibited</option> <option value="stabilized">Stabilized</option> - </select> + </select>--> </div> <div id="type_style" class="inhibited box"> <div id="type_title"> diff --git a/ippisite/ippidb/templates/base.html b/ippisite/ippidb/templates/base.html index 6fd77a1ec57c962beac02e9d1d8fb361d24b529a..cc19b916e91e6a886dbc61d14ad7b6ba0c374aa6 100644 --- a/ippisite/ippidb/templates/base.html +++ b/ippisite/ippidb/templates/base.html @@ -11,28 +11,6 @@ </head> <body> - <div id="main-header"> - <div id="head-top"> - <div id="mainmenu"> - <nav class="mainmenu"> - <ul> - <li> - <a href="https://www.pasteur.fr/fr">Research</a> - </li> - <li> - <a hfref="https://www.pasteur.fr/en/education">Education</a> - </li> - <li> - <a href="https://www.pasteur.fr/en/international-en">International</a> - </li> - <li> - <a href="https://www.pasteur.fr/en/public-health">Public Health</a> - </li> - </ul> - </nav> - </div> - </div> - </div> <div class="jumbotron"> <div class="container"> <a href="/" id="home"> @@ -91,30 +69,16 @@ <nav> <ul> <li> - <a href="https://www.pasteur.fr/en/home/institut-pasteur/institut-pasteur-throughout-world/institut-pasteur-international-network">The Institut Pasteur</a> - </li> - <li> - <a href="https://www.pasteur.fr/en/our-missions">Our Missions</a> + <a href="/about">About Us</a> </li> <li> - <a href="https://www.pasteur.fr/en/support-us">Support Us</a> - </li> - </ul> - </nav> - </div> - </div> - <div class="footer__section footer__menu-2"> - <div class="block block-menu block-menu-menu-footer-menu-2"> - <nav> - <ul> - <li> - <a class="donate" href="https://don.pasteur.fr/">Donate</a> + <a href="/query">Query</a> </li> <li> - <a class="leaf" href="https://www.pasteur.fr/en/press-area">Press Area</a> + <a href="/tutorials">Tutorials</a> </li> <li> - <a class="last leaf" href="https://www.pasteur.fr/en">Legal Notice</a> + <a href="/admin-session">Admin</a> </li> </ul> </nav> diff --git a/ippisite/ippidb/views.py b/ippisite/ippidb/views.py index bd5ab91a8a5cf6daa3f09b67644f9d9c1397af9e..3d63a0a52eb20f7a4fe1a86c0ecde47e4862c188 100644 --- a/ippisite/ippidb/views.py +++ b/ippisite/ippidb/views.py @@ -72,6 +72,12 @@ TEMPLATES = {"IdForm": "IdForm.html", class IppiWizard(NamedUrlSessionWizardView): + def get_context_data(self, **kwargs): + context=super(IppiWizard, self).get_context_data(**kwargs) + context['complex_type']=self.storage.get_step_data('ProteinDomainComplexTypeForm').get('complex_type') + context['complex_choice']=self.storage.get_step_data('ProteinDomainComplexTypeForm').get('complex_choice') + return context + def get_template_names(self): return [TEMPLATES[self.steps.current]] @@ -82,9 +88,6 @@ class IppiWizard(NamedUrlSessionWizardView): if self.steps.current == 'ProteinForm': pks = self.storage.get_step_data('PDBForm').get('pks') return Protein.objects.filter(id__in=pks) - if self.steps.current=='ProteinDomainComplexForm': - complexType = self.storage.get_step_data('ProteinDomainComplexTypeForm').get('complexType') - return ProteinDomainComplex.objects.get(complexType=complexType) def process_step(self, form): """ @@ -115,7 +118,9 @@ class IppiWizard(NamedUrlSessionWizardView): protein_ids.append(p.id) data['pks'] = protein_ids if self.steps.current=='ProteinDomainComplexTypeForm': - data['complex_type']=form['complexType'] + data['complex_type']=data['ProteinDomainComplexTypeForm-complexType'] + data['complex_choice']=data['ProteinDomainComplexTypeForm-complexChoice'] + #print(data) return data def done(self, form_list, **kwargs):