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

Update ProteinDomainComplexTypeForm form and JS to show/hide inhibited/stabilized configurations

Former-commit-id: 74e03458a2cbd9c9aaa36c2383664bd869036c3b
parent f2b433a0
No related branches found
No related tags found
No related merge requests found
...@@ -15,4 +15,20 @@ $(document).ready(function() { ...@@ -15,4 +15,20 @@ $(document).ready(function() {
$(wrapper).on("click",".remove_field", function(e){ //user click on remove text $(wrapper).on("click",".remove_field", function(e){ //user click on remove text
e.preventDefault(); $(this).parent('div').remove(); x--; e.preventDefault(); $(this).parent('div').remove(); x--;
}) })
});
$(document).ready(function(){
$('#id_ProteinDomainComplexTypeForm-archi').on('change', function() {
if ( this.value === "stabilized")
{
$("#stabilized").show();
$("#inhibited").hide();
}
else
{
$("#stabilized").hide();
$("#inhibited").show();
}
});
}); });
\ No newline at end of file
...@@ -30,36 +30,27 @@ If your PPI complex is not among them, please select « Create you Own »</p> ...@@ -30,36 +30,27 @@ If your PPI complex is not among them, please select « Create you Own »</p>
{% for form in wizard.form.forms %} {% for form in wizard.form.forms %}
{% endfor %} {% endfor %}
{% else %} {% else %}
<div id='archi' name='archi'>{{ wizard.form.archi }}</div> {{ wizard.form.archi }}
<div id='inhibited' name='inhibited' class="type_style"> <div id='inhibited' name='inhibited' class="type_style">
<div class="type_title"><h1>Inhibited</h1></div> <div class="type_title">
<div id="id_ProteinDomainComplexTypeForm-inhibited"> <h1>Inhibited</h1>
{{ wizard.form.inhibited.0.tag }} </div>
<label for="{{ wizard.form.inhibited.0.id_for_label }}"> <div id="id_ProteinDomainComplexTypeForm-inhibited" class="image-inhibited">
<span>{{ wizard.form.inhibited.0.choice_label}}</span> {% for radio in wizard.form.inhibited %}
</label> {{ radio.tag }}
</div> <label for="{{ radio.id_for_label }}">
<div id="id_ProteinDomainComplexTypeForm-inhibited"> <span>{{ radio.choice_label}}</span>
{{ wizard.form.inhibited.1.tag }} </label>
<label for="{{ wizard.form.inhibited.1.id_for_label }}"> {% endfor %}
<span>{{ wizard.form.inhibited.1.choice_label}}</span> </div>
</label>
</div>
<div id="id_ProteinDomainComplexTypeForm-inhibited">
{{ wizard.form.inhibited.2.tag }}
<label for="{{ wizard.form.inhibited.2.id_for_label }}">
<span>{{ wizard.form.inhibited.2.choice_label}}</span>
</label>
</div>
</div> </div>
<div id='stabilized' name= 'stabilized' class="type_style"> <div id="stabilized" class="type_style">
<div class="type_title"><h1>Stabilized</h1></div> <div class="type_title"><h1>Stabilized</h1></div>
<div id="id_ProteinDomainComplexTypeForm-stabilized"> <div id="id_ProteinDomainComplexTypeForm-stabilized">
{% for radio in wizard.form.stabilized %} {% for radio in wizard.form.stabilized %}
{{ radio.tag }} {{ radio.tag }}
<label style="background-image: url('/static/images/DimericsPPI/Stabilized/{{radio.choice_value}}.png');" for="{{ radio.id_for_label }}"> <label style="background-image: url('/static/images/DimericsPPI/Stabilized/{{radio.choice_label|cut:" "}}.png');" for="{{ radio.id_for_label }}">
<span>{{ radio.choice_label }}</span> <span>{{ radio.choice_label}}</span>
</label> </label>
{% endfor %} {% endfor %}
</div> </div>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<a hfref="/admin-session/view">View Content</a> <a hfref="/admin-session/view">View Content</a>
</li> </li>
<li> <li>
<a href="/admin-session/add">Add New Content</a> <a href="/admin-session/add/IdForm">Add New Content</a>
</li> </li>
<li> <li>
<a hfref="/admin-session/update">Update Content</a> <a hfref="/admin-session/update">Update Content</a>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment