From aa2f789fa5f82fb64b137d54edc9796a18c68c86 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 27 Apr 2019 17:29:35 +0200 Subject: [PATCH] messages and more --- dirkules/config.py | 2 + dirkules/static/css/myStyle.css | 5 +++ dirkules/templates/cleaning.html | 65 ++++++++++++++++++++++++++------ dirkules/views.py | 11 +++++- 4 files changed, 70 insertions(+), 13 deletions(-) diff --git a/dirkules/config.py b/dirkules/config.py index 6aec82e..c965d26 100644 --- a/dirkules/config.py +++ b/dirkules/config.py @@ -19,3 +19,5 @@ SCHEDULER_EXECUTORS = {'default': {'type': 'threadpool', 'max_workers': 3}} SCHEDULER_JOB_DEFAULTS = {'coalesce': False, 'max_instances': 1} SCHEDULER_API_ENABLED = True + +SECRET_KEY = b'gf3iz3V!R3@Ny!ri' \ No newline at end of file diff --git a/dirkules/static/css/myStyle.css b/dirkules/static/css/myStyle.css index 88f4426..b3ae250 100644 --- a/dirkules/static/css/myStyle.css +++ b/dirkules/static/css/myStyle.css @@ -14,6 +14,7 @@ body { .tablebox { width: 50%; margin: auto; + padding-bottom: 1em; } .ui.mymenu.menu { @@ -21,6 +22,10 @@ body { color: #fff; } +.buttonspace { + padding-bottom: 0.5em; +} + /*fonts*/ t1 { diff --git a/dirkules/templates/cleaning.html b/dirkules/templates/cleaning.html index 86c6759..83d0c1c 100644 --- a/dirkules/templates/cleaning.html +++ b/dirkules/templates/cleaning.html @@ -1,15 +1,32 @@ {% extends "base.html" %} -{% block title %}Dashboard{% endblock %} +{% block title %}Cleaning{% endblock %} {% block head %} {{ super() }} {% endblock %} {% block body %} -
- -
- Ordner hinzufügen + {% with messages = get_flashed_messages() %} + {% if messages %} + + {% endif %} + {% endwith %} +
+ +
+ Job hinzufügen +
+
@@ -24,14 +41,38 @@ {% for element in elements %} - - - - - - + + + + + + + + {% endfor %}
{{ element.state }}{{ element.name }}{{ element.path }}{{ element.time }}
{{ element.state }}{{ element.name }}{{ element.path }}{{ element.time }} + + +
+ Status ändern +
+
+
+ {% endblock %} diff --git a/dirkules/views.py b/dirkules/views.py index 1ad7771..46b921a 100644 --- a/dirkules/views.py +++ b/dirkules/views.py @@ -1,4 +1,4 @@ -from flask import Flask, render_template, redirect, request, url_for +from flask import Flask, render_template, redirect, request, url_for, flash from dirkules import app import dirkules.driveManagement.driveController as drico import dirkules.serviceManagement.serviceManager as servMan @@ -38,6 +38,15 @@ def partitions(part): @app.route('/cleaning', methods=['GET']) def cleaning(): + remove = request.args.get('remove') + changestate = request.args.get('changestate') + if not(remove is not None and changestate is not None): + if remove is not None: + print("remove") + elif changestate is not None: + print("change") + else: + flash("Auswahl nicht eindeutig!") elements = [] for element in Cleaning.query.order_by(asc(Cleaning.name)).all(): elements.append(viewManager.db_object_as_dict(element))