From d5f232255917c88dbc030b070b40ac4fd0da8185 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Tue, 5 Nov 2024 15:50:54 +0300 Subject: [PATCH 1/4] Initial for Waybill blueprint --- App/Waybill/__init__.py | 9 +++++++++ App/Waybill/templates/waybill.html | 10 ++++++++++ App/app.py | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 App/Waybill/__init__.py create mode 100644 App/Waybill/templates/waybill.html diff --git a/App/Waybill/__init__.py b/App/Waybill/__init__.py new file mode 100644 index 0000000..c91ca76 --- /dev/null +++ b/App/Waybill/__init__.py @@ -0,0 +1,9 @@ +from flask import request, Blueprint, render_template, session, current_app, redirect, url_for +from checker import check_auth +waybill_bp = Blueprint('waybill_bp', __name__, template_folder='templates') + +@waybill_bp.route('/', methods=['GET', 'POST']) +@check_auth +def waybill(): + if request.method == 'GET': + return render_template('waybill.html') \ No newline at end of file diff --git a/App/Waybill/templates/waybill.html b/App/Waybill/templates/waybill.html new file mode 100644 index 0000000..f81ea5c --- /dev/null +++ b/App/Waybill/templates/waybill.html @@ -0,0 +1,10 @@ + + + + + Авторизация + + + + +

Заглушка для примера составления накладной

\ No newline at end of file diff --git a/App/app.py b/App/app.py index 2941e4a..38f6a5c 100644 --- a/App/app.py +++ b/App/app.py @@ -1,5 +1,6 @@ from flask import Flask, render_template, session from Requests import requests_bp +from Waybill import waybill_bp from Auth import auth_bp import os, json @@ -13,6 +14,7 @@ app.config.update( app.register_blueprint(requests_bp, url_prefix='/requests') app.register_blueprint(auth_bp, url_prefix='/auth') +app.register_blueprint(waybill_bp, url_prefix='/waybill') @app.route('/') def index(): From 0b11360a9c71e13f6944f20117326b63ddc79736 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Tue, 5 Nov 2024 16:18:18 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=80=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/data/db_access.json | 6 +++--- App/templates/main_menu.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/App/data/db_access.json b/App/data/db_access.json index 89e568d..0adc917 100644 --- a/App/data/db_access.json +++ b/App/data/db_access.json @@ -1,5 +1,5 @@ { - "manager": ["auth_bp", "requests_bp"], - "boss": ["auth_bp", "requests_bp"], - "sellers": ["auth_bp", "requests_bp", "waybill_bp"] + "Менеджер": ["auth_bp", "requests_bp"], + "Управляющий": ["auth_bp", "requests_bp"], + "Поставщик": ["auth_bp", "requests_bp", "waybill_bp"] } \ No newline at end of file diff --git a/App/templates/main_menu.html b/App/templates/main_menu.html index 8e0a049..c007334 100644 --- a/App/templates/main_menu.html +++ b/App/templates/main_menu.html @@ -11,6 +11,7 @@

Здравствуйте, {{ ses['login'] }}!

+

Ваша роль: {{ ses['role'] }}

{% if ses['access_user'] == 'in' %}