From 11a1b08876367889ac6c47726b5078d455010ad4 Mon Sep 17 00:00:00 2001
From: Floreal Cabanettes <floreal.cabanettes@inra.fr>
Date: Mon, 19 Feb 2018 16:39:50 +0100
Subject: [PATCH] Add contact page, Implements #40

---
 src/dgenies/templates/base.html    |  2 +-
 src/dgenies/templates/contact.html | 26 ++++++++++++++++++++++++++
 src/dgenies/views.py               |  4 ++++
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 src/dgenies/templates/contact.html

diff --git a/src/dgenies/templates/base.html b/src/dgenies/templates/base.html
index 89b006e..14ba965 100644
--- a/src/dgenies/templates/base.html
+++ b/src/dgenies/templates/base.html
@@ -58,7 +58,7 @@
                             </ul>
                         </li>
                         <li class="{% if(menu == 'install') %}active{% endif %}"><a href="/install">Install</a></li>
-                        <li><a href="mailto:support.genopole@toulouse.inra.fr">Contact</a></li>
+                        <li class="{% if(menu == 'contact') %}active{% endif %}"><a href="/contact">Contact</a></li>
                     </ul>
                 </div><!--/.nav-collapse -->
             </div>
diff --git a/src/dgenies/templates/contact.html b/src/dgenies/templates/contact.html
new file mode 100644
index 0000000..3b06f37
--- /dev/null
+++ b/src/dgenies/templates/contact.html
@@ -0,0 +1,26 @@
+{% extends 'base.html' %}
+{% block scripts %}
+    {{ super() }}
+    <style>
+        em {
+            color: red;
+            font-weight: bold;
+        }
+        #body-container {
+            background: url("{{ url_for('static', filename='images/contact.svg') }}") no-repeat 0 25px;
+            background-size: 300px 300px;
+            height: 350px !important;
+        }
+        h1 {
+            margin-bottom: 50px !important;
+        }
+    </style>
+{% endblock %}
+{% block content %}
+
+    <h1>Contact us</h1>
+
+    <p>Please send a mail to <a href="mailto:support.bioinfo.genotoul@inra.fr?subject=[dgenies] Support">support.bioinfo.genotoul@inra.fr</a>.</p>
+    <p><em>Important:</em> please keep <strong>[dgenies]</strong> tag at the beginning of the subject of the mail. Otherwise, the response delay will be increased.</p>
+
+{% endblock %}
\ No newline at end of file
diff --git a/src/dgenies/views.py b/src/dgenies/views.py
index e2864f0..4098550 100644
--- a/src/dgenies/views.py
+++ b/src/dgenies/views.py
@@ -269,6 +269,10 @@ def install():
     toc = Markup(md.toc)
     return render_template("documentation.html", menu="install", content=content, toc=toc)
 
+@app.route("/contact", methods=['GET'])
+def contact():
+    return render_template("contact.html", menu="contact")
+
 
 @app.route("/paf/<id_res>", methods=['GET'])
 def download_paf(id_res):
-- 
GitLab