From d20017680bf6e8dfd2e4bcd69654a545f9a8350c Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 16 Sep 2020 23:51:21 +0530 Subject: [PATCH] added active link for all pages to navbar added dropdowns removed starter files removed sentry completely --- app/__init__.py | 11 ------ app/templates/about.html | 2 +- app/templates/base.html | 49 ++++++++++++++++++--------- app/templates/display_photo.html | 7 ---- app/templates/display_result.html | 8 ----- app/templates/dock_upload.html | 2 +- app/templates/dock_upload_single.html | 2 +- app/templates/generate.html | 2 +- app/templates/home.html | 1 + app/templates/job_status.html | 2 ++ app/templates/molecule_editor.html | 2 +- app/templates/pdbqt_form.html | 2 +- app/templates/search-pubchem.html | 2 +- app/templates/search.html | 2 +- app/templates/visualise.html | 2 +- app/templates/wtform.html | 20 ----------- app/views.py | 34 ------------------- requirements.txt | 1 - 18 files changed, 45 insertions(+), 106 deletions(-) delete mode 100644 app/templates/display_photo.html delete mode 100644 app/templates/display_result.html delete mode 100644 app/templates/wtform.html diff --git a/app/__init__.py b/app/__init__.py index 7f09da5..dd2f7ff 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,16 +1,5 @@ from flask import Flask -import sentry_sdk -from sentry_sdk.integrations.flask import FlaskIntegration - -""" -sentry_sdk.init( - dsn="https://7bc9916920c041479b69db97bdb279fa@o126149.ingest.sentry.io/5424142", - integrations=[FlaskIntegration()], - traces_sample_rate=1.0 -) -""" - import configparser config = configparser.ConfigParser() config.read('config.ini') diff --git a/app/templates/about.html b/app/templates/about.html index b61bfed..c360003 100644 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "about" %} {% block main %}

About Curie Web

Curie Web is a web interface for my private Python Library called "Curie", with some aditional superpowers.

diff --git a/app/templates/base.html b/app/templates/base.html index 2e79a61..f92d59d 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -23,30 +23,47 @@ diff --git a/app/templates/display_photo.html b/app/templates/display_photo.html deleted file mode 100644 index 413e2e1..0000000 --- a/app/templates/display_photo.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'base.html' %} - -{% block main %} -

Description: {{ description }}

-

Succesfuly Submitted

- -{% endblock %} \ No newline at end of file diff --git a/app/templates/display_result.html b/app/templates/display_result.html deleted file mode 100644 index 0174637..0000000 --- a/app/templates/display_result.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends 'base.html' %} - -{% block main %} -

Job ID: {{ job }}

-

Succesfuly Submitted

- Description: {{description}} - -{% endblock %} \ No newline at end of file diff --git a/app/templates/dock_upload.html b/app/templates/dock_upload.html index 26f1e99..43dcd63 100644 --- a/app/templates/dock_upload.html +++ b/app/templates/dock_upload.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "dock" %} {% block main %}

Enter Your Configuration

diff --git a/app/templates/dock_upload_single.html b/app/templates/dock_upload_single.html index 882675c..5329972 100644 --- a/app/templates/dock_upload_single.html +++ b/app/templates/dock_upload_single.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "dock" %} {% block main %}

Enter Your Configuration

diff --git a/app/templates/generate.html b/app/templates/generate.html index 629a2a3..7e6808d 100644 --- a/app/templates/generate.html +++ b/app/templates/generate.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "generate" %} {% block main %}

Curie Generate

The model {{expName}} has been trained for {{epochs}} epochs using the {{optimizer}} optimization algorithm. Option for finetuning coming soon.

diff --git a/app/templates/home.html b/app/templates/home.html index 14b5f71..1f7f9e5 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -1,4 +1,5 @@ {% extends 'base.html' %} +{% set active_page = "home" %} {% block main %}

Curie Web Demo

diff --git a/app/templates/job_status.html b/app/templates/job_status.html index 97ce9b3..446d46a 100644 --- a/app/templates/job_status.html +++ b/app/templates/job_status.html @@ -1,5 +1,7 @@ {% extends 'base.html' %} +{% set active_page = "job_status" %} + {% block main %}

