diff --git a/.gitignore b/.gitignore index 820d3f3d35b2b44bdbb298f332138a408f219cc3..770db91597ff13db6c67b5ed65b8d40a4b32aaca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /ippidb_backend/PrepareFingerPrints/nbproject/private/ /ippidb_backend/PrepareFingerPrints/build/ /ippidb_backend/PrepareFingerPrints/dist/ -.DS_Store \ No newline at end of file +.DS_Store +ippisite/db.sqlite3 \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a42500e22adf3b21bb3a17d10a9a6a7c1edfb0e7..ca3ff8e3a4a4b383b01a64297c4d330916b416fa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,6 @@ +stages: + - test + - deploy test-centos7: image: centos:centos7 stage: test @@ -7,4 +10,19 @@ test-centos7: - yum install -y gcc graphviz graphviz-devel - cd ippisite - pip3 install -r requirements.txt - - python3 manage.py test \ No newline at end of file + - python3 manage.py test +test-centos7: + image: centos:centos7 + stage: deploy + script: + - yum install -y epel-release + - yum install install -y python34-pip python34-devel + - yum install -y gcc graphviz graphviz-devel + - cd ippisite + - pip3 install -r requirements.txt + - python3 manage.py test + environment: + name: production + url: https://ippidb.pasteur.fr + only: + - master \ No newline at end of file diff --git a/ansible/ansible.sh b/ansible/ansible.sh new file mode 100755 index 0000000000000000000000000000000000000000..3da58cbd6dddd1a3400ad0f6492373e9e3df6832 --- /dev/null +++ b/ansible/ansible.sh @@ -0,0 +1,2 @@ +#!/bin/bash +ansible-playbook -i ./hosts $1 \ No newline at end of file diff --git a/ansible/config_files.yaml b/ansible/config_files.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4615f84e6a735dd7b629afb9e4221ff4f9512f66 --- /dev/null +++ b/ansible/config_files.yaml @@ -0,0 +1,18 @@ +--- +- name: Copy configuration files + hosts: all + gather_facts: no + + tasks: + - name: nginx config file + template: src=../config/nginx.conf dest=/etc/nginx/sites-enabled/django + register: nginx_config + - name: nginx restart + service: name=nginx state=restarted + when: nginx_config.changed + - name: uwsgi config file + template: src=../config/uwsgi.ini dest=/etc/uwsgi/apps-enabled/django.ini + register: uwsgi_config + - name: uwsgi restart + service: name=uwsgi state=restarted + when: uwsgi_config.changed diff --git a/ansible/deploy.yaml b/ansible/deploy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..79881e35918c2de285ecd86c14bc51dc2057738b --- /dev/null +++ b/ansible/deploy.yaml @@ -0,0 +1,43 @@ +--- +- hosts: all + become: yes + become_user: ippidb + gather_facts: no + tasks: + - name: pull branch master + git: + repo=git@gitlab.pasteur.fr:odoppelt/iPPIDB.git + dest=/home/ippidb/iPPIDB + accept_hostkey=yes + +- hosts: all + become: yes + gather_facts: no + tasks: + - name: install python requirements + pip: requirements=/home/ippidb/iPPIDB/ippisite/requirements.txt extra_args=--upgrade executable=pip3 + +- hosts: all + become: yes + become_user: ippidb + gather_facts: no + #environment: + #DJANGO_SETTINGS_MODULE: "{{ django_project }}.settings.production" + #DATABASE_URL: postgres://{{ dbuser }}:{{ dbpassword }}@localhost/{{ dbname }} + #STATIC_ROOT: "{{ static_dir }}" + + tasks: + - name: create static_root dir + file: path={{ static_dir }} state=directory mode=0755 + - name: django collectstatic + shell: ./manage.py collectstatic --noinput chdir={{ django_dir }} + - name: django migrate + shell: ./manage.py migrate --noinput chdir={{ django_dir }} + - name: django loaddata + shell: ./manage.py loaddata user chdir={{ django_dir }} + +- hosts: all + gather_facts: no + tasks: + - name: uwsgi restart + service: name=uwsgi state=restarted diff --git a/ansible/host_vars/ippidb b/ansible/host_vars/ippidb new file mode 100644 index 0000000000000000000000000000000000000000..0e2b041209a021b7b0be13c49864e2193ab2606a --- /dev/null +++ b/ansible/host_vars/ippidb @@ -0,0 +1,11 @@ +--- +repo_url: ssh://git@bitbucket.org/youruser +repo: yourproject +home_dir: /home/ubuntu +repo_dir: "{{ home_dir }}/{{ repo }}" +django_dir: "{{ repo_dir }}/django" +static_dir: "{{ home_dir }}/static" +django_project: yourproject +dbname: django +dbuser: django +dbpassword: "{{ lookup('password', 'postgresqlpasswd') }}" diff --git a/ansible/hosts b/ansible/hosts new file mode 100644 index 0000000000000000000000000000000000000000..627a1b60c3cb5c61e2650876705f7b5274c40248 --- /dev/null +++ b/ansible/hosts @@ -0,0 +1 @@ +ippidb.pasteur.fr diff --git a/ansible/packages.yaml b/ansible/packages.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5ac686a5b31aea6bc0c288ae56f176b1f4ae32dd --- /dev/null +++ b/ansible/packages.yaml @@ -0,0 +1,20 @@ +--- +- hosts: all + gather_facts: no + tasks: + - name: Running apt update + apt: update_cache=yes + - name: Installing required packages + apt: name={{item}} state=present + with_items: + - fail2ban + - postgresql + - postgresql-client + - git + - python-pip + - rdiff-backup + - libpq-dev + - python-psycopg2 + - uwsgi + - uwsgi-plugin-python + - nginx diff --git a/ansible/postgresql.yaml b/ansible/postgresql.yaml new file mode 100644 index 0000000000000000000000000000000000000000..58c90c2ba5fa026dd1912a80b5d7b17463b58276 --- /dev/null +++ b/ansible/postgresql.yaml @@ -0,0 +1,13 @@ +--- +- hosts: all + become: yes + become_user: postgres + gather_facts: no + + tasks: + - name: ensure database is created + postgresql_db: name={{dbname}} + - name: ensure user has access to database + postgresql_user: db={{dbname}} name={{dbuser}} password={{dbpassword}} priv=ALL + - name: ensure user does not have unnecessary privilege + postgresql_user: name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB diff --git a/ansible/ssh_key.json.j2 b/ansible/ssh_key.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..81d0ac74b994051319b17da12ebf899d5fbc8b9d --- /dev/null +++ b/ansible/ssh_key.json.j2 @@ -0,0 +1 @@ +{"id": "odoppelt/iPPIDB","title" : "{ippidb_deploy_key","key": "{{ key_value.stdout }}"} diff --git a/ansible/system.yaml b/ansible/system.yaml new file mode 100644 index 0000000000000000000000000000000000000000..94f5aac152b6b03bab87f4b5b97b8e21fcd095ad --- /dev/null +++ b/ansible/system.yaml @@ -0,0 +1,58 @@ +--- +- hosts: all + gather_facts: no + tasks: + - name: Create {{ deploy_user_name }} user + user: name={{ deploy_user_name }} generate_ssh_key=yes ssh_key_bits=2048 ssh_key_file=.ssh/id_rsa + become: true + #- name: Read SSH public key + # slurp: src=/home/ippidb/.ssh/id_rsa.pub + # register: public_key + # become: true + #- debug: msg="{{ public_key['content'] | b64decode }}" + - name: install git + yum: name=git state=present + become: true + - name: Add repository + become: true + yum_repository: + name: epel + description: EPEL YUM repo + gpgcheck: no + baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/ + - name: install python3 + yum: name=python34 state=present update_cache=yes + become: true + - name: install python3 development package + yum: name=python34-devel state=present update_cache=yes + become: true + - name: install setuptools + yum: name=python34-setuptools state=present update_cache=yes + become: true + - name: install pip + shell: "easy_install-3.4 pip" + become: true + - name: install graphviz + yum: name=graphviz state=present update_cache=yes + become: true + - name: install graphviz-devel + yum: name=graphviz-devel state=present update_cache=yes + become: true + - name: install the 'Development tools' package group + yum: + name: "@Development tools" + state: present + become: true + - name: Cat deployer's user public key + shell: "cat /home/{{ deploy_user_name }}/.ssh/id_rsa.pub" + register: key_value + become: true + - name: Create ssh_key json + template: src=ssh_key.json.j2 dest=/home/{{ deploy_user_name }}/ssh_key.json group={{ deploy_user_name }} owner={{ deploy_user_name }} force=yes + become: true + - name: Cat deployer's user public key + shell: "cat /home/{{ deploy_user_name }}/ssh_key.json" + become: true + - name: Upload deploy keys to gitlab + shell: "curl -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -H 'PRIVATE-TOKEN: {{ repo_api_token }}' --data-binary @/home/{{ deploy_user_name }}/ssh_key.json https://gitlab.pasteur.fr/api/v3/projects/198/keys" + become: true diff --git a/ansible/upgrade.yaml b/ansible/upgrade.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bcfed626e57532e5fc326d440c85f69668c5e6f2 --- /dev/null +++ b/ansible/upgrade.yaml @@ -0,0 +1,10 @@ +--- +- hosts: all + gather_facts: no + tasks: + - name: Running update and safe-upgrade + apt: + update_cache=yes + upgrade=safe + register: result + - debug: var=result.stdout_lines diff --git a/ippisite/db.sqlite3.REMOVED.git-id b/ippisite/db.sqlite3.REMOVED.git-id index cb9c5e1693a3710e494a1ba429eeae1858babf29..fd8fbb23c5c506458a45a36f2f5747b0d78855d2 100644 --- a/ippisite/db.sqlite3.REMOVED.git-id +++ b/ippisite/db.sqlite3.REMOVED.git-id @@ -1 +1 @@ -067f156ca37c93920f1a15dac26337a9956fccbb \ No newline at end of file +cbc5368d062b8764f1b0d652691f17cd132d699f \ No newline at end of file diff --git a/ippisite/ippidb/forms.py b/ippisite/ippidb/forms.py index c77eeae976d24267f606b879aa1ed34ba460011a..43322b75d0db67d511f0779a555d408a051fa6f0 100644 --- a/ippisite/ippidb/forms.py +++ b/ippisite/ippidb/forms.py @@ -1,4 +1,4 @@ -from django.forms import ModelForm,modelformset_factory +from django.forms import ModelForm,modelformset_factory,formset_factory from django import forms from django.db import models from .models import Bibliography, Protein, ProteinDomainComplex, Ppi, PpiComplex @@ -26,21 +26,22 @@ class BibliographyForm(ModelForm): class PDBForm(forms.Form): pdb_id = forms.CharField(label="PDB ID",max_length=4, widget=forms.TextInput(attrs={'placeholder': 'e.g 4HHB'})) +PDBFormSet = formset_factory(PDBForm) +formset=PDBFormSet() class ProteinForm(ModelForm): class Meta: model = Protein exclude = ['recommended_name_long', 'short_name'] widgets = { - 'uniprot_id' : forms.TextInput(attrs={'placeholder': 'e.g Q03164'}), - 'gene_name' : forms.TextInput(attrs={'placeholder':'e.g KMT2A'}), - 'entry_name' : forms.TextInput(attrs={'placeholder':'e.g KMT2A_HUMAN'}), + 'uniprot_id' : forms.TextInput(attrs={'readonly':'readonly','class':'readonly'}), + 'gene_name' : forms.TextInput(attrs={'readonly':'readonly','class':'readonly'}), + 'entry_name' : forms.TextInput(attrs={'readonly':'readonly','class':'readonly'}), + 'organism': forms.TextInput(attrs={'readonly':'readonly','class':'readonly'}), } -ProteinFormSet = modelformset_factory(Protein, exclude=('recommended_name_long', 'short_name')) -formset=ProteinFormSet() -for form in formset: - print(form.as_table()) +ProteinFormSet = modelformset_factory(Protein, exclude=('recommended_name_long', 'short_name'), extra=0) + ARCHI_TYPE = ( ('inhibited', 'Inhibited'), @@ -69,7 +70,8 @@ class ProteinDomainComplexTypeForm(forms.Form): archi = forms.CharField( label="PPI Architecture Type", widget=forms.Select( - choices=ARCHI_TYPE) + choices=ARCHI_TYPE, + ) ) inhibited = forms.ChoiceField( widget=forms.RadioSelect, diff --git a/ippisite/ippidb/static/css/ippidb.css b/ippisite/ippidb/static/css/ippidb.css index 877677d5f801b43c00c60db8fcd96e79e0c71b6d..022b5e443e27b5be5a8baa98ddc7d42b4f84eb2a 100644 --- a/ippisite/ippidb/static/css/ippidb.css +++ b/ippisite/ippidb/static/css/ippidb.css @@ -643,9 +643,10 @@ body { display:inline-block; } - /* BUTTONS */ +/* IdForm*/ + #id_IdForm-source { overflow: hidden; width: 400px; @@ -658,7 +659,6 @@ body { background-color: #E8E0E0; color: #8D8888; text-align: center; - border: 1px solid #8D8888; } #id_IdForm-source input { @@ -684,6 +684,8 @@ body { border-right: 1px solid #E3E9EB; } +/* BibliographyForm*/ + #ck-button { margin: 4px; float:left; @@ -699,7 +701,6 @@ body { display:block; background-color: #E8E0E0; color: #8D8888; - border: 1px solid #8D8888; } #ck-button label input { @@ -735,6 +736,579 @@ body { border-right: 1px solid #E3E9EB; } +/* ProteinDomainComplexTypeForm */ + +#id_ProteinDomainComplexTypeForm-inhibited { + overflow: hidden; + width: 600px; + padding-bottom: 5px; + display: flex; +} + +/* Background image classes */ +.imageBack_Inhib_Hetero2-merAB input { + display:none; +} + +.imageBack_Inhib_Hetero2-merAB label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Hetero2-merAB_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Inhib_Hetero2-merAB input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Hetero2-merAB_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Inhib_Hetero2-merAB input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Hetero2-merAB_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + + +.imageBack_Inhib_Homo2-merA2 input { + display:none; +} + +.imageBack_Inhib_Homo2-merA2 label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Homo2-merA2_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; +} + +.imageBack_Inhib_Homo2-merA2 input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Homo2-merA2_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Inhib_Homo2-merA2 input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Homo2-merA2_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Inhib_Customyourown input { + display:none; +} + +.imageBack_Inhib_Customyourown label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Customyourown_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Inhib_Customyourown input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Customyourown_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Inhib_Customyourown input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Inhibited/Customyourown_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} +/* Stabilized */ + +#stabilized{ + display:none; +} + +#id_ProteinDomainComplexTypeForm-stabilized { + overflow: hidden; + width: 600px; + padding-bottom: 5px; + display: flex; + flex-wrap: wrap; +} + +.imageBack_Stab_Hetero2-merAB input { + display:none; +} + +.imageBack_Stab_Hetero2-merAB label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Hetero2-merAB_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Hetero2-merAB input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Hetero2-merAB_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Hetero2-merAB input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Hetero2-merAB_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo2-merA2 input { + display:none; +} + +.imageBack_Stab_Homo2-merA2 label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo2-merA2_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Homo2-merA2 input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo2-merA2_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo2-merA2 input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo2-merA2_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo-Like2-merA2 input { + display:none; +} + +.imageBack_Stab_Homo-Like2-merA2 label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo-Like2-merA2_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Homo-Like2-merA2 input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo-Like2-merA2_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo-Like2-merA2 input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo-Like2-merA2_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo3-merA3 input { + display:none; +} + +.imageBack_Stab_Homo3-merA3 label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo3-merA3_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Homo3-merA3 input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo3-merA3_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo3-merA3 input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo3-merA3_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo3-merA3inhibitedA2-dimer input { + display:none; +} + +.imageBack_Stab_Homo3-merA3inhibitedA2-dimer label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo3-merA3inhibitedA2-dimer_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Homo3-merA3inhibitedA2-dimer input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo3-merA3inhibitedA2-dimer_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo3-merA3inhibitedA2-dimer input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo3-merA3inhibitedA2-dimer_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo4-merA4 input { + display:none; +} + +.imageBack_Stab_Homo4-merA4 label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo4-merA4_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Homo4-merA4 input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo4-merA4_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Homo4-merA4 input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Homo4-merA4_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Ring-Like3-merA3 input { + display:none; +} + +.imageBack_Stab_Ring-Like3-merA3 label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Ring-Like3-merA3_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Ring-Like3-merA3 input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Ring-Like3-merA3_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Ring-Like3-merA3 input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Ring-Like3-merA3_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Ring-Like5-merA5 input { + display:none; +} + +.imageBack_Stab_Ring-Like5-merA5 label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Ring-Like5-merA5_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Ring-Like5-merA5 input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Ring-Like5-merA5_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Ring-Like5-merA5 input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Ring-Like5-merA5_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + + +.imageBack_Stab_Customyourown input { + display:none; +} + +.imageBack_Stab_Customyourown label span{ + display: inline-block; + width: 180px; + text-align: center; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Customyourown_Apo.png'); + background-position: center; + background-repeat: no-repeat; + height: 180px; + font-size: 12px; + +} + +.imageBack_Stab_Customyourown input:hover+label span{ + cursor: pointer; + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Customyourown_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + +.imageBack_Stab_Customyourown input[type="radio"]:checked+label span{ + background-color: #FFFFFF; + background-image: url('/static/images/PPITypes/Stabilized/Customyourown_Holo.png'); + background-position: center; + background-repeat: no-repeat; + color: #000000; + border-bottom: 1px solid #2D96FA; + border-top: 1px solid #E3E9EB; + border-left: 1px solid #E3E9EB; + border-right: 1px solid #E3E9EB; +} + + +/* Proteins form */ + +.proteins_form { + width: 100%; +} + +.inline_prot { + display: inline-flex; + width: 100%; +} + +.inline_label { + font-weight: 700; + padding-right: 5px; +} + +.inline_field { + padding-right: 5px; +} + +.inline_field input { + width: 130px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + padding-right: 5px; +} + +.inline_field select { + width: 150px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + padding-right: 5px; +} + +.inline_field_multiple select { + width: 210px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + padding-right: 5px; +} + button, input, select, textarea { line-height: inherit; font-family: "BrandonGrotesqueReg"; @@ -808,6 +1382,18 @@ button, input, select, textarea { } +.type_style { + background-color: rgb(227, 233, 235); + padding: 10px; + margin: 10px; +} + +.type_title h1{ + text-align: left; + color: #414144; + font-size: 42px; +} + /* FOOTER */ .main-footer { @@ -955,3 +1541,5 @@ line-height: 21px; width: 19px; height: 16px; } + + diff --git a/ippisite/ippidb/static/images/Other/Plus.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Apo.png similarity index 65% rename from ippisite/ippidb/static/images/Other/Plus.png rename to ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Apo.png index 3726d3e314ccb7c3e948171be5bd96293090c455..90ecfaf138fd40773474bc71847888c92db595f9 100644 Binary files a/ippisite/ippidb/static/images/Other/Plus.png and b/ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Apo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Holo.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Holo.png new file mode 100644 index 0000000000000000000000000000000000000000..c094ea6329150b771b729db3f26e1bd150e47c6f Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Inhibited/Customyourown_Holo.png differ diff --git a/ippisite/ippidb/static/images/DimericsPPI/Inhibited/Hetero2merApo.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Hetero2-merAB_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Inhibited/Hetero2merApo.png rename to ippisite/ippidb/static/images/PPITypes/Inhibited/Hetero2-merAB_Apo.png diff --git a/ippisite/ippidb/static/images/DimericsPPI/Inhibited/Hetero2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Hetero2-merAB_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Inhibited/Hetero2merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Inhibited/Hetero2-merAB_Holo.png diff --git a/ippisite/ippidb/static/images/DimericsPPI/Inhibited/Homo2merApo.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Homo2-merA2_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Inhibited/Homo2merApo.png rename to ippisite/ippidb/static/images/PPITypes/Inhibited/Homo2-merA2_Apo.png diff --git a/ippisite/ippidb/static/images/DimericsPPI/Inhibited/Homo2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Inhibited/Homo2-merA2_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Inhibited/Homo2merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Inhibited/Homo2-merA2_Holo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Apo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Apo.png new file mode 100644 index 0000000000000000000000000000000000000000..90ecfaf138fd40773474bc71847888c92db595f9 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Apo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Holo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Holo.png new file mode 100644 index 0000000000000000000000000000000000000000..c094ea6329150b771b729db3f26e1bd150e47c6f Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Customyourown_Holo.png differ diff --git a/ippisite/ippidb/static/images/DimericsPPI/Stabilized/Hetero2merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2-merABApo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Stabilized/Hetero2merApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2-merABApo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2-merAB_Apo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2-merAB_Apo.png new file mode 100644 index 0000000000000000000000000000000000000000..3e8454bb488976a8f8093b7b233eb245fa40736e Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2-merAB_Apo.png differ diff --git a/ippisite/ippidb/static/images/DimericsPPI/Stabilized/Hetero2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2-merAB_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Stabilized/Hetero2merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2-merAB_Holo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2merHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..d24922087ba4e714eaa96656c1695af9d35e9c97 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Hetero2merHolo.png differ diff --git a/ippisite/ippidb/static/images/DimericsPPI/Stabilized/HomoLike2merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo-Like2-merA2_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Stabilized/HomoLike2merApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo-Like2-merA2_Apo.png diff --git a/ippisite/ippidb/static/images/DimericsPPI/Stabilized/HomoLike2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo-Like2-merA2_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Stabilized/HomoLike2merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo-Like2-merA2_Holo.png diff --git a/ippisite/ippidb/static/images/DimericsPPI/Stabilized/Homo2merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2-merA2_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Stabilized/Homo2merApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2-merA2_Apo.png diff --git a/ippisite/ippidb/static/images/DimericsPPI/Stabilized/Homo2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2-merA2_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/DimericsPPI/Stabilized/Homo2merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2-merA2_Holo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2merApo.png new file mode 100644 index 0000000000000000000000000000000000000000..f0b992316412241a28696b75fb31e8f514cbd2d6 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2merApo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2merHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..919817912121536f241c89a1190d6be7cc6b36ab Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo2merHolo.png differ diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3_Apo.png diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3_Holo.png diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merInhibitedApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3inhibitedA2-dimer_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merInhibitedApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3inhibitedA2-dimer_Apo.png diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merInhibitedHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3inhibitedA2-dimer_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo3merInhibitedHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3-merA3inhibitedA2-dimer_Holo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merApo.png new file mode 100644 index 0000000000000000000000000000000000000000..b957ce83fe617338433c17f070bd2800729ffb3e Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merApo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..710b9d4c3b4fed30914a2e5a4e27057d366358c2 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merHolo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merInhibitedApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merInhibitedApo.png new file mode 100644 index 0000000000000000000000000000000000000000..a6713ab6587fb0cf8cb064ca81da2e23401d8c96 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merInhibitedApo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merInhibitedHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merInhibitedHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..896b9af2ac0832ae0f4bf10ac3a24bb9e457065b Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo3merInhibitedHolo.png differ diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo4merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4-merA4_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo4merApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4-merA4_Apo.png diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo4merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4-merA4_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/Homo4merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4-merA4_Holo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4merApo.png new file mode 100644 index 0000000000000000000000000000000000000000..b3f702b9b8f43fab3c7708cb11962da2ff6b7b51 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4merApo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4merHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..3d8abdbf6cbb7e7421d2a400a65d3653c07c98f6 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/Homo4merHolo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/HomoLike2merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/HomoLike2merApo.png new file mode 100644 index 0000000000000000000000000000000000000000..8c95fbb5c993e3d78956f9760b90a6ffc5ada633 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/HomoLike2merApo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/HomoLike2merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/HomoLike2merHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..eaa01b41c1401a229036aac2f239922e452a60f5 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/HomoLike2merHolo.png differ diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo3merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like3-merA3_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo3merApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like3-merA3_Apo.png diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo3merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like3-merA3_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo3merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like3-merA3_Holo.png diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo5merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like5-merA5_Apo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo5merApo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like5-merA5_Apo.png diff --git a/ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo5merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like5-merA5_Holo.png similarity index 100% rename from ippisite/ippidb/static/images/MultimericPPI/Stabilized/RingLikeHomo5merHolo.png rename to ippisite/ippidb/static/images/PPITypes/Stabilized/Ring-Like5-merA5_Holo.png diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo3merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo3merApo.png new file mode 100644 index 0000000000000000000000000000000000000000..295811d10b67733590499f8b6b4262af85885c15 Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo3merApo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo3merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo3merHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..09b2f10afbc8dbddcc037936f97313f59575772f Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo3merHolo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo5merApo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo5merApo.png new file mode 100644 index 0000000000000000000000000000000000000000..785840de1de4592ea995f8ebdcbc078d62f606af Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo5merApo.png differ diff --git a/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo5merHolo.png b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo5merHolo.png new file mode 100644 index 0000000000000000000000000000000000000000..af15684b19504a7a3bc57aab2964da43d477983b Binary files /dev/null and b/ippisite/ippidb/static/images/PPITypes/Stabilized/RingLikeHomo5merHolo.png differ diff --git a/ippisite/ippidb/static/js/ippidb.js b/ippisite/ippidb/static/js/ippidb.js index f6a8779010fc06333c20d9ee30434810d5c84314..4072273c28279a7e8873719dfe1d26a51d2cabf7 100644 --- a/ippisite/ippidb/static/js/ippidb.js +++ b/ippisite/ippidb/static/js/ippidb.js @@ -15,4 +15,22 @@ $(document).ready(function() { $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) -}); \ No newline at end of file +}); + + +$(document).ready(function(){ + $('#id_ProteinDomainComplexTypeForm-archi').on('change', function() { + if ( this.value === "inhibited") + { + $("#inhibited").show(); + $("#stabilized").hide(); + } + else + { + $("#inhibited").hide(); + $("#stabilized").show(); + } + }); +}); + + diff --git a/ippisite/ippidb/templates/BibliographyForm.html b/ippisite/ippidb/templates/BibliographyForm.html index 657704585f694deda3429576e35cb0120417e056..f7f005e54d7099ebf4c2c7796f67055fab59fd4d 100644 --- a/ippisite/ippidb/templates/BibliographyForm.html +++ b/ippisite/ippidb/templates/BibliographyForm.html @@ -14,58 +14,56 @@ </div> <div id="Form"> <div class="step_desc"> - <p>Based on the ID you have provided, we have identified the following information concerning your bibliographic source. -Please check that the information below is correct (Title, Authors etc. ) and answer the few questions about the content of your bibliographic source.</p> + <p>Based on the ID you have provided, we have identified the following information concerning your bibliographic source. + Please check that the information below is correct (Title, Authors etc. ) and answer the few questions about the content of your bibliographic source.</p> </div> <form action="" method="post"> {% csrf_token %} <table> - {{ wizard.management_form }} - {{ wizard.form.errors}} - {{ wizard.form.non_field_errors}} - {% block custom_form %}{% endblock %} + {{ 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 %} + <div class="readonlyfields"> + {{ wizard.form.source }}<br/> + {{ wizard.form.id_source }}<br/> + {{ wizard.form.title }}<br/> + {{ wizard.form.journal_name }}<br/> + </div> + <p> This publication contains :<br/></p> + <div id="ck-button"> + <label> + <input type="checkbox"><span>{{ wizard.form.cytotox.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_silico.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_vitro.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_vivo.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.in_cellulo.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.pharmacokinetic.label }}</span> + </label> + <label> + <input type="checkbox"><span>{{ wizard.form.xray.label }}</span> + </label> + </div> + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - <div class="readonlyfields"> - {{ wizard.form.source }}<br/> - {{ wizard.form.id_source }}<br/> - {{ wizard.form.title }}<br/> - {{ wizard.form.journal_name }}<br/> - </div> - <p> This publication contains :<br/></p> - <div id="ck-button"> - <label> - <input type="checkbox"><span>{{ wizard.form.cytotox.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_silico.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_vitro.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_vivo.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.in_cellulo.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.pharmacokinetic.label }}</span> - </label> - <label> - <input type="checkbox"><span>{{ wizard.form.xray.label }}</span> - </label> -</div> -{% endif %} -</table> -{% if wizard.steps.prev %} - -{% endif %} - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/IdForm.html b/ippisite/ippidb/templates/IdForm.html index d8c8ec70aeebb23cfcd428b53d9e83c2e70cadaf..977a4fc3d4ff4963b7a6949a3e7b425db4e7cec6 100644 --- a/ippisite/ippidb/templates/IdForm.html +++ b/ippisite/ippidb/templates/IdForm.html @@ -23,24 +23,25 @@ {{ 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 %} + <div id="id_IdForm-source"> + {% for radio in wizard.form.source %} + {{ radio.tag }} + <label for="{{ radio.id_for_label }}"> + <span>{{ radio.choice_label }}</span> + </label> + {% endfor %} + </div> + {{ wizard.form.id_source}} + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - <div id="id_IdForm-source"> - {% for radio in wizard.form.source %} - {{ radio.tag }} - <label for="{{ radio.id_for_label }}"> - <span>{{ radio.choice_label }}</span> - </label> - {% endfor %} - </div> - {{ wizard.form.id_source}} -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/PDBForm.html b/ippisite/ippidb/templates/PDBForm.html index 4f938db49d07f54441430917f30de1d3198cf374..a146e696219ff5fb2bfa91a7d563d332eabe98df 100644 --- a/ippisite/ippidb/templates/PDBForm.html +++ b/ippisite/ippidb/templates/PDBForm.html @@ -23,19 +23,16 @@ {{ wizard.form.errors}} {{ 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 %} + {{ form }} + {% endfor %} + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - <div class="input_fields_wrap"> - <div class="input_size">{{ wizard.form.pdb_id }} - <div class="add_field_button"><img class="small_icon" src="/static/images/Other/AddMore.png"></div></div> - </div> -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> </div> -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/ippisite/ippidb/templates/PpiForm.html b/ippisite/ippidb/templates/PpiForm.html index f377c4c11369b7e982f4634c1dac1eec44ab4cd1..ad7ec0c70ada202373716fa77a55e517a9a4bdbc 100644 --- a/ippisite/ippidb/templates/PpiForm.html +++ b/ippisite/ippidb/templates/PpiForm.html @@ -23,20 +23,21 @@ {{ 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> + {% if wizard.steps.prev %} + <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button> + <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "previous step" %}</button> + {% endif %} + <input type="submit" value="{% trans "submit" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - {{ wizard.form }} -{% endif %} -</table> -{% if wizard.steps.prev %} - <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button> - <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "previous step" %}</button> -{% endif %} - <input type="submit" value="{% trans "submit" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/ProteinDomainComplexForm.html b/ippisite/ippidb/templates/ProteinDomainComplexForm.html index 3c22c48d03cd157e203b71a2253de81f3c2c7fed..4c00a21d633c22fcc29a8757645ef99838316c16 100644 --- a/ippisite/ippidb/templates/ProteinDomainComplexForm.html +++ b/ippisite/ippidb/templates/ProteinDomainComplexForm.html @@ -20,24 +20,24 @@ If your PPI complex is not among them, please select « Create you Own »</p> </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 %} + <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 %} + {% else %} + {{ wizard.form }} + {% endif %} + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - {{ wizard.form }} -{% endif %} -</table> -{% if wizard.steps.prev %} - -{% endif %} - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html b/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html index 8a67d1dc7853ec10591aa51f93daf9bc212f5e45..db177f898dc34c4344f4c6c99b60254ab5f31118 100644 --- a/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html +++ b/ippisite/ippidb/templates/ProteinDomainComplexTypeForm.html @@ -24,32 +24,46 @@ If your PPI complex is not among them, please select « Create you Own »</p> {{ 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 %} + {% endfor %} + {% else %} + {{ wizard.form.archi }} + <div id='inhibited' name='inhibited' class="type_style"> + <div class="type_title"> + <h1>Inhibited</h1> + </div> + <div id="id_ProteinDomainComplexTypeForm-inhibited"> + {% for radio in wizard.form.inhibited %} + <div class="imageBack_Inhib_{{radio.choice_label|cut:" "}}"> + {{ radio.tag }} + <label for="{{ radio.id_for_label }}"> + <span>{{ radio.choice_label}}</span> + </label> + </div> + {% endfor %} + </div> + </div> + <div id="stabilized" class="type_style"> + <div class="type_title"> + <h1>Stabilized</h1> + </div> + <div id="id_ProteinDomainComplexTypeForm-stabilized"> + {% for radio in wizard.form.stabilized %} + <div class="imageBack_Stab_{{radio.choice_label|cut:" "}}"> + {{ radio.tag }} + <label for="{{ radio.id_for_label }}"> + <span>{{ radio.choice_label}}</span> + </label> + </div> + {% endfor %} + </div> + </div> + {% endif %} + </table> + <input type="submit" value="{% trans "Next step" %}"/> </form> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - <td>{{form.archi_type}}</td> - <td>{{form.inhibited_type}}</td> - {% endfor %} -{% else %} - <script type="text/javascript"> - function Hide (){ - if(document.getElementById('archi').value == 'inhibited'){ - document.getElementById('inhibited').style.display = 'block'; - document.getElementById('stabilized').style.display = ''; - } else { - document.getElementById('inhibited').style.display = ''; - document.getElementById('stabilized').style.display = 'block'; - } - } - ; - </script> - <div id='archi' name='archi' onclick='Hide ()'>{{ wizard.form.archi }}</div> - <div id='inhibited' name='inhibited'>{{ wizard.form.inhibited }}</div> - <div id='stabilized' name= 'stabilized'>{{ wizard.form.stabilized }}</div> - </div> -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/ProteinForm.html b/ippisite/ippidb/templates/ProteinForm.html index e6966f9be08973aad072fc3db3a52e1215962b42..9eb42be3b1712f02f96a58050c4ef4dabc29b7de 100644 --- a/ippisite/ippidb/templates/ProteinForm.html +++ b/ippisite/ippidb/templates/ProteinForm.html @@ -16,28 +16,36 @@ <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 action="" method="post"> + <form class="proteins_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 }} + {{ formset.management_form }} + {% for form in wizard.form.forms %} + <div class="inline_prot"> + <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 class="inline_field_multiple">{{ form.molecular_functions }}</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> -{% if wizard.form.forms %} - {{ wizard.form.management_form }} - {% for form in wizard.form.forms %} - {{ form }} - {% endfor %} -{% else %} - {{ formset.management_form }} - {% for form in formset %} - {% for field in form %} - {{ field.label_tag }} {{ field }} - {% endfor %} - {% endfor %} -{% endif %} -</table> - <input type="submit" value="{% trans "Next step" %}"/> </div> {% endblock %} \ No newline at end of file diff --git a/ippisite/ippidb/templates/admin-session.html b/ippisite/ippidb/templates/admin-session.html index 3b5136cc10cb5664c50228cde8558b25bf37bca9..74c5f3ade4f1a60b00c5a7c4d473fcae1f646158 100644 --- a/ippisite/ippidb/templates/admin-session.html +++ b/ippisite/ippidb/templates/admin-session.html @@ -12,7 +12,7 @@ <a hfref="/admin-session/view">View Content</a> </li> <li> - <a href="/admin-session/add">Add New Content</a> + <a href="/admin-session/add/IdForm">Add New Content</a> </li> <li> <a hfref="/admin-session/update">Update Content</a> diff --git a/ippisite/ippidb/views.py b/ippisite/ippidb/views.py index 862fe3b01350b4313b2e7508666ca7bc4808a3b4..e4e17ee120c3cfea9d9ecd97aef33e5521fc8c19 100644 --- a/ippisite/ippidb/views.py +++ b/ippisite/ippidb/views.py @@ -1,10 +1,11 @@ import ippidb + from django.shortcuts import render from django.http import HttpResponseRedirect from formtools.wizard.views import SessionWizardView,NamedUrlSessionWizardView -from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, PpiForm, ProteinFormSet -from .models import Protein +from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, PpiForm, ProteinFormSet, PDBFormSet +from .models import Protein, Bibliography from .ws import get_pdb_uniprot_mapping def index(request): @@ -24,7 +25,7 @@ def adminSession(request): FORMS = [("IdForm", ippidb.forms.IdForm), ("BibliographyForm", ippidb.forms.BibliographyForm), - ("PDBForm", ippidb.forms.PDBForm), + ("PDBForm", ippidb.forms.PDBFormSet), ("ProteinForm",ippidb.forms.ProteinFormSet), ("ProteinDomainComplexTypeForm", ippidb.forms.ProteinDomainComplexTypeForm), ("ProteinDomainComplexForm", ippidb.forms.ProteinDomainComplexForm), @@ -42,18 +43,32 @@ class IppiWizard(NamedUrlSessionWizardView): def get_template_names(self): return [TEMPLATES[self.steps.current]] + def get_form_instance(self, step): + if self.steps.current=='BibliographyForm': + pk = self.storage.get_step_data('IdForm').get('pk') + return Bibliography.objects.get(pk=pk) + if self.steps.current=='ProteinForm': + pks = self.storage.get_step_data('PDBForm').get('pks') + return Protein.objects.filter(id__in=pks) + def process_step(self, form): """ This method overrides the one used to postprocess the form data. The added code just sets the form model for use in later forms when appropriate """ + data = super(IppiWizard, self).process_step(form).copy() if self.steps.current=='IdForm': form.instance.autofill() - self.instance_dict['BibliographyForm'] = form.instance - elif self.steps.current=='PDBForm': - uniprot_ids = get_pdb_uniprot_mapping(form.cleaned_data['pdb_id']) - proteins = [] + if self.steps.current in ['IdForm', 'Bibliography']: + form.instance.save() + data['pk'] = form.instance.id + if self.steps.current=='PDBForm': + pdb_ids = [form['pdb_id'] for form in form.cleaned_data] + uniprot_ids = [] + protein_ids = [] + for pdb_id in pdb_ids: + uniprot_ids += get_pdb_uniprot_mapping(pdb_id) for uniprot_id in uniprot_ids: try: p = Protein.objects.get(uniprot_id=uniprot_id) @@ -61,10 +76,10 @@ class IppiWizard(NamedUrlSessionWizardView): p = Protein() p.uniprot_id = uniprot_ids[0] p.autofill() - proteins.append(p) - #TODO replace p with proteins as the instance_dict - self.instance_dict['ProteinForm'] = p - return self.get_form_step_data(form) + p.save() + protein_ids.append(p.id) + data['pks'] = protein_ids + return data def done(self, form_list, **kwargs): return render(self.request, '/admin-session/add.html', {