Commit 0d75f1e1 authored by Rachel TORCHET's avatar Rachel TORCHET
Browse files

Update template and add 2 extra steps for Compound and Activity


Former-commit-id: 68460bfad4798669c53f449038a28a44ace0bee8
parent d4682dea
......@@ -4,7 +4,7 @@ from django.db import models
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from .models import Bibliography, Protein, ProteinDomainComplex, Ppi, PpiComplex
from .models import Bibliography, Protein, ProteinDomainComplex, Ppi, PpiComplex, Compound, TestActivityDescription
from .ws import pdb_entry_exists
class IdForm(ModelForm):
......@@ -109,3 +109,19 @@ class PpiComplexForm(ModelForm):
class Meta:
model = PpiComplex
fields = ['complex', 'cc_nb']
class ActivityForm(ModelForm):
class Meta:
model=TestActivityDescription
fields=['test_type','test_name','test_modulation_type']
class CompoundForm(ModelForm):
class Meta:
model = Compound
fields = ['canonical_smile','common_name','is_macrocycle']
#CompoundFormSet = modelformset_factory(
# Compound, exclude=('mddr_compound',), extra=0)
......@@ -733,11 +733,12 @@ display:block;
}
#Form{
border: 1px solid;
border: 1px solid #E3E9EB;
padding: 15px;
min-height: 150px;
text-align: center;
min-height: 350px;
border-top: 1px solid #2D96FA;
}
.readonly {
......@@ -1520,7 +1521,7 @@ button, input, select, textarea {
}
#step li a, #step li a:hover, #step li a:focus {
width: 196.5px;
width: 146.5px;
background-color: #E3E9EB;
color:#8D8888;
font-family: "PlayfairDisplayReg";
......@@ -1532,10 +1533,16 @@ button, input, select, textarea {
#step li a.active {
text-decoration: none;
background-color: #000000;
background-color: #2D96FA;
color:#FFFFFF;
}
#step li a.validate {
text-decoration: none;
background-color: #000000;
color:#ffffff;
}
.step_desc {
padding: 15px;
margin-bottom: 15px;
......
{% extends "add.html" %}
{% load i18n %}
{% block form %}
<div id="step">
<ul>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="validate" href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a class="validate" href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a class="validate" href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a class="active" href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
<div class="step_desc">
<p> Activity test </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.form.management_form }}
{% for form in wizard.form.forms %}
{{ form }}
{% endfor %}
{% else %}
{{ wizard.form }}
{% endif %}
</table>
<input type="submit" value="{% trans "submit" %}"/>
</form>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -4,12 +4,14 @@
{% block form %}
<div id="step">
<ul>
<li><a href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="active" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
......
{% extends "add.html" %}
{% load i18n %}
{% block form %}
<div id="step">
<ul>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="validate" href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a class="validate" href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a class="active" href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
<div class="step_desc">
<p> Activity test </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.form.management_form }}
{% for form in wizard.form.forms %}
{{ form }}
{% endfor %}
{% else %}
{{ wizard.form }}
{% endif %}
</table>
<input type="submit" value="{% trans "Next step" %}"/>
</form>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -10,6 +10,8 @@
<li><a href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
......
......@@ -4,12 +4,14 @@
{% block form %}
<div id="step">
<ul>
<li><a href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="active" href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
......
......@@ -4,12 +4,14 @@
{% block form %}
<div id="step">
<ul>
<li><a href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="validate" href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a class="active" href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
......@@ -40,7 +42,7 @@
</div>
{% endif %}
</table>
<input type="submit" value="{% trans "submit" %}"/>
<input type="submit" value="{% trans "Next step" %}"/>
</form>
<div>
</div>
......
......@@ -4,12 +4,14 @@
{% block form %}
<div id="step">
<ul>
<li><a href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="validate" href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a class="active" href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
......
......@@ -4,12 +4,14 @@
{% block form %}
<div id="step">
<ul>
<li><a href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="validate" href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a class="active" href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
......
{% extends "add.html" %}
{% load i18n %}
{% block form %}
<div id="step">
<ul>
<li><a href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a class="active" href='/admin-session/add/ProteinForm/'>{% trans "Proteins" %}</a></li>
<li><a href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
</ul>
</div>
<div id="Form">
<div class="step_desc">
<p> Based on the PDB code(s) you have provided, we have identified a list of proteins and PFAM domains that may participate to the PPI. Please select ALL the proteins and PFAM domains that do participate to the formation of the full PPI complex. </p>
</div>
<form class="proteins_form" action="" method="post">
{% csrf_token %}
{{ wizard.management_form }}
{{ wizard.form.non_field_errors}}
{% block custom_form %}{% endblock %}
{% if wizard.form.forms %}
{{ wizard.form.management_form }}
{{ formset.management_form }}
{% for form in wizard.form.forms %}
<div class="inline_prot">
<!--{{form.id}}-->
<div class="inline_label">Protein</div>
<div class="inline_field"> {{ form.uniprot_id }}</div>
<div class="inline_field">{{ form.gene_name }}</div>
<div class="inline_field">{{ form.entry_name }}</div>
<div class="inline_field">{{ form.organism }}</div>
</div>
{% endfor %}
{% else %}
<div class="readonlyfields">
{{ wizard.form.uniprot_id }}<br/>
{{ wizard.form.gene_name }}<br/>
{{ wizard.form.entry_name}}<br/>
{{ wizard.form.organism }}<br/>
{{ wizard.form.molecular_functions }}<br/>
</div>
{% endif %}
<input type="submit" value="{% trans "Next step" %}"/>
</form>
</div>
{% endblock %}
......@@ -9,7 +9,7 @@
<div class="inner-wrap">
<ul>
<li>
<a href="/admin-session/view">View Content</a>
<a href="/compound/">View Content</a>
</li>
<li>
<a href="/admin-session/add/IdForm">Add New Content</a>
......
{% extends "base.html" %}
{% extends "admin-session.html" %}
{% block title %}compound{% endblock %}
{% block content %}
<div id="mainnav">
<nav class="secondary-nav">
<div class="inner-wrap">
<ul>
<li>
<a href="/admin-session/view">View Content</a>
</li>
<li>
<a href="/admin-session/add">Add New Content</a>
</li>
<li>
<a hfref="/admin-session/update">Update Content</a>
</li>
</ul>
</div>
</nav>
</div>
<div class="inner-wrap">
<nav class="breadcrumb" role="navigation">
<div id="breadcrumb-label" class="breadcrumb-label">You are here</div>
<div aria-labelledby="breadcrumb-label">
{% block breadcrumb %} {{block.super}}> <a href="/compound/">View content</a>{% endblock %}
</div>
</nav>
</div>
{% include "kekule_display.html" %}
<div class="container-fluid">
<div class="row flex-xl-nowrap">
......
......@@ -4,12 +4,14 @@
{% block form %}
<div id="step">
<ul>
<li><a href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a class="active" href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a class="validate" href='/admin-session/add/IdForm/'>{% trans "ID" %}</a></li>
<li><a class="validate" href='/admin-session/add/BibliographyForm/'>{% trans "Bibliography" %}</a></li>
<li><a class="validate" href='/admin-session/add/PDBForm/'>{% trans "PDB id" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexTypeForm/'>{% trans "Architecture" %}</a></li>
<li><a class="validate" href='/admin-session/add/ProteinDomainComplexForm/'>{% trans "Composition" %}</a></li>
<li><a class="validate" href='/admin-session/add/PPIForm/'>{% trans "PPI" %}</a></li>
<li><a class="validate" href='/admin-session/add/CompoundForm/'>{% trans "Compounds" %}</a></li>
<li><a class="validate" href='/admin-session/add/ActivityForm/'>{% trans "Activity" %}</a></li>
</ul>
</div>
<div id="Form">
......
......@@ -4,7 +4,7 @@ from django.shortcuts import render
from django.http import HttpResponseRedirect, Http404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from formtools.wizard.views import SessionWizardView, NamedUrlSessionWizardView
from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, PpiForm, ProteinFormSet
from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, PpiForm, ProteinFormSet,ActivityForm, CompoundForm
from .models import Protein, Bibliography, ProteinDomainComplex, RefCompoundBiblio, TestActivityDescription, Compound, Ppi
from .ws import get_pdb_uniprot_mapping
......@@ -57,14 +57,18 @@ FORMS = [("IdForm", ippidb.forms.IdForm),
("ProteinDomainComplexTypeForm",
ippidb.forms.ProteinDomainComplexTypeForm),
("ProteinDomainComplexForm", ippidb.forms.ProteinDomainComplexForm),
("PpiForm", ippidb.forms.PpiForm),]
("PpiForm", ippidb.forms.PpiForm),
("CompoundForm", ippidb.forms.CompoundForm),
("ActivityForm", ippidb.forms.ActivityForm),]
TEMPLATES = {"IdForm": "IdForm.html",
"BibliographyForm": "BibliographyForm.html",
"PDBForm": "PDBForm.html",
"ProteinDomainComplexTypeForm": "ProteinDomainComplexTypeForm.html",
"ProteinDomainComplexForm": "ProteinDomainComplexForm.html",
"PpiForm": "PpiForm.html",
"PpiForm": "PpiForm.html",
"CompoundForm":"CompoundForm.html",
"ActivityForm":"ActivityForm.html",
}
......
Supports Markdown
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