aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-06-24 23:39:05 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-06-24 23:39:05 +0530
commite52c18a09cabd374093b06ef0f521767cd228ba6 (patch)
tree6548d357ba45e75334da8c225a0c6cd5f77f0850 /app/templates
make it better
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/base.html51
-rw-r--r--app/templates/display_photo.html7
-rw-r--r--app/templates/dock_upload.html53
-rw-r--r--app/templates/flash_messages.html7
-rw-r--r--app/templates/form.html23
-rw-r--r--app/templates/home.html9
-rw-r--r--app/templates/result.html7
-rw-r--r--app/templates/wtform.html20
8 files changed, 177 insertions, 0 deletions
diff --git a/app/templates/base.html b/app/templates/base.html
new file mode 100644
index 0000000..68fe61b
--- /dev/null
+++ b/app/templates/base.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Curie Web</title>
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+ <link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
+</head>
+<body>
+ <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
+ <span class="navbar-brand mb-0 h1">Curie Web</span>
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <div class="collapse navbar-collapse" id="navbarNav">
+ <ul class="navbar-nav">
+ <li class="nav-item active">
+ <a class="nav-link" href="{{ url_for('home') }}">Home <span class="sr-only">(current)</span></a>
+ </li><!--
+ <li class="nav-item">
+ <a class="nav-link" href="{{ url_for('basic_form') }}">Basic Form</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="{{ url_for('wtform') }}">WTForms</a>
+ </li> -->
+ <li class="nav-item">
+ <a class="nav-link" href="{{ url_for('dock_upload') }}">Dock and Report</a>
+ </li>
+ </ul>
+ </div>
+ </nav>
+ <header class="jumbotron jumbotron-fluid">
+ <div class="container">
+ <h1>Curie Web Demo</h1>
+ </div>
+ </header>
+ <main>
+ <div class="container">
+ {% block main %}
+ {% endblock %}
+ </div>
+ </main>
+ <footer class="text-muted text-center text-small">
+ Copyright &copy; 2020
+ </footer>
+
+ <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/app/templates/display_photo.html b/app/templates/display_photo.html
new file mode 100644
index 0000000..413e2e1
--- /dev/null
+++ b/app/templates/display_photo.html
@@ -0,0 +1,7 @@
+{% extends 'base.html' %}
+
+{% block main %}
+ <h2>Description: {{ description }}</h2>
+ <p>Succesfuly Submitted</p>
+ <!-- <img src="{{ url_for('static', filename="uploads/" + filename) }}" /> -->
+{% endblock %} \ No newline at end of file
diff --git a/app/templates/dock_upload.html b/app/templates/dock_upload.html
new file mode 100644
index 0000000..3fc8419
--- /dev/null
+++ b/app/templates/dock_upload.html
@@ -0,0 +1,53 @@
+{% extends 'base.html' %}
+
+{% block main %}
+ <h2>Enter Your Configuration</h2>
+ <form action="{{ url_for('dock_upload') }}" method="post" enctype="multipart/form-data">
+ {% include 'flash_messages.html' %}
+ {{ form.csrf_token }}
+ <div class="form-group">
+ {{ form.description.label }}
+ {{ form.description(class="form-control") }}
+ </div>
+ <div class="form-row">
+ <div class="col">
+ {{ form.size_x.label }}
+ {{ form.size_x(class="form-control")}}
+ </div>
+ <div class="col">
+ {{ form.size_y.label }}
+ {{ form.size_y(class="form-control")}}
+ </div>
+ <div class="col">
+ {{ form.size_z.label }}
+ {{ form.size_z(class="form-control")}}
+ </div>
+ </div>
+ <div class="form-row">
+ <div class="col">
+ {{ form.center_x.label }}
+ {{ form.center_x(class="form-control")}}
+ </div>
+ <div class="col">
+ {{ form.center_y.label }}
+ {{ form.center_y(class="form-control")}}
+ </div>
+ <div class="col">
+ {{ form.center_z.label }}
+ {{ form.center_z(class="form-control")}}
+ </div>
+ </div>
+ <div class="form-row">
+ <div class="col">
+ {{ form.target.label }}
+ {{ form.target(class="form-control") }}
+ </div>
+ <div class="col">
+ {{ form.ligand.label }}
+ {{ form.ligand(class="form-control")}}
+ </div>
+ </div>
+
+ <button class="btn btn-primary">Upload</button>
+ </form>
+{% endblock %} \ No newline at end of file
diff --git a/app/templates/flash_messages.html b/app/templates/flash_messages.html
new file mode 100644
index 0000000..b524c24
--- /dev/null
+++ b/app/templates/flash_messages.html
@@ -0,0 +1,7 @@
+{% with messages = get_flashed_messages(with_categories=true) %}
+ {% if messages %}
+ {% for category, message in messages %}
+ <div class="alert alert-{{ category }}">{{ message }}</div>
+ {% endfor %}
+ {% endif %}
+{% endwith %} \ No newline at end of file
diff --git a/app/templates/form.html b/app/templates/form.html
new file mode 100644
index 0000000..ae30dd5
--- /dev/null
+++ b/app/templates/form.html
@@ -0,0 +1,23 @@
+{% extends 'base.html' %}
+
+{% block main %}
+ <h2>Basic Form in Flask</h2>
+
+ <form action="{{ url_for('basic_form') }}" method="post">
+ {% include 'flash_messages.html' %}
+ <div class="form-group">
+ <label for="firstname">First Name</label>
+ <input type="text" class="form-control" name="firstname" id="firstname" />
+ </div>
+ <div class="form-group">
+ <label for="lastname">Last Name</label>
+ <input type="text" class="form-control" name="lastname" id="lastname" />
+ </div>
+ <div class="form-group">
+ <label for="email">E-mail</label>
+ <input type="email" class="form-control" name="email" id="email" placeholder="jdoe@example.com" />
+ </div>
+
+ <button type="submit" class="btn btn-primary">Submit</button>
+ </form>
+{% endblock %} \ No newline at end of file
diff --git a/app/templates/home.html b/app/templates/home.html
new file mode 100644
index 0000000..f7a7c78
--- /dev/null
+++ b/app/templates/home.html
@@ -0,0 +1,9 @@
+{% extends 'base.html' %}
+
+{% block main %}
+ <h2>Curie Web Demo</h2>
+ <p>The dock and report demo performs molecular docking using AutoDock Vina and then finds protein-ligand interactions using PLIP</p>
+ <ul>
+ <li><a href="{{ url_for('dock_upload') }}">Dock and Report</a></li>
+ </ul>
+{% endblock %} \ No newline at end of file
diff --git a/app/templates/result.html b/app/templates/result.html
new file mode 100644
index 0000000..ca7db1c
--- /dev/null
+++ b/app/templates/result.html
@@ -0,0 +1,7 @@
+{% extends 'base.html' %}
+
+{% block main %}
+ <h2>Successful Form Submission</h2>
+ {% include 'flash_messages.html' %}
+ <p>My name is <strong>{{ firstname + ' ' + lastname }}</strong> and my email address is <strong>{{ email }}</strong>.</p>
+{% endblock %} \ No newline at end of file
diff --git a/app/templates/wtform.html b/app/templates/wtform.html
new file mode 100644
index 0000000..6d9add5
--- /dev/null
+++ b/app/templates/wtform.html
@@ -0,0 +1,20 @@
+{% extends 'base.html' %}
+
+{% block main %}
+ <h2>WTForms in Flask</h2>
+ <p>Here we are using the Flask-WTF library to create and process a form. Flask-WTF also comes with CSRF protection and validation classes.</p>
+ <form method="post" action="{{ url_for('wtform') }}">
+ {% include 'flash_messages.html' %}
+ {{ form.csrf_token }}
+ <div class="form-group">
+ {{ form.firstname.label }} {{ form.firstname(class="form-control") }}
+ </div>
+ <div class="form-group">
+ {{ form.lastname.label }} {{ form.lastname(class="form-control") }}
+ </div>
+ <div class="form-group">
+ {{ form.email.label }} {{ form.email(class="form-control", placeholder="jdoe@example.com") }}
+ </div>
+ <button type="submit" class="btn btn-primary">Submit</button>
+</form>
+{% endblock %} \ No newline at end of file