automatisch selektieren wenn in Input- oder Template-Ordner nur ein Element/File liegt
This commit is contained in:
1 parent
9a44f8904e
commit
6fda6aea6b
1 file changed
+14
@@ -75,6 +75,13 @@ with col1:
|
|||||||
if not input_files:
|
if not input_files:
|
||||||
st.warning("Keine .xlsx-Dateien im input/-Ordner gefunden.")
|
st.warning("Keine .xlsx-Dateien im input/-Ordner gefunden.")
|
||||||
selected_input = None
|
selected_input = None
|
||||||
|
else:
|
||||||
|
# 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:
|
else:
|
||||||
selected_input = st.selectbox(
|
selected_input = st.selectbox(
|
||||||
"Input-Datei wählen:",
|
"Input-Datei wählen:",
|
||||||
@@ -157,6 +164,13 @@ with col2:
|
|||||||
real_templates = [t for t in template_files if not t.startswith("~")]
|
real_templates = [t for t in template_files if not t.startswith("~")]
|
||||||
if not real_templates:
|
if not real_templates:
|
||||||
real_templates = template_files
|
real_templates = template_files
|
||||||
|
# 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(
|
selected_template = st.selectbox(
|
||||||
"Template wählen:",
|
"Template wählen:",
|
||||||
options=[""] + real_templates,
|
options=[""] + real_templates,
|
||||||
|
|||||||
Reference in new issue
Block a user