Add accent color, email subjects, MD+DOCX outputs, update README
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

This commit is contained in:
admin
2026-06-14 15:49:11 +00:00
parent dc20e9cff0
commit 63cd620b79
11 changed files with 205 additions and 54 deletions
+38 -5
View File
@@ -83,11 +83,12 @@ def create_app():
header_path = layout_cfg.get("header", "/app/src/misc/header.html")
footer_path = layout_cfg.get("footer", "/app/src/misc/footer.html")
# Configurable title and logo URL via environment
# Configurable title, logo URL, and accent color via environment
webui_title = os.getenv("WEBUI_TITLE", "A.P.Strom Transcription")
logo_url = os.getenv("WEBUI_LOGO_URL", "https://apstrom.ca")
accent_color = os.getenv("EMAIL_ACCENT_COLOR", "#7C6DA0")
# Prepare header HTML with logo URL
# Prepare header HTML with logo URL and accent color
header_html = ""
if os.path.exists(header_path):
header_html = load_html_template(
@@ -95,15 +96,17 @@ def create_app():
webui_title=webui_title,
header_logo_url=logo_url,
header_logo_src=logo_url,
accent_color=accent_color,
)
# Prepare footer HTML
# Prepare footer HTML with accent color
footer_html = ""
if os.path.exists(footer_path):
version = os.getenv("SCRABIE_VERSION", "0.1.1.dev")
footer_html = load_html_template(
footer_path,
footer_scraibe_webui_version=version,
accent_color=accent_color,
)
# Build Gradio interface
@@ -248,14 +251,44 @@ def create_app():
outputs=[status_text],
)
# Launch options
# Launch options with accent color applied via CSS
server_name = launch_cfg.get("server_name", os.getenv("GRADIO_SERVER_NAME", "0.0.0.0"))
server_port = launch_cfg.get("server_port", 7860)
accent_css = f"""
:root {{
--primary-accent: {accent_color};
}}
button.primary,
.primary,
.gradio-button-primary,
.gradio-container button.primary {{
background-color: var(--primary-accent) !important;
border-color: var(--primary-accent) !important;
}}
button.primary:hover,
.primary:hover,
.gradio-button-primary:hover {{
background-color: var(--primary-accent) !important;
opacity: 0.95;
}}
.radio-item.selected,
.radio-item.selected label {{
color: var(--primary-accent) !important;
}}
a,
.gradio-container a {{
color: var(--primary-accent) !important;
}}
body {{
font-family: Arial, sans-serif;
}}
"""
app.launch(
server_name=str(server_name),
server_port=int(server_port),
css="body { font-family: Arial, sans-serif; }",
css=accent_css,
)