Skip to content
Snippets Groups Projects
Commit d22d20dd authored by Rachel's avatar Rachel
Browse files

ProteinDomainComplexForm - Fix architecture display issue

parent 325483b0
No related branches found
No related tags found
1 merge request!17Prepare v1.0.1
Pipeline #35238 failed
......@@ -424,6 +424,7 @@ class ComplexCompositionBaseFormSet(forms.BaseFormSet):
if form.cleaned_data.get("DELETE", False):
continue
complex_type_dict.add(form.cleaned_data.get("complex_type"))
print("test ",len(complex_type_dict))
if self.has_bound and self.has_partner and len(complex_type_dict) < 2:
self._non_form_errors.append(
_("You need at least one bound and one partner")
......@@ -450,6 +451,7 @@ class ComplexCompositionBaseFormSet(forms.BaseFormSet):
form_kwargs["nb_copies_in_complex"] = nb_copies_in_complex
self.has_partner = has_partner
self.has_bound = has_bound
print("kwargs", form_kwargs)
super().__init__(form_kwargs=form_kwargs, *args, **kwargs)
......
......@@ -224,7 +224,7 @@ Description: IPPI-DB Theme
}
.input_field {
width: auto;
width: 100%;
margin-right: 2px;
font-family: "BrandonGrotesqueReg";
text-align: left;
......
......@@ -895,7 +895,7 @@ div.hidden {
}
.form_div-fluid {
width: 100%;
width: auto;
padding: 1em;
}
......
......@@ -25,14 +25,20 @@ $(document).ready(function () {
function onloadTest(type, choice) {
console.log("Onload Test:", type, choice);
var total = $('#id_' + 'ProteinDomainComplexForm' + '-TOTAL_FORMS').val();
console.log("total: ",total);
if (type == "Hetero2merAB" && choice == "inhibited" && total < 2) {
console.log(document.getElementById('id_ProteinDomainComplexForm-0-ppc_copy_nb').value);
cloneMoreFull('.inline_box_complex_long:last', 'ProteinDomainComplexForm');
document.getElementById('id_ProteinDomainComplexForm-0-ppc_copy_nb').value = "1";
document.getElementById('id_ProteinDomainComplexForm-1-complex_type_1').value = "Partner";
} else if (type == "Homo2merA2" && choice == "inhibited" && total < 2) {
cloneMoreFull('.inline_box_complex_long:last', 'ProteinDomainComplexForm');
document.getElementById('id_ProteinDomainComplexForm-0-complex_type_0').value = "Bound";
} else if (type == "Hetero2merAB" && choice == "stabilized" && total < 2) {
console.log(document.getElementById('id_ProteinDomainComplexForm-0-ppc_copy_nb').value);
cloneMoreFull('.inline_box_complex_long:last', 'ProteinDomainComplexForm');
document.getElementById('id_ProteinDomainComplexForm-1-complex_type_1').value = "Bound";
document.getElementById('id_ProteinDomainComplexForm-0-ppc_copy_nb').value = "1";
document.getElementById('id_ProteinDomainComplexForm-1-complex_type_1').value = "Partner";
} else if (type == "HomoLike2mer" && choice == "stabilized" && total < 2) {
cloneMoreFull('.inline_box_complex_long:last', 'ProteinDomainComplexForm');
document.getElementById('id_ProteinDomainComplexForm-1-complex_type_1').value = "Bound";
......@@ -45,6 +51,7 @@ function onloadTest(type, choice) {
cloneMoreFull('.inline_box_complex_long:last', 'ProteinDomainComplexForm');
document.getElementById('id_ProteinDomainComplexForm-1-complex_type_1').value = "Partner";
} else if (type == "Homo3merA3" || type == "RingHomo3mer" && choice == "stabilized") {
removeMoreFull('.inline_box_complex_long:last', 'ProteinDomainComplexForm');
document.getElementById('id_ProteinDomainComplexForm-0-ppc_copy_nb').value = "3";
} else if (type == "Homo4merA4" && choice == "stabilized") {
document.getElementById('id_ProteinDomainComplexForm-0-ppc_copy_nb').value = "4";
......@@ -56,7 +63,7 @@ function onloadTest(type, choice) {
}
//Function to load different template setting on PPI page
function onloadTestPPI(type, choice) {
/* function onloadTestPPI(type, choice) {
console.log("Onload Test PPI:", type, choice);
if (type == "Homo2merA2" && choice == "inhibited") {
document.getElementById('id_PpiForm-cc_nb').value = "2";
......@@ -89,7 +96,7 @@ function onloadTestPPI(type, choice) {
document.getElementById('id_PpiForm-cc_nb').value = "1";
document.getElementById('id_PpiForm-symmetry').value = "8";
}
}
} */
// Function to duplicate form and increment ids
function cloneMoreFull(selector, prefix) {
......
......@@ -31,9 +31,12 @@ function update_partner_bound_fields(archi){
}
$(document).ready(function(){
let archi = document.getElementById("archi_type").innerHTML;
let complex = document.getElementById("complex_type").innerHTML;
onloadTest(archi,complex);
$("select.complex_readonly").each(function(i,o){
$(o).change(update_partner_bound_fields(archi));
$(o).change(update_partner_bound_fields_visibility);
$(o).change(onloadTest(archi,complex));
$(o).change();
});
......@@ -44,9 +47,9 @@ $(document).ready(function(){
{%block step_desc%}
For the PDB code: <a href="http://www.rcsb.org/structure/{{pdb}}" target="_blank">{{pdb}}</a><br>
{% if "Inhib_" in complex_type %}
You have selected an <span style="font-family: BrandonGrotesqueBld;" id="archi_type">{{ complex_type|cut:"Inhib_"}}</span> that is <span style="font-family: BrandonGrotesqueBld;">{{ complex_choice }}</span> by the binding of PPI modulator.
You have selected an <span style="font-family: BrandonGrotesqueBld;" id="archi_type">{{ complex_type|cut:"Inhib_"}}</span> that is <span style="font-family: BrandonGrotesqueBld;" id="complex_type">{{ complex_choice }}</span> by the binding of PPI modulator.
{% elif "Stab_" in complex_type %}
You have selected an <span style="font-family: BrandonGrotesqueBld;" id="archi_type">{{ complex_type|cut:"Stab_"}}</span> that is <span style="font-family: BrandonGrotesqueBld;">{{ complex_choice }}</span> by the binding of PPI modulator.
You have selected an <span style="font-family: BrandonGrotesqueBld;" id="archi_type">{{ complex_type|cut:"Stab_"}}</span> that is <span style="font-family: BrandonGrotesqueBld;" id="complex_type">{{ complex_choice }}</span> by the binding of PPI modulator.
{%endif%}
<br/>
Please select the protein that is bound by the modulator and also the protein partner if applicable. You also need to specify the PFAM protein domain(s).
......
......@@ -130,7 +130,7 @@ ARCHITECTURE = {
has_bound=True,
nb_copy_bound=[1],
nb_per_pocket=[1],
has_partner=False,
has_partner=True,
nb_pockets=[1],
nb_copies_in_complex=[1],
symmetry=["AS"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment