2 Commits
+32 -23
View File
@@ -76,11 +76,18 @@ with col1:
st.warning("Keine .xlsx-Dateien im input/-Ordner gefunden.")
selected_input = None
else:
selected_input = st.selectbox(
"Input-Datei wählen:",
options=[""] + input_files,
format_func=lambda x: "– Bitte wählen –" if x == "" else x,
)
# Bei nur einer Datei: automatisch selektieren (keine Leerauswahl)
if len(input_files) == 1:
selected_input = st.selectbox(
"Input-Datei wählen:",
options=input_files,
)
else:
selected_input = st.selectbox(
"Input-Datei wählen:",
options=[""] + input_files,
format_func=lambda x: "– Bitte wählen –" if x == "" else x,
)
if selected_input:
input_path = Path(app_config.input_dir) / selected_input
@@ -157,11 +164,18 @@ with col2:
real_templates = [t for t in template_files if not t.startswith("~")]
if not real_templates:
real_templates = template_files
selected_template = st.selectbox(
"Template wählen:",
options=[""] + real_templates,
format_func=lambda x: "– Bitte wählen –" if x == "" else x,
)
# Bei nur einem Template: automatisch selektieren (keine Leerauswahl)
if len(real_templates) == 1:
selected_template = st.selectbox(
"Template wählen:",
options=real_templates,
)
else:
selected_template = st.selectbox(
"Template wählen:",
options=[""] + real_templates,
format_func=lambda x: "– Bitte wählen –" if x == "" else x,
)
if selected_template:
# Nur validieren wenn sich das Template geändert hat
@@ -219,19 +233,14 @@ if st.session_state.input_validated and st.session_state.parsed_records:
st.session_state[f"sel_{emp}"] = False
# Mitarbeiter-Liste mit Rahmen
st.markdown(
'<div style="border:1px solid #d5d5d5; border-radius:6px; padding:8px 12px; '
'background:#fafafa; max-height:300px; overflow-y:auto">',
unsafe_allow_html=True,
)
selected_employees = []
for emp in employees:
key = f"sel_{emp}"
if key not in st.session_state:
st.session_state[key] = True
if st.checkbox(emp, value=st.session_state[key], key=key):
selected_employees.append(emp)
st.markdown("</div>", unsafe_allow_html=True)
with st.container(border=True):
selected_employees = []
for emp in employees:
key = f"sel_{emp}"
if key not in st.session_state:
st.session_state[key] = True
if st.checkbox(emp, value=st.session_state[key], key=key):
selected_employees.append(emp)
st.caption(f"{len(selected_employees)} von {len(employees)} Mitarbeitern ausgewählt")
else: