from pathlib import Path from typing import List from shiny import App, ui, Inputs, Outputs, Session from shiny.types import NavSetArg from src import mod_welcome from src.util import load_html_str_from_file import os footer_html: str = load_html_str_from_file(os.path.join("www", "footer.html")) def nav_controls() -> List[NavSetArg]: return [ ui.nav(ui.h5("Intro"), mod_welcome.welcome_ui("Intro"), value="intro"), ui.nav(ui.h5("Datensatz Analyse"), "Datensatz Analyse"), ui.nav_control( ui.a( ui.h5("AG-Link"), href="https://ag-link.xyz", target="_blank", ), ), ] app_ui = ui.page_navbar( *nav_controls(), # create gap ---- ui.nav_spacer(), # right hand side ---- ui.nav_menu( "Mehr Infos", ui.nav_control( ui.a( "No G20 Studie", href="https://g20.protestinstitut.eu/", target="_blank", ), ), align="right", ), selected="intro", fluid=False, title=ui.div(ui.img(src="favicon.ico", width="75dpi", height="75dpi"), ui.h3("Copbird")), lang="de", window_title="Copbird", collapsible=True, bg="#ba289f", inverse=True, id="Intro", footer=ui.div(ui.HTML(footer_html), inline=False), ) def server(input: Inputs, output: Outputs, session: Session): mod_welcome.welcome_server("Intro") static_dir = Path(__file__).parent / "www" app = App(app_ui, server, static_assets=static_dir)