From 9c36ed3cc8a7815e1936a00fdfd6cdc39bbbdfe6 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch <pjentsch@sfb1288inf-Notebook.fritz.box> Date: Wed, 28 Oct 2020 15:34:12 +0100 Subject: [PATCH] Some finetuning --- web/app/admin/views.py | 4 +- .../{_constants.html.j2 => _colors.html.j2} | 2 +- web/app/templates/nopaque.html.j2 | 82 +++++++++---------- .../services/corpus_analysis.html.j2 | 6 +- web/app/templates/services/file-setup.html.j2 | 8 +- web/app/templates/services/nlp.html.j2 | 8 +- web/app/templates/services/ocr.html.j2 | 8 +- 7 files changed, 59 insertions(+), 59 deletions(-) rename web/app/templates/{_constants.html.j2 => _colors.html.j2} (94%) diff --git a/web/app/admin/views.py b/web/app/admin/views.py index ce16c390..d06c856a 100644 --- a/web/app/admin/views.py +++ b/web/app/admin/views.py @@ -27,7 +27,7 @@ def users(): @admin_required def user(user_id): user = User.query.get_or_404(user_id) - return render_template('admin/user.html.j2', title='Edit user', user=user) + return render_template('admin/user.html.j2', title='User', user=user) @admin.route('/users/<int:user_id>/delete') @@ -36,7 +36,7 @@ def user(user_id): def delete_user(user_id): settings_tasks.delete_user(user_id) flash('User has been deleted!') - return redirect(url_for('admin.index')) + return redirect(url_for('.users')) @admin.route('/users/<int:user_id>/edit_general_settings', diff --git a/web/app/templates/_constants.html.j2 b/web/app/templates/_colors.html.j2 similarity index 94% rename from web/app/templates/_constants.html.j2 rename to web/app/templates/_colors.html.j2 index a14fd135..be667210 100644 --- a/web/app/templates/_constants.html.j2 +++ b/web/app/templates/_colors.html.j2 @@ -1,4 +1,4 @@ -{% set COLORS = {'primary': '#00426f', +{% set colors = {'primary': '#00426f', 'secondary': '#1A5C89', 'footer': '#b1b3b4', 'corpus_analysis': '#aa9cc9', diff --git a/web/app/templates/nopaque.html.j2 b/web/app/templates/nopaque.html.j2 index 7998e2d6..8b49e1a8 100644 --- a/web/app/templates/nopaque.html.j2 +++ b/web/app/templates/nopaque.html.j2 @@ -1,5 +1,5 @@ {% extends "materialize/base.html.j2" %} -{% from '_constants.html.j2' import COLORS %} +{% from '_colors.html.j2' import colors %} {% block html_attribs %} lang="en"{% endblock html_attribs %} @@ -23,46 +23,46 @@ <link href="{{ url_for('static', filename='css/materialize.sticky-footer.css') }}" media="screen,projection" rel="stylesheet"> <link href="{{ url_for('static', filename='css/nopaque.css') }}" media="screen,projection" rel="stylesheet"> <style> - .primary-color {background-color: {{ COLORS.primary }} !important;} - .primary-color-text {color: {{ COLORS.primary }} !important;} - .secondary-color {background-color: {{ COLORS.secondary }} !important;} - .secondary-color-text {color: {{ COLORS.secondary }} !important;} - .footer-color {background-color: {{ COLORS.footer }} !important;} - .footer-color-text {color: {{ COLORS.footer }} !important;} - - .corpus-analysis-color {background-color: {{ COLORS.corpus_analysis }} !important;} - .corpus-analysis-color-text {color: {{ COLORS.corpus_analysis }} !important;} - .corpus-analysis-color.darken {background-color: {{ COLORS.corpus_analysis_darken }} !important;} - .corpus-analysis-color-text.text-darken {color: {{ COLORS.corpus_analysis_darken }} !important;} - .corpus-analysis-color.lighten {background-color: {{ COLORS.corpus_analysis_lighten }} !important;} - .corpus-analysis-color-text.text-lighten {color: {{ COLORS.corpus_analysis_lighten }} !important;} - - .file-setup-color {background-color: {{ COLORS.file_setup }} !important;} - .file-setup-color-text {color: {{ COLORS.file_setup }} !important;} - .file-setup-color.darken {background-color: {{ COLORS.file_setup_darken }} !important;} - .file-setup-color-text.text-darken {color: {{ COLORS.file_setup_darken }} !important;} - .file-setup-color.lighten {background-color: {{ COLORS.file_setup_lighten }} !important;} - .file-setup-color-text.text-lighten {color: {{ COLORS.file_setup_lighten }} !important;} - - .ocr-color {background-color: {{ COLORS.ocr }} !important;} - .ocr-color-text {color: {{ COLORS.ocr }} !important;} - .ocr-color.darken {background-color: {{ COLORS.ocr_darken }} !important;} - .ocr-color-text.text-darken {color: {{ COLORS.ocr_darken }} !important;} - .ocr-color.lighten {background-color: {{ COLORS.ocr_lighten }} !important;} - .ocr-color-text.text-lighten {color: {{ COLORS.ocr_lighten }} !important;} - - .nlp-color {background-color: {{ COLORS.nlp }} !important;} - .nlp-color-text {color: {{ COLORS.nlp }} !important;} - .nlp-color.darken {background-color: {{ COLORS.nlp_darken }} !important;} - .nlp-color-text.text-darken {color: {{ COLORS.nlp_darken }} !important;} - .nlp-color.lighten {background-color: {{ COLORS.nlp_lighten }} !important;} - .nlp-color-text.text-lighten {color: {{ COLORS.nlp_lighten }} !important;} + .primary-color {background-color: {{ colors.primary }} !important;} + .primary-color-text {color: {{ colors.primary }} !important;} + .secondary-color {background-color: {{ colors.secondary }} !important;} + .secondary-color-text {color: {{ colors.secondary }} !important;} + .footer-color {background-color: {{ colors.footer }} !important;} + .footer-color-text {color: {{ colors.footer }} !important;} + + .corpus-analysis-color {background-color: {{ colors.corpus_analysis }} !important;} + .corpus-analysis-color-text {color: {{ colors.corpus_analysis }} !important;} + .corpus-analysis-color.darken {background-color: {{ colors.corpus_analysis_darken }} !important;} + .corpus-analysis-color-text.text-darken {color: {{ colors.corpus_analysis_darken }} !important;} + .corpus-analysis-color.lighten {background-color: {{ colors.corpus_analysis_lighten }} !important;} + .corpus-analysis-color-text.text-lighten {color: {{ colors.corpus_analysis_lighten }} !important;} + + .file-setup-color {background-color: {{ colors.file_setup }} !important;} + .file-setup-color-text {color: {{ colors.file_setup }} !important;} + .file-setup-color.darken {background-color: {{ colors.file_setup_darken }} !important;} + .file-setup-color-text.text-darken {color: {{ colors.file_setup_darken }} !important;} + .file-setup-color.lighten {background-color: {{ colors.file_setup_lighten }} !important;} + .file-setup-color-text.text-lighten {color: {{ colors.file_setup_lighten }} !important;} + + .ocr-color {background-color: {{ colors.ocr }} !important;} + .ocr-color-text {color: {{ colors.ocr }} !important;} + .ocr-color.darken {background-color: {{ colors.ocr_darken }} !important;} + .ocr-color-text.text-darken {color: {{ colors.ocr_darken }} !important;} + .ocr-color.lighten {background-color: {{ colors.ocr_lighten }} !important;} + .ocr-color-text.text-lighten {color: {{ colors.ocr_lighten }} !important;} + + .nlp-color {background-color: {{ colors.nlp }} !important;} + .nlp-color-text {color: {{ colors.nlp }} !important;} + .nlp-color.darken {background-color: {{ colors.nlp_darken }} !important;} + .nlp-color-text.text-darken {color: {{ colors.nlp_darken }} !important;} + .nlp-color.lighten {background-color: {{ colors.nlp_lighten }} !important;} + .nlp-color-text.text-lighten {color: {{ colors.nlp_lighten }} !important;} {% if scheme_primary_color is not defined %} - {% set scheme_primary_color = COLORS.primary %} + {% set scheme_primary_color = colors.primary %} {% endif %} {% if scheme_secondary_color is not defined %} - {% set scheme_secondary_color = COLORS.secondary %} + {% set scheme_secondary_color = colors.secondary %} {% endif %} main .btn, main .btn-small, main .btn-large, main .btn-floating {background-color: {{ scheme_primary_color }};} main .btn:hover, main .btn-large:hover, main .btn-small:hover, main .btn-floating:hover {background-color: {{ scheme_secondary_color }};} @@ -130,10 +130,10 @@ <li><a href="{{ url_for('main.dashboard', _anchor='jobs') }}" style="padding-left: 47px;"><i class="material-icons">work</i>My Jobs</a></li> <li><div class="divider"></div></li> <li><a class="subheader">Processes & Services</a></li> - <li style="background-color: {{ COLORS.file_setup }}; border-left: 10px solid {{ COLORS.file_setup_darken }};"><a href="{{ url_for('services.service', service='file-setup') }}"><i class="material-icons">burst_mode</i>File setup</a></li> - <li style="background-color: {{ COLORS.ocr }}; border-left: 10px solid {{ COLORS.ocr_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='ocr') }}"><i class="material-icons">find_in_page</i>OCR</a></li> - <li style="background-color: {{ COLORS.nlp }}; border-left: 10px solid {{ COLORS.nlp_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='nlp') }}"><i class="material-icons">format_textdirection_l_to_r</i>NLP</a></li> - <li style="background-color: {{ COLORS.corpus_analysis }}; border-left: 10px solid {{ COLORS.corpus_analysis_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='corpus_analysis') }}"><i class="material-icons">search</i>Corpus analysis</a></li> + <li style="background-color: {{ colors.file_setup }}; border-left: 10px solid {{ colors.file_setup_darken }};"><a href="{{ url_for('services.service', service='file-setup') }}"><i class="material-icons">burst_mode</i>File setup</a></li> + <li style="background-color: {{ colors.ocr }}; border-left: 10px solid {{ colors.ocr_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='ocr') }}"><i class="material-icons">find_in_page</i>OCR</a></li> + <li style="background-color: {{ colors.nlp }}; border-left: 10px solid {{ colors.nlp_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='nlp') }}"><i class="material-icons">format_textdirection_l_to_r</i>NLP</a></li> + <li style="background-color: {{ colors.corpus_analysis }}; border-left: 10px solid {{ colors.corpus_analysis_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='corpus_analysis') }}"><i class="material-icons">search</i>Corpus analysis</a></li> <li><div class="divider"></div></li> <li><a class="subheader">Account</a></li> <li><a href="{{ url_for('settings.index') }}"><i class="material-icons">settings</i>Settings</a></li> diff --git a/web/app/templates/services/corpus_analysis.html.j2 b/web/app/templates/services/corpus_analysis.html.j2 index 4fa11f6a..ef9c941d 100644 --- a/web/app/templates/services/corpus_analysis.html.j2 +++ b/web/app/templates/services/corpus_analysis.html.j2 @@ -1,8 +1,8 @@ {% extends "nopaque.html.j2" %} -{% from '_constants.html.j2' import COLORS %} +{% from '_colors.html.j2' import colors %} -{% set scheme_primary_color = COLORS.corpus_analysis_darken %} -{% set scheme_secondary_color = COLORS.corpus_analysis %} +{% set scheme_primary_color = colors.corpus_analysis_darken %} +{% set scheme_secondary_color = colors.corpus_analysis %} {% block nav_content %} {% include 'services/_nav_content.html.j2' %} diff --git a/web/app/templates/services/file-setup.html.j2 b/web/app/templates/services/file-setup.html.j2 index 69ecce8d..35e5424b 100644 --- a/web/app/templates/services/file-setup.html.j2 +++ b/web/app/templates/services/file-setup.html.j2 @@ -1,9 +1,9 @@ {% extends "nopaque.html.j2" %} {% import 'materialize/wtf.html.j2' as wtf %} -{% from '_constants.html.j2' import COLORS %} +{% from '_colors.html.j2' import colors %} -{% set scheme_primary_color = COLORS.file_setup_darken %} -{% set scheme_secondary_color = COLORS.file_setup %} +{% set scheme_primary_color = colors.file_setup_darken %} +{% set scheme_secondary_color = colors.file_setup %} {% block nav_content %} {% include 'services/_nav_content.html.j2' %} @@ -30,7 +30,7 @@ </div> <div class="col s12 m9 pull-m3"> - <div class="card" style="border-top: 10px solid {{ COLORS.file_setup_darken }};"> + <div class="card" style="border-top: 10px solid {{ colors.file_setup_darken }};"> <div class="card-content"> <div class="row"> <div class="col s12"> diff --git a/web/app/templates/services/nlp.html.j2 b/web/app/templates/services/nlp.html.j2 index 89109a96..8b7ab342 100644 --- a/web/app/templates/services/nlp.html.j2 +++ b/web/app/templates/services/nlp.html.j2 @@ -1,9 +1,9 @@ {% extends "nopaque.html.j2" %} {% import 'materialize/wtf.html.j2' as wtf %} -{% from '_constants.html.j2' import COLORS %} +{% from '_colors.html.j2' import colors %} -{% set scheme_primary_color = COLORS.nlp_darken %} -{% set scheme_secondary_color = COLORS.nlp %} +{% set scheme_primary_color = colors.nlp_darken %} +{% set scheme_secondary_color = colors.nlp %} {% block nav_content %} {% include 'services/_nav_content.html.j2' %} @@ -30,7 +30,7 @@ </div> <div class="col s12 m9 pull-m3"> - <div class="card" style="border-top: 10px solid {{ COLORS.nlp_darken }};"> + <div class="card" style="border-top: 10px solid {{ colors.nlp_darken }};"> <div class="card-content"> <div class="row"> <div class="col s12 m6"> diff --git a/web/app/templates/services/ocr.html.j2 b/web/app/templates/services/ocr.html.j2 index ec1c9cba..48e7b99c 100644 --- a/web/app/templates/services/ocr.html.j2 +++ b/web/app/templates/services/ocr.html.j2 @@ -1,9 +1,9 @@ {% extends "nopaque.html.j2" %} {% import 'materialize/wtf.html.j2' as wtf %} -{% from '_constants.html.j2' import COLORS %} +{% from '_colors.html.j2' import colors %} -{% set scheme_primary_color = COLORS.ocr_darken %} -{% set scheme_secondary_color = COLORS.ocr %} +{% set scheme_primary_color = colors.ocr_darken %} +{% set scheme_secondary_color = colors.ocr %} {% block nav_content %} {% include 'services/_nav_content.html.j2' %} @@ -30,7 +30,7 @@ </div> <div class="col s12 m9 pull-m3"> - <div class="card" style="border-top: 10px solid {{ COLORS.ocr_darken }};"> + <div class="card" style="border-top: 10px solid {{ colors.ocr_darken }};"> <div class="card-content"> <div class="row"> <div class="col s12"> -- GitLab