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

Update templates and Test form aspect + Add fun css label stuffs

Former-commit-id: ad4c3cb04f5c0cc3d0c356352218470d88175f44
parent 7512c5fb
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ class IdForm(ModelForm):
fields = ['source','id_source']
widgets = {
'source' : forms.RadioSelect,
'id_source': forms.TextInput(attrs={'placeholder': 'ID'}),
'id_source': forms.TextInput(attrs={'class': 'form-control'}),
}
""" Step 2 : BibliographyForm """
......@@ -40,7 +40,7 @@ def validate_pdb_exists(value):
class PDBForm(forms.Form):
pdb_id = forms.CharField(label="PDB ID", max_length=4, widget=forms.TextInput(attrs={'placeholder': 'e.g 3u85', 'required': 'required'}), required=True, validators=[
pdb_id = forms.CharField(label="PDB ID", max_length=4, widget=forms.TextInput(attrs={'placeholder': 'e.g 3u85', 'required': 'required', 'class':'form-control'}), required=True, validators=[
RegexValidator(
'^[0-9][a-zA-Z0-9]{3}$', message='PDB ID must be 1 numeric + 3 alphanumeric characters'),
validate_pdb_exists
......@@ -102,10 +102,10 @@ COMPLEX_TYPE = (
)
class ComplexCompositionForm(forms.Form):
complex_type=forms.CharField(widget=forms.Select(choices=COMPLEX_TYPE))
complex_protein=forms.ModelChoiceField(queryset=Protein.objects.all(), required=True)
complex_domain=forms.ModelChoiceField(queryset=Domain.objects.all(), required=True)
ppc_copy_nb=forms.IntegerField(initial=1,required=True)
complex_type=forms.CharField(widget=forms.Select(choices=COMPLEX_TYPE, attrs={'class':'form-control'}))
complex_protein=forms.ModelChoiceField(queryset=Protein.objects.all(), required=True, widget=forms.Select(attrs={'class':'form-control'}),empty_label=None)
complex_domain=forms.ModelChoiceField(queryset=Domain.objects.all(), required=True,widget=forms.Select(attrs={'class':'form-control'}),empty_label=None)
ppc_copy_nb=forms.IntegerField(initial=1,required=True,widget=forms.TextInput(attrs={'class':'form-control'}))
def __init__(self,*args,**kwargs):
super(ComplexCompositionForm, self).__init__(*args, **kwargs)
......@@ -131,10 +131,10 @@ class PpiComplexForm(ModelForm):
fields = ['cc_nb']
class PpiAndComplexForm(forms.Form):
pdb_id=forms.CharField(widget=forms.TextInput())
symmetry=forms.ModelChoiceField(queryset=Symmetry.objects.all(), required=True)
pockets_nb=forms.IntegerField(initial=1,required=True)
cc_nb=forms.IntegerField(initial=1,required=True)
pdb_id=forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
symmetry=forms.ModelChoiceField(queryset=Symmetry.objects.all(), required=True, widget=forms.Select(attrs={'class':'form-control'}), empty_label=None)
pockets_nb=forms.IntegerField(initial=1,required=True,widget=forms.TextInput(attrs={'class':'form-control'}))
cc_nb=forms.IntegerField(initial=1,required=True,widget=forms.TextInput(attrs={'class':'form-control'}))
""" Step 7 : CompoundForm """
class CompoundForm(ModelForm):
......@@ -143,7 +143,7 @@ class CompoundForm(ModelForm):
model = Compound
fields = ['common_name','is_macrocycle']
widgets = {
'common_name': forms.TextInput(attrs={'placeholder':'Common name', 'required': 'required'}),
'common_name': forms.TextInput(attrs={'class':'form-control', 'required': 'required'}),
}
class RefCompoundBiblioForm(ModelForm):
......@@ -160,27 +160,40 @@ TYPE_MOLECULE = (
class BaseCompoundFormSet(BaseFormSet):
def add_fields(self, form, index):
super(BaseCompoundFormSet, self).add_fields(form, index)
form.fields["compound_name"] = forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Name in the publication','required':'required'}))
form.fields["molecule"] = forms.CharField(widget=forms.RadioSelect(choices=TYPE_MOLECULE))
form.fields["molecule_comp"] = forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Molecule composition', 'required':'required'}))
form.fields["compound_name"] = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','required':'required'}))
form.fields["molecule"] = forms.CharField(widget=forms.RadioSelect(choices=TYPE_MOLECULE, attrs={'class':'form-control'}))
form.fields["molecule_comp"] = forms.CharField(widget=forms.TextInput(attrs={'required':'required', 'class':'form-control'}))
CompoundFormSet = formset_factory(CompoundForm, formset=BaseCompoundFormSet, max_num=500, can_delete=True)
formset = CompoundFormSet()
""" Step 8 : TestsForm """
class TestsForm(forms.Form):
activityDesc_test_name=forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Activity test name'}))
activityDesc_cell_line=forms.ModelChoiceField(queryset=CellLine.objects.all(), required=True, empty_label="Choose a corresponding cell line")
activityDesc_ppi=forms.CharField(widget=forms.TextInput(attrs={'placeholder':'PPI ID'}))
activityDesc_nb_active_compound=forms.IntegerField(initial=1,required=True)
activityRes_test_modulation_type=forms.ModelChoiceField(queryset=CompoundActivityResult.objects.values_list('modulation_type', flat=True).distinct(), required=True, empty_label=None)
activityDesc_type=forms.ModelChoiceField(widget=forms.RadioSelect(),queryset=TestActivityDescription.objects.values_list('test_type', flat=True).distinct(), required=True, empty_label=None)
cytotoxDesc_test_name=forms.CharField(widget=forms.TextInput())
cytotoxDesc_cell_line=forms.ModelChoiceField(queryset=CellLine.objects.all(), required=True)
cytotoxDesc_compound_concentration=forms.CharField(widget=forms.TextInput())
activityDesc_test_name=forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
activityDesc_cell_line=forms.ModelChoiceField(queryset=CellLine.objects.all(), empty_label=None, widget=forms.Select(attrs={'class':'form-control'}))
activityDesc_nb_active_compound=forms.IntegerField(initial=1)
activityDesc_type=forms.ModelChoiceField(widget=forms.RadioSelect(attrs={'class':'form-control'}),queryset=TestActivityDescription.objects.values_list('test_type', flat=True).distinct(), empty_label=None)
activityDesc_test_modulation_type=forms.ModelChoiceField(queryset=TestActivityDescription.objects.values_list('test_modulation_type', flat=True).distinct(), empty_label=None, widget=forms.Select(attrs={'class':'form-control'}))
activityRes_compound=forms.ChoiceField(widget=forms.Select(attrs={'class':'form-control'}))
activityRes_test_modulation_type=forms.ModelChoiceField(queryset=CompoundActivityResult.objects.values_list('modulation_type', flat=True).distinct(), empty_label=None, widget=forms.Select(attrs={'class':'form-control'}))
activityRes_activity_type=forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
activityRes_activity=forms.IntegerField(forms.NumberInput(attrs={'class':'form-control'}))
cytotoxDesc_test_name=forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
cytotoxDesc_cell_line=forms.ModelChoiceField(queryset=CellLine.objects.all(), empty_label=None, widget=forms.Select(attrs={'class':'form-control'}))
cytotoxDesc_compound_concentration=forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Compound concentration'}))
cytotoxRes_compound=forms.ChoiceField(widget=forms.TextInput(attrs={'class': 'form-control'}))
cytotoxRes_toxicity=forms.ModelChoiceField(queryset=CompoundCytotoxicityResult.objects.all())
pkDesc_test_name=forms.CharField(widget=forms.TextInput())
pkDesc_organism=forms.ModelChoiceField(queryset=Taxonomy.objects.all(), required=True)
pkDesc_administration_mode=forms.CharField(widget=forms.TextInput())
pkDesc_dose=forms.IntegerField(initial=1,required=True)
pkDesc_dose_interval=forms.IntegerField(initial=1,required=True)
pkDesc_test_name=forms.CharField(widget=forms.TextInput(attrs={'placeholder':'PK test name'}))
pkDesc_organism=forms.ModelChoiceField(queryset=Taxonomy.objects.all(), empty_label="Choose a corresponding organism")
pkDesc_administration_mode=forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Admnistration mode'}))
pkDesc_dose=forms.IntegerField(initial=1)
pkDesc_dose_interval=forms.IntegerField(initial=1)
pkRes_compound = forms.ChoiceField(widget=forms.TextInput(attrs={'class': 'form-control'}))
pkRes_tolerated = forms.ChoiceField(widget=forms.TextInput(attrs={'class': 'form-control'}))
pkRes_auc = forms.IntegerField(initial=1)
pkRes_clearance = forms.DecimalField()
pkRes_cmax = forms.DecimalField()
pkRes_oral_bioavailability = forms.IntegerField(initial=1)
pkRes_t_demi = forms.IntegerField(initial=1)
pkRes_t_max = forms.IntegerField(initial=1)
pkRes_voldistribution = forms.DecimalField()
\ No newline at end of file
This diff is collapsed.
......@@ -33,6 +33,7 @@ function addComp(id){
document.getElementById("compound_"+id).appendChild(clone);
}
// Function to enlarge some part of the main page
$(document).ready(function(){
$('.box').on('click','.box__inner',function() {
......
......@@ -37,8 +37,14 @@
<h1 id="Name_{{ form.compound_name.id_for_label }}">Compound</h1>
<h2>Name your compound</h2>
</div>
<div class="compound_input">{{ form.common_name }}</div>
<div class="compound_input">{{ form.compound_name }}</div>
<div class="compound_input form-group">
{{ form.common_name }}
<label class="form-control-placeholder">Common name</label>
</div>
<div class="compound_input form-group">
{{ form.compound_name }}
<label class="form-control-placeholder">Name in biblio</label>
</div>
<div id="type_title">
<h2>Choose a format to import your molecule</h2>
</div>
......@@ -52,14 +58,15 @@
</div>
{% endfor %}
</div>
<div class="compound_input" id="molecule_comp_{{ form.molecule.id_for_label }}">
<div class="compound_input form-group" id="molecule_comp_{{ form.molecule.id_for_label }}">
{{form.molecule_comp}}
<label class="form-control-placeholder">Molecule composition</label>
</div>
<div id="ck-button-long" class="compound_input">
<div id="ck-button-long">
<label>{{ form.is_macrocycle}}<span>{{ form.is_macrocycle.label }}</span></label>
</div>
<div id="ck-button-long" class="submit_button"> Add compound
</div>
<input type="button" id="ck-button-long" class="add_button" onclick="addComp();" value="Add Compound">
</input>
</div>
{% endfor %}
</div>
......
......@@ -46,7 +46,10 @@
</label>
{% endfor %}
</div>
<div class="input_field">{{ wizard.form.id_source}}</div>
<div class="input_field form-group">
{{ wizard.form.id_source}}
<label class="form-control-placeholder">ID</label>
</div>
</div>
{% endif %}
</table>
......
......@@ -36,7 +36,10 @@
test {{ form }}
{% endfor %}
{% else %}
<div class="input_field">{{form.pdb_id}}</div>
<div class="input_field form-group">
{{form.pdb_id}}
<label for="id_PDBForm-pdb_id" class="form-control-placeholder">PDB ID</label>
</div>
{% endif %}
</table>
<input class="submit_button" type="submit" value="{% trans "Next step" %}"/>
......
......@@ -39,11 +39,22 @@
{% endfor %}
{% else %}
<div class="inline_box_complex">
<div class="inline_label"> PPI: </div>
<div class="input_field">{{ wizard.form.pdb_id }}</div>
<div class="input_field">{{ wizard.form.pockets_nb}}</div>
<div class="inline_field">{{ wizard.form.cc_nb }}</div>
<div class="inline_field">{{ wizard.form.symmetry }}</div>
<div class="input_field form-group">
{{ wizard.form.pdb_id }}
<label class="form-control-placeholder">PDB ID</label>
</div>
<div class="input_field form-group">
{{ wizard.form.pockets_nb}}
<label class="form-control-placeholder">Pockets number</label>
</div>
<div class="input_field form-group">
{{ wizard.form.cc_nb }}
<label class="form-control-placeholder">Complex per PPI</label>
</div>
<div class="input_field form-group">
{{ wizard.form.symmetry }}
<label class="form-control-placeholder">Symmetry</label>
</div>
</div>
{% endif %}
</table>
......
......@@ -34,10 +34,22 @@
{{ wizard.form.management_form }}
{% for form in wizard.form.forms %}
<div class="inline_box_complex_long">
<div class="input_field"> {{ form.complex_type }}</div>
<div class="input_field"> {{ form.complex_protein }}</div>
<div class="input_field"> {{ form.complex_domain }}</div>
<div class="input_field"> {{ form.ppc_copy_nb }}</div>
<div class="input_field form-group">
{{ form.complex_type }}
<label class="form-control-placeholder">Complex type</label>
</div>
<div class="input_field form-group">
{{ form.complex_protein }}
<label class="form-control-placeholder">Protein</label>
</div>
<div class="input_field form-group">
{{ form.complex_domain }}
<label class="form-control-placeholder">Domain</label>
</div>
<div class="input_field form-group">
{{ form.ppc_copy_nb }}
<label class="form-control-placeholder">Number of copies of the protein in the complex</label>
</div>
</div>
{% endfor %}
{% endif %}
......
......@@ -19,68 +19,124 @@
<div id="Form">
<div class="step_desc">
<h1 class="step_title">Tests performed</h1>
<p class="step_step">Step {{ wizard.steps.step1 }} on {{ wizard.steps.count }}</p>
<p class="step_step_desc">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vulputate felis ac augue pretium, ac blandit lectus mattis. Vestibulum iaculis consequat facilisis. Duis porttitor erat mauris, non porttitor eros feugiat eu. Pellentesque id nisl vel nisl imperdiet convallis vel sed lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec dolor urna, posuere vitae leo quis, hendrerit imperdiet enim. Nunc nec euismod nisi. Phasellus ut ante ante.</p>
<p class="step_step">Step {{ wizard.steps.step1 }} on {{ wizard.steps.count }}</p>
<p class="step_step_desc">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vulputate felis ac augue pretium, ac blandit lectus mattis. Vestibulum iaculis consequat facilisis. Duis porttitor erat mauris, non porttitor eros feugiat eu. Pellentesque id nisl vel nisl imperdiet convallis vel sed lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec dolor urna, posuere vitae leo quis, hendrerit imperdiet enim. Nunc nec euismod nisi. Phasellus ut ante ante.</p>
</div>
<div class="form_div">
<form action="" method="post">
{% csrf_token %}
<table>
{{ wizard.management_form }}
{{ wizard.form.errors}}
{{ wizard.form.non_field_errors}}
{% block custom_form %}{% endblock %}
{% if wizard.form.forms %}
{{ 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 }}
{{ form }}
{% endfor %}
{% else %}
<div class="tests">
<!-- Tab links -->
<div class="tab">
<button class="tablinks active" onclick="openTests(event, 'Activity')" id="defaultOpen">Activity</button>
<button class="tablinks" onclick="openTests(event, 'Cytotoxicity')">Cytotoxicity</button>
<button class="tablinks" onclick="openTests(event, 'PK')">PK</button>
</div>
{% else %}
<div class="tests">
<!-- Tab links -->
<div class="tab">
<button class="tablinks active" onclick="openTests(event, 'Activity')" id="defaultOpen">Activity</button>
<button class="tablinks" onclick="openTests(event, 'Cytotoxicity')">Cytotoxicity</button>
<button class="tablinks" onclick="openTests(event, 'PK')">PK</button>
</div>
<!-- Tab content -->
<div id="Activity" class="tabcontent" style="display: block;">
<div class="test_input">{{ wizard.form.activityDesc_test_name }}</div>
<div>
{% for radio in wizard.form.activityDesc_type %}
<div>
{{ radio.tag }}
<label>
<span>{{ radio.choice_label }}</span>
</label>
<!-- Tab content -->
<div id="Activity" class="tabcontent" style="display: block;">
<div class="test_activity">
<h2>Describe your activity test</h2>
<div class="test_input form-group">
{{ wizard.form.activityDesc_test_name }}
<label class="form-control-placeholder" for="id_TestsForm-activityDesc_test_name">Activity test name</label>
</div>
<div id="ck-button-half">
{% for radio in wizard.form.activityDesc_type %}
<label>
{{ radio.tag }}
<span>{{ radio.choice_label }}</span>
</label>
{% endfor %}
<label class="form-control-placeholder">Activity type</label>
</div>
<div class="test_input form-group">
{{ wizard.form.activityDesc_cell_line }}
<label class="form-control-placeholder">Corresponding cell line</label>
</div>
<div class="test_input form-group">
{{ wizard.form.activityDesc_test_modulation_type }}
<label class="form-control-placeholder">Modulation type</label>
</div>
<h2>Results</h2>
<div class="inline_box_test ">
<div class="inline_field form-group">
{{ wizard.form.activityRes_compound }}
<label class="form-control-placeholder">Compound</label>
</div>
<div class="inline_field form-group">
{{ wizard.form.activityRes_test_modulation_type }}
<label class="form-control-placeholder">Modulation type</label>
</div>
<div class="inline_field form-group">
{{ wizard.form.activityRes_activity_type }}
<label class="form-control-placeholder">Activity type</label>
</div>
<div class="inline_field form-group">
{{ wizard.form.activityRes_activity }}
<label class="form-control-placeholder">Activity</label>
</div>
<input type="button" class="add_button" value="+ Add compound"></input>
</div>
</div>
</div>
<div id="Cytotoxicity" class="tabcontent">
<div class="test_activity">
<h2>Describe your cytotoxicity test</h2>
<div class="test_input form-group">
{{ wizard.form.cytotoxDesc_test_name }}
<label class="form-control-placeholder" for="id_TestsForm-id_TestsForm-cytotoxDesc_test_name">Cytotoxicity test name</label>
</div>
<div class="test_input">{{ wizard.form.cytotoxDesc_cell_line }}</div>
<div class="test_input">{{ wizard.form.cytotoxDesc_compound_concentration }}</div>
<h2>Results</h2>
<div class="inline_box_test">
<div class="inline_field">{{ wizard.form.cytotoxRes_compound }}</div>
<div class="inline_field">{{ wizard.form.cytotoxRes_toxicity }}</div>
<input type="button" class="add_button" value="+ Add compound"></input>
</div>
</div>
{% endfor %}
</div>
<div class="test_input">{{ wizard.form.activityDesc_cell_line }}</div>
<div class="test_input">{{ wizard.form.activityDesc_ppi }}</div>
<div class="test_input">{{ wizard.form.activityRes_test_modulation_type }}</div>
</div>
<div id="Cytotoxicity" class="tabcontent">
<div class="test_input">{{ wizard.form.cytotoxDesc_test_name }}</div>
<div class="test_input">{{ wizard.form.cytotoxDesc_cell_line }}</div>
<div class="test_input">{{ wizard.form.cytotoxDesc_compound_concentration }}</div>
<div class="test_input">{{ wizard.form.cytotoxRes_toxicity }}</div>
<div id="PK" class="tabcontent">
<div class="test_activity">
<h2>Describe your PK test</h2>
<div class="test_input">{{ wizard.form.pkDesc_test_name }}</div>
<div class="test_input">{{ wizard.form.pkDesc_organism }}</div>
<div class="test_input">{{ wizard.form.pkDesc_administration_mode }}</div>
<div class="test_input">{{ wizard.form.pkDesc_dose }}</div>
<div class="test_input">{{ wizard.form.pkDesc_dose_interval }}</div>
<h2>Results</h2>
<div class="inline_box_test">
<div class="inline_field">{{ wizard.form.pkRes_compound }}</div>
<div class="inline_field">{{ wizard.form.pkRes_tolerated }}</div>
<div class="inline_field">{{ wizard.form.pkRes_auc }}</div>
<div class="inline_field">{{ wizard.form.pkRes_clearance }}</div>
<div class="inline_field">{{ wizard.form.pkRes_cmax }}</div>
<div class="inline_field">{{ wizard.form.pkRes_oral_bioavailability }}</div>
<div class="inline_field">{{ wizard.form.pkRes_t_demi }}</div>
<div class="inline_field">{{ wizard.form.pkRes_t_max }}</div>
<div class="inline_field">{{ wizard.form.pkRes_voldistribution }}</div>
<input type="button" class="add_button" value="+ Add compound"></input>
</div>
</div>
</div>
</div>
<div id="PK" class="tabcontent">
<div class="test_input">{{ wizard.form.pkDesc_test_name }}</div>
<div class="test_input">{{ wizard.form.pkDesc_organism }}</div>
<div class="test_input">{{ wizard.form.pkDesc_administration_mode }}</div>
<div class="test_input">{{ wizard.form.pkDesc_dose }}</div>
<div class="test_input">{{ wizard.form.pkDesc_dose_interval }}</div>
</div>
</div>
{% endif %}
{% endif %}
</table>
<input class="submit_button" type="submit" value="{% trans "submit" %}"/>
<input class="submit_button" type="submit" value="{% trans "submit" %}"/>
</form>
</div>
</div>
......
Django==1.11
django-bootstrap3
django-pandas
bioservices
typing
django-extensions
pydot
pyparsing
django-formtools
django-debug-toolbar
mod_wsgi
bioblend
django-allauth
#pygraphviz>=1.3 --install-option="--include-path=/usr/local/include/graphviz/" --install-option="--library-path=/usr/local/lib/graphviz"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment