clea up code and layout
This commit is contained in:
@@ -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
8
app/tools/load_css.py
Normal 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)
|
||||
Reference in New Issue
Block a user