Job ID: {{ ID }}

Submitted On: {{subDate}}
diff --git a/app/templates/molecule_editor.html b/app/templates/molecule_editor.html index 22d8481..2a8eab3 100644 --- a/app/templates/molecule_editor.html +++ b/app/templates/molecule_editor.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "tool" %} {% block main %}

Molecule Editor

diff --git a/app/templates/pdbqt_form.html b/app/templates/pdbqt_form.html index 09cd1b0..af1bb37 100644 --- a/app/templates/pdbqt_form.html +++ b/app/templates/pdbqt_form.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} - +{% set active_page = "tool" %} {% block main %}

Generate PDBQTs

diff --git a/app/templates/search-pubchem.html b/app/templates/search-pubchem.html index 9b8e7cb..d9f0c2b 100644 --- a/app/templates/search-pubchem.html +++ b/app/templates/search-pubchem.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "search" %} {% block main %}

SMILES Search

Get Compound SMILES through PubChem.

diff --git a/app/templates/search.html b/app/templates/search.html index 1faf151..b2cdfdc 100644 --- a/app/templates/search.html +++ b/app/templates/search.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "search" %} {% block main %}

Curie Search

Search PubMed articles.

diff --git a/app/templates/visualise.html b/app/templates/visualise.html index 67c3a1c..f1bb068 100644 --- a/app/templates/visualise.html +++ b/app/templates/visualise.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} - +{% set active_page = "tool" %} {% block main %}

Curie Visualise

placeholder uwu

diff --git a/app/templates/wtform.html b/app/templates/wtform.html deleted file mode 100644 index 6d9add5..0000000 --- a/app/templates/wtform.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html' %} - -{% block main %} -

WTForms in Flask

-

Here we are using the Flask-WTF library to create and process a form. Flask-WTF also comes with CSRF protection and validation classes.

- - {% include 'flash_messages.html' %} - {{ form.csrf_token }} -
- {{ form.firstname.label }} {{ form.firstname(class="form-control") }} -
-
- {{ form.lastname.label }} {{ form.lastname(class="form-control") }} -
-
- {{ form.email.label }} {{ form.email(class="form-control", placeholder="jdoe@example.com") }} -
- -
-{% endblock %} \ No newline at end of file diff --git a/app/views.py b/app/views.py index 142229b..fc1620b 100644 --- a/app/views.py +++ b/app/views.py @@ -152,37 +152,6 @@ def status(): flash_errors(taskStatusForm) return render_template('job_status_form.html',form=taskStatusForm) -@app.route('/basic-form', methods=['GET', 'POST']) -def basic_form(): - if request.method == 'POST': - firstname = request.form['firstname'] - lastname = request.form['lastname'] - email = request.form['email'] - - return render_template('result.html', - firstname=firstname, - lastname=lastname, - email=email) - - return render_template('form.html') - -@app.route('/wtform', methods=['GET', 'POST']) -def wtform(): - myform = MyForm() - - if request.method == 'POST': - if myform.validate_on_submit(): - # Note the difference when retrieving form data using Flask-WTF - # Here we use myform.firstname.data instead of request.form['firstname'] - firstname = myform.firstname.data - lastname = myform.lastname.data - email = myform.email.data - - flash('You have successfully filled out the form', 'success') - return render_template('result.html', firstname=firstname, lastname=lastname, email=email) - - flash_errors(myform) - return render_template('wtform.html', form=myform) @app.route('/PDBQTs',methods=['GET','POST']) def generate_pdbqts(): @@ -406,9 +375,6 @@ def send_text_file(file_name): file_dot_text = file_name + '.txt' return app.send_static_file(file_dot_text) -@app.route('/debug-sentry') -def trigger_error(): - division_by_zero = 1 / 0 @app.after_request def add_header(response): diff --git a/requirements.txt b/requirements.txt index 5534700..af8a46b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,5 +25,4 @@ wget lifelines scikit-plot pymed -sentry-sdk[flask] logzero