clea up code and layout

This commit is contained in:
knedlik
2025-12-10 22:52:22 +01:00
parent 7f21716358
commit e2091ec677
11 changed files with 211 additions and 86 deletions

View File

View File

@@ -1,27 +0,0 @@
import streamlit as st
from auth_runtime import require_login
from auth import get_sidebar, get_fullname_for_user, get_role_for_user
def check(df, page_name):
if "df_sidebar" not in st.session_state:
# authenticator = require_login()
username = st.session_state.get("username")
role_text = get_role_for_user(username)
fullname = get_fullname_for_user(username)
df = get_sidebar(role_text, username)
st.session_state["role_text"] = role_text
st.session_state["fullname"] = fullname
st.session_state["df_sidebar"] = df
if df is None or df.empty:
return False # oder True je nach gewünschtem Verhalten
allowed = not df[
(df["dash_type"] == "page") &
(df["page_file"] == page_name)
].empty
return True

8
app/tools/load_css.py Normal file
View File

@@ -0,0 +1,8 @@
import streamlit as st
from pathlib import Path
def load_css():
css_path = Path(__file__).parent.parent / ".streamlit" / "style.css"
if css_path.exists():
st.markdown(f"<style>{css_path.read_text()}</style>", unsafe_allow_html=True)