From 721a1b306d525bdf2b87476c50a8f5d7cb3a755b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr>
Date: Fri, 20 Jul 2018 17:55:46 +0200
Subject: [PATCH] add admin-session CSS to admin-session pages.

Former-commit-id: 0694064b383d0a008c624cf49538d231d33f14ca
---
 ippisite/ippidb/templates/admin-session.html  |   3 +
 ippisite/ippidb/templates/base.html           |   1 +
 .../ippidb/templates/compound_list.html.bak   | 155 ++++++++++++++++++
 ippisite/ippidb/templates/tidy_options.txt    |   6 +
 4 files changed, 165 insertions(+)
 create mode 100644 ippisite/ippidb/templates/compound_list.html.bak
 create mode 100644 ippisite/ippidb/templates/tidy_options.txt

diff --git a/ippisite/ippidb/templates/admin-session.html b/ippisite/ippidb/templates/admin-session.html
index 21d659b6..7c3498e6 100644
--- a/ippisite/ippidb/templates/admin-session.html
+++ b/ippisite/ippidb/templates/admin-session.html
@@ -2,6 +2,9 @@
 
     
 {% block title %}inhibitors of Protein-Protein Interaction Database{% endblock %}
+{% block extra_css %}
+    <link rel="stylesheet" href="/static/css/admin-session.css">
+{% endblock %}
 
 {% block content %}
 <div id="mainnav">
diff --git a/ippisite/ippidb/templates/base.html b/ippisite/ippidb/templates/base.html
index 46b45bec..da906635 100644
--- a/ippisite/ippidb/templates/base.html
+++ b/ippisite/ippidb/templates/base.html
@@ -8,6 +8,7 @@
         <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
         <link rel="stylesheet" href="/static/css/fonts.css">
         <link rel="stylesheet" href="/static/css/main.css">
+        {% block extra_css %}{% endblock %}
         <link rel="stylesheet" href="/static/css/ippidb-typeahead.css">
 
         <script src="/static/url-polyfill/url-polyfill.js"></script>
