Доп оформление запросов

This commit is contained in:
Anton Kamalov
2024-10-24 11:03:19 +03:00
parent bd45f9c068
commit f2730d85d4
2 changed files with 7 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ from .requests_route import route
import json
with open(path.join(path.dirname(__file__), 'zapros_menu.json')) as f:
options = json.load(f)
requests_list = json.load(f)
sql_provider = SQLProvider(path.join(path.dirname(__file__), 'sql'))
requests_bp = Blueprint('requests_bp', __name__, template_folder='templates')
@@ -15,7 +15,7 @@ requests_bp = Blueprint('requests_bp', __name__, template_folder='templates')
@check_auth
def requests():
if request.method == 'GET':
return render_template('zapros_menu.html', options=options)
return render_template('zapros_menu.html', options=requests_list)
else:
return 'error'
@@ -33,6 +33,6 @@ def sklad_zapros():
zagotovki = route(session['db_config'], material, sql_provider, 'zapros1.sql')
if zagotovki.status:
categories = ['Материал', 'Вес', 'Цена', 'Количество']
return render_template('output.html', items=zagotovki.result, categories = categories)
return render_template('output.html', items=zagotovki.result, titles = categories, object='Заготовки на складе')
else:
return zagotovki.error_message

View File

@@ -2,19 +2,19 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Заготовки на складе</title>
<title>{{ object }}</title>
<link href="/static/css/main.css" type="text/css" rel="stylesheet">
</head>
<body>
<div class="logout">
<a href="{{ url_for('logout') }}"><button>Выход</button></a>
</div>
<h1>Заготовки на складе</h1>
<h1>{{ object }}</h1>
<!-- Output -->
<table>
<tr>
{% for category in categories %}
<th>{{ category }}</th>
{% for title in titles %}
<th>{{ title }}</th>
{% endfor %}
</tr>
{% for item in items %}