From ac7541ce29545156f10a0f6dde08914380c632f2 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Tue, 22 Oct 2024 23:35:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=BE=20=D0=BC=D0=B5=D0=BD=D1=8E=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Queries/requests.py | 12 ++++++++++++ App/Queries/templates/sklad_zapros.html | 5 +++++ App/Queries/templates/zapros_menu.html | 16 ++++++++++++++++ App/Queries/zapros_menu.json | 3 +++ 4 files changed, 36 insertions(+) create mode 100644 App/Queries/templates/zapros_menu.html create mode 100644 App/Queries/zapros_menu.json diff --git a/App/Queries/requests.py b/App/Queries/requests.py index 6f06fd6..20c0eee 100644 --- a/App/Queries/requests.py +++ b/App/Queries/requests.py @@ -3,12 +3,24 @@ from os import path from Database.sql_provider import SQLProvider from checker import check_auth from .requests_route import route +import json + +with open(path.join(path.dirname(__file__), 'zapros_menu.json')) as f: + options = json.load(f) sql_provider = SQLProvider(path.join(path.dirname(__file__), 'sql')) requests_bp = Blueprint('requests_bp', __name__, template_folder='templates') @requests_bp.route('/', methods=['GET', 'POST']) @check_auth +def requests(): + if request.method == 'GET': + return render_template('zapros_menu.html', options=options) + else: + return 'error' + +@requests_bp.route('/req1', methods=['GET', 'POST']) +@check_auth def sklad_zapros(): if request.method == 'GET': zagotovki = route(session['db_config'], {}, sql_provider, 'zagotovki.sql') diff --git a/App/Queries/templates/sklad_zapros.html b/App/Queries/templates/sklad_zapros.html index 70ca9ad..6b40da3 100644 --- a/App/Queries/templates/sklad_zapros.html +++ b/App/Queries/templates/sklad_zapros.html @@ -19,6 +19,7 @@ {% else %} + {% if items %}

Заготовки на складе

@@ -36,7 +37,11 @@ {% endfor %}
+ {% else %} +

Заготовок нет

{% endif %} + {% endif %} + diff --git a/App/Queries/templates/zapros_menu.html b/App/Queries/templates/zapros_menu.html new file mode 100644 index 0000000..b9d1c8d --- /dev/null +++ b/App/Queries/templates/zapros_menu.html @@ -0,0 +1,16 @@ + + + + + Запросы + + +

Выберите вариант запроса

+ Выход + + + \ No newline at end of file diff --git a/App/Queries/zapros_menu.json b/App/Queries/zapros_menu.json new file mode 100644 index 0000000..ad205d9 --- /dev/null +++ b/App/Queries/zapros_menu.json @@ -0,0 +1,3 @@ +[ + {"name": "Материалы заготовок", "url": "requests_bp.sklad_zapros"} +] \ No newline at end of file