diff --git a/ippisite/ippidb/templates/compound_list.html.bak b/ippisite/ippidb/templates/compound_list.html.bak
new file mode 100644
index 00000000..8799348b
--- /dev/null
+++ b/ippisite/ippidb/templates/compound_list.html.bak
@@ -0,0 +1,155 @@
+{% extends "base.html" %}
+{% load customtags %}
+    
+{% block title %}compounds list{% endblock %}
+
+{% block content %}
+<div class="inner-wrap">
+    <nav class="breadcrumb breadNav" role="navigation">
+        <div class="breadNav-label">You are here</div>
+        <div aria-labelledby="breadcrumb-label">
+          {% block breadcrumb %} <a href="/compounds/" class="breadNav-link"> > Query compounds</a>{% endblock %} 
+        </div>
+    </nav>
+</div>
+
+<div class="container-fluid">
+<div class="row flex-xl-nowrap">
+
+<main class="col-12" role="main">
+    <form>
+        <div class="row">
+       {% include "multiselection_button.html" with label="PPI Family" param_name="family" %}
+       {% include "multiselection_button.html" with label="PPI" param_name="ppi" %}
+       {% include "multiselection_button.html" with label="Disease" param_name="disease" %}
+       {% include "multiselection_button.html" with label="Organism" param_name="taxonomy" %}
+       {% include "multiselection_button.html" with label="Bound complex" param_name="boundcomplex" %}
+       {% include "slider_button.html" with label="Molecular weight" param_name="molecular_weight" %}
+       {% include "slider_button.html" with label="AlogP" param_name="a_log_p" %}
+       {% include "slider_button.html" with label="H donors" param_name="nb_donor_h" %}
+        </div>
+        <div class="row">
+        <span class="col-md-6"><span>{{ compounds.paginator.count }} compounds</span>
+            {% if selected_ppis or selected_diseases or selected_taxonomies or selected_boundcomplexes or molecular_weight != molecular_weight_max or a_log_p != a_log_p_max or nb_donor_h != nb_donor_h_max%}
+                <span>&nbsp;-&nbsp;filters:&nbsp;</span>
+                {% if selected_ppis %}
+                    {% for selected in selected_ppis %}
+                        {% include "selected_badge.html" with param_name="ppi" selected=selected %}
+                    {% endfor %}
+                {% endif %}
+                {% if selected_diseases %}
+                    {% for selected in selected_diseases %}
+                        {% include "selected_badge.html" with param_name="disease" selected=selected %}
+                    {% endfor %}
+                {% endif %}
+                {% if selected_taxonomies %}
+                    {% for selected in selected_taxonomies %}
+                        {% include "selected_badge.html" with param_name="taxonomy" selected=selected %}
+                    {% endfor %}
+                {% endif %}
+                {% if selected_boundcomplexes %}
+                    {% for selected in selected_boundcomplexes %}
+                        {% include "selected_badge.html" with param_name="boundcomplex" selected=selected %}
+                    {% endfor %}
+                {% endif %}
+                {% if molecular_weight != molecular_weight_max %}
+                    {% include "slider_badge.html" with param_name="molecular_weight" param_value=molecular_weight param_label="MW cutoff" %}
+                {% endif %}
+                {% if a_log_p != a_log_p_max %}
+                    {% include "slider_badge.html" with param_name="a_log_p" param_value=a_log_p param_label="AlogP cutoff" %}
+                {% endif %}
+                {% if nb_donor_h != nb_donor_h_max %}
+                    {% include "slider_badge.html" with param_name="nb_donor_h" param_value=nb_donor_h param_label="H donors" %}
+                {% endif %}
+            {% endif %}
+        </span>
+        <div class="dropdown">
+            <button class="btn btn-secondary dropdown-toggle" type="button" id="sortMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                <i class="fas fa-sort-amount-down" title="sort by"></i>
+            </button>
+            <div class="dropdown-menu" aria-labelledby="sortMenuButto">
+                {% for sort_by_value, sort_by_entry in sort_by_options.items %}
+                        <a class="dropdown-item {% if sort_by_value == sort_by %}active{% endif %}" href="#" onclick="modifyUrl('sort_by','{{ sort_by_value }}')">{{ sort_by_entry.name }} ({{ sort_by_entry.order }})</a>
+                {% endfor %}
+            </div>
+        </div>
+        <span class="btn-group col-md-2">
+            <a class="btn btn-default btn-outline-primary {% if display == 'v' %}active{% endif %}" href="#" {% if display != 'v' %}onclick="modifyUrl('display', 'v')"{% endif %}>
+                <i class="fa fa-th" title="Thumbnails"></i>
+            </a>
+            <a class="btn btn-default btn-outline-primary {% if display == 'l' %}active{% endif %}" href="#" {% if display != 'l' %}onclick="modifyUrl('display', 'l')"{% endif %}>
+                <i class="fa fa-bars" title="List"></i>
+            </a>
+            <a class="btn btn-default btn-outline-primary {% if display == 't' %}active{% endif %}" href="#" {% if display != 't' %}onclick="modifyUrl('display', 't')"{% endif %}>
+                <i class="fa fa-table" title="Table"></i>
+            </a>
+        </span>
+        </div>
+    </form>
+{% if compounds.all %}
+    <div class="row">
+    {% if display == 'v' %}
+        {% for compound in compounds %}
+            {% include "compound_v_item.html" with compound=compound %}
+        {% endfor %}
+    {% elif display == 'l'%}
+        {% for compound in compounds %}
+            {% include "compound_l_item.html" with compound=compound %}
+        {% endfor %}
+    {% else %}
+        {% include "compound_t_list.html" with compounds=compounds %}
+    {% endif %}
+    </div>
+{% else %}
+    <p>Nothing found there!</p>
+{% endif %}					
+                    </main>
+</div>
+</div>
+
+<nav>
+  <ul class="pagination pagination-sm justify-content-end col-12">
+    {% if compounds.has_previous %}
+    <li class="page-item">
+      <a class="page-link" href="?{% url_replace request 'page' compounds.previous_page_number  %}" aria-label="Previous">
+        <span aria-hidden="true">&laquo;</span>
+        <span class="sr-only">Previous</span>
+      </a>
+    </li>
+    {% endif %}
+
+    <li class="page-item disabled">
+     <span class="page-link">Page {{ compounds.number }} of {{ compounds.paginator.num_pages }}.</span>
+    </li>
+
+    {% if compounds.has_next %}
+    <li class="page-item">
+      <a class="page-link" href="?{% url_replace request 'page' compounds.next_page_number  %}" aria-label="Next">
+        <span aria-hidden="true">&raquo;</span>
+        <span class="sr-only">Next</span>
+      </a>
+    </li>
+    {% endif %}
+
+    <li class="page-item ml-3">
+      <div class="input-group input-group-sm">
+        <input id="pageNumber" type="number" min="1" max="{{compounds.paginator.num_pages}}" step="1" placeholder="page #" style="width: 4em;" aria-label="Page number">
+        <div class="input-group-append">
+          <button class="btn btn-outline-primary" type="button" onclick="modifyUrl('page',$('#pageNumber').val())">Go</button>
+        </div>
+      </div>
+    </li>
+
+  </ul>
+</nav>
+
+  {% include "multiselection_modal.html" with label="PPI Family" selected_list=selected_families unselected_list=families param_name="family" all_param_name="families_all" all_param_value=families_all %}
+  {% include "multiselection_modal.html" with label="PPI" selected_list=selected_ppis unselected_list=ppis param_name="ppi" all_param_name="ppis_all" all_param_value=ppis_all %}
+  {% include "multiselection_modal.html" with label="Disease" selected_list=selected_diseases unselected_list=diseases param_name="disease" all_param_name="diseases_all" all_param_value=diseases_all %}
+  {% include "multiselection_modal.html" with label="Organism" selected_list=selected_taxonomies unselected_list=taxonomies param_name="taxonomy" all_param_name="taxonomies_all" all_param_value=taxonomies_all %}
+  {% include "multiselection_modal.html" with label="Bound complex" selected_list=selected_boundcomplexes unselected_list=boundcomplexes param_name="boundcomplex" all_param_name="boundcomplexes_all" all_param_value=boundcomplexes_all %}
+  {% include "slider_modal.html" with label="Molecular Weight" param_name="molecular_weight" param_min=molecular_weight_min param_max=molecular_weight_max param_value=molecular_weight step='50' param_label='Select a cutoff value for the molecular weight of the compounds to be selected'%}
+  {% include "slider_modal.html" with label="AlogP" param_name="a_log_p" param_min=a_log_p_min param_max=a_log_p_max param_value=a_log_p step='1' param_label='Select a cutoff value for the AlogP of the compounds to be selected'%}
+  {% include "slider_modal.html" with label="H donors" param_name="nb_donor_h" param_min=nb_donor_h_min param_max=nb_donor_h_max param_value=nb_donor_h step='1' param_label='Select a cutoff value for the number of H donors in the compounds to be selected'%}
+
+{% endblock %}
diff --git a/ippisite/ippidb/templates/tidy_options.txt b/ippisite/ippidb/templates/tidy_options.txt
new file mode 100644
index 00000000..c5e1e3f8
--- /dev/null
+++ b/ippisite/ippidb/templates/tidy_options.txt
@@ -0,0 +1,6 @@
+indent: auto
+indent-spaces: 2
+quiet: yes
+tidy-mark: no
+input-xml: yes
+wrap: 0
-- 
GitLab