admin panel layout

This commit is contained in:
Bkolb 2026-04-02 18:20:38 +02:00
parent d6a8406c08
commit bdbf364457
6 changed files with 75 additions and 12 deletions

View File

@ -15,16 +15,16 @@ from flask import (
)
from werkzeug.security import check_password_hash, generate_password_hash
from .config import Config
from .db import get_connection, fetchone_dict, fetchall_dict
from .auth import login_required
from .permissions import is_video_allowed_for_level
from .logging_config import setup_logging
from .security import (
from config import Config
from db import get_connection, fetchone_dict, fetchall_dict
from auth import login_required
from permissions import is_video_allowed_for_level
from security import (
admin_required,
get_current_user,
get_current_user_mandant_level,
)
from logging_config import setup_logging
app = Flask(__name__)
app.config.from_object(Config)

View File

@ -1,7 +1,7 @@
from functools import wraps
from flask import session, redirect, url_for, request, abort
from .db import get_connection
from db import get_connection
def get_current_user_mandant_level():

View File

@ -171,14 +171,28 @@ p {
}
.btn-danger {
display: inline-flex;
align-items: center;
justify-content: center;
height: 48px;
padding: 0 20px;
border-radius: 12px;
font-weight: 700;
text-decoration: none;
box-sizing: border-box;
background: #b62323;
color: #fff;
border: none;
border: 1px solid #b62323;
cursor: pointer;
}
.btn-small {
height: 40px;
min-width: 100px;
padding: 0 16px;
font-size: 14px;
border-radius: 10px;
}
/* =========================
@ -261,7 +275,48 @@ p {
gap: 16px;
margin-top: 16px;
}
/* =========================
ADMIN FORM LAYOUT
========================= */
.admin-grid-form {
display: grid;
grid-template-columns: 200px minmax(320px, 1fr);
gap: 14px 20px;
align-items: center;
max-width: 760px;
}
.admin-grid-form .form-row {
display: contents;
}
.admin-grid-form label {
margin: 0;
font-weight: 700;
color: #0d2f57;
}
.admin-grid-form input[type="text"],
.admin-grid-form input[type="email"],
.admin-grid-form input[type="number"] {
width: 100%;
min-height: 46px;
padding: 10px 12px;
border: 1px solid #cfd8e3;
border-radius: 10px;
font-size: 16px;
box-sizing: border-box;
}
.form-row-full {
grid-column: 1 / -1;
margin-top: 8px;
}
.table-actions .btn-primary,
.table-actions .btn-danger {
min-width: 110px;
}
/* =========================
10. TABLES
========================= */

View File

@ -2,4 +2,12 @@ import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, BASE_DIR)
APP_DIR = os.path.join(BASE_DIR, "app")
if APP_DIR not in sys.path:
sys.path.insert(0, APP_DIR)
if BASE_DIR not in sys.path:
sys.path.insert(0, BASE_DIR)
os.environ["LOG_DIR"] = "./logs"

View File

@ -1,4 +1,4 @@
import pytest
import os
os.environ["DB_HOST"] = "192.168.0.10"
@ -9,6 +9,7 @@ os.environ["DB_PORT"] = "55432"
os.environ["LOG_DIR"] = "./logs"
from app.app import app
import pytest
@pytest.fixture

View File

@ -1,5 +1,4 @@
from app.permissions import is_video_allowed_for_level
from permissions import is_video_allowed_for_level
def test_level_0_sees_everything():
assert is_video_allowed_for_level("A1.mp4", 0) is True