From ea6ccae76abcfce330f0cf130afa0e70bcc69af9 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Mon, 12 Oct 2020 13:28:19 +0200 Subject: [PATCH] Merge content into main package --- web/app/__init__.py | 2 -- web/app/content/__init__.py | 5 ---- web/app/content/views.py | 14 ----------- web/app/main/views.py | 25 ++++++++----------- web/app/templates/content/news_launch.html.j2 | 25 ------------------- .../about_and_faq.html.j2} | 2 +- web/app/templates/main/news.html.j2 | 15 +++++++++++ web/app/templates/nopaque.html.j2 | 8 +++--- 8 files changed, 30 insertions(+), 66 deletions(-) delete mode 100644 web/app/content/__init__.py delete mode 100644 web/app/content/views.py delete mode 100644 web/app/templates/content/news_launch.html.j2 rename web/app/templates/{content/about_faq.html.j2 => main/about_and_faq.html.j2} (99%) create mode 100644 web/app/templates/main/news.html.j2 diff --git a/web/app/__init__.py b/web/app/__init__.py index 64674f34..0588b334 100644 --- a/web/app/__init__.py +++ b/web/app/__init__.py @@ -34,8 +34,6 @@ def create_app(): app.register_blueprint(admin_blueprint, url_prefix='/admin') from .auth import auth as auth_blueprint app.register_blueprint(auth_blueprint, url_prefix='/auth') - from .content import content as content_blueprint - app.register_blueprint(content_blueprint, url_prefix='/content') from .corpora import corpora as corpora_blueprint app.register_blueprint(corpora_blueprint, url_prefix='/corpora') from .errors import errors as errors_blueprint diff --git a/web/app/content/__init__.py b/web/app/content/__init__.py deleted file mode 100644 index e15fadf1..00000000 --- a/web/app/content/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from flask import Blueprint - - -content = Blueprint('content', __name__) -from . import views # noqa \ No newline at end of file diff --git a/web/app/content/views.py b/web/app/content/views.py deleted file mode 100644 index 12565266..00000000 --- a/web/app/content/views.py +++ /dev/null @@ -1,14 +0,0 @@ -from flask import render_template -from . import content - - -@content.route('/about_faq') -def about_faq(): - return render_template('content/about_faq.html.j2', - title='About Nopaqe and FAQ') - - -@content.route('/news_launch') -def news_launch(): - return render_template('content/news_launch.html.j2', - title='') \ No newline at end of file diff --git a/web/app/main/views.py b/web/app/main/views.py index eefb3043..fcc0ed5d 100644 --- a/web/app/main/views.py +++ b/web/app/main/views.py @@ -20,25 +20,21 @@ def index(): title='nopaque') +@main.route('/about_and_faq') +def about_and_faq(): + return render_template('main/about_and_faq.html.j2', title='About and faq') + + @main.route('/dashboard') @login_required def dashboard(): return render_template('main/dashboard.html.j2', title='Dashboard') -@main.route('/poster', methods=['GET', 'POST']) -def poster(): - login_form = LoginForm(prefix='login-form') - if login_form.validate_on_submit(): - user = User.query.filter_by(username=login_form.user.data).first() - if user is None: - user = User.query.filter_by(email=login_form.user.data).first() - if user is not None and user.verify_password(login_form.password.data): - login_user(user, login_form.remember_me.data) - return redirect(url_for('main.dashboard')) - flash('Invalid email/username or password.') - return render_template('main/poster.html.j2', login_form=login_form, - title='Poster') + +@main.route('/news') +def news(): + return render_template('main/news.html.j2', title='News') @main.route('/privacy_policy') @@ -51,4 +47,5 @@ def privacy_policy(): @main.route('/terms_of_use') def terms_of_use(): return render_template('main/terms_of_use.html.j2', - title='General Terms of Use of the platform nopaque') # noqa + title='General Terms of Use of the platform ' + 'nopaque') diff --git a/web/app/templates/content/news_launch.html.j2 b/web/app/templates/content/news_launch.html.j2 deleted file mode 100644 index d2b24257..00000000 --- a/web/app/templates/content/news_launch.html.j2 +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "nopaque.html.j2" %} - -{% block page_content %} - -
-
-
- Beta Launch of nopaque! -

- Dear users -

-
-

- A few days ago we went live with nopaque. Right now nopaque is still in - its Beta phase. So some bugs are to be expected. If you encounter any - bugs or some feature is not working as expected please send as an email - using the feedback button at the botton of the page in the footer! -

-

We are happy to help you with any issues and will use the feedback to - fix all mentioned bugs!

-
-
-
- -{% endblock %} \ No newline at end of file diff --git a/web/app/templates/content/about_faq.html.j2 b/web/app/templates/main/about_and_faq.html.j2 similarity index 99% rename from web/app/templates/content/about_faq.html.j2 rename to web/app/templates/main/about_and_faq.html.j2 index a971e4c9..c3b2ee76 100644 --- a/web/app/templates/content/about_faq.html.j2 +++ b/web/app/templates/main/about_and_faq.html.j2 @@ -256,4 +256,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/app/templates/main/news.html.j2 b/web/app/templates/main/news.html.j2 new file mode 100644 index 00000000..f6ed5ba4 --- /dev/null +++ b/web/app/templates/main/news.html.j2 @@ -0,0 +1,15 @@ +{% extends "nopaque.html.j2" %} + +{% block page_content %} +
+
+
+ nopaque's beta launch +

Dear users

+
+

A few days ago we went live with nopaque. Right now nopaque is still in its Beta phase. So some bugs are to be expected. If you encounter any bugs or some feature is not working as expected please send as an email using the feedback button at the botton of the page in the footer!

+

We are happy to help you with any issues and will use the feedback to fix all mentioned bugs!

+
+
+
+{% endblock %} diff --git a/web/app/templates/nopaque.html.j2 b/web/app/templates/nopaque.html.j2 index 2fb7f3f4..aa8540c9 100644 --- a/web/app/templates/nopaque.html.j2 +++ b/web/app/templates/nopaque.html.j2 @@ -147,9 +147,7 @@