diff --git a/app.py b/app.py index b3e66c6..e4b4d6e 100644 --- a/app.py +++ b/app.py @@ -3,6 +3,12 @@ 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]: @@ -31,6 +37,7 @@ app_ui = ui.page_navbar( bg="#ba289f", inverse=True, id="Intro", + footer=ui.div(ui.HTML(footer_html), inline=False), ) diff --git a/src/util.py b/src/util.py new file mode 100644 index 0000000..2c88c17 --- /dev/null +++ b/src/util.py @@ -0,0 +1,11 @@ +import os +import sys + + +def load_html_str_from_file(file_name: str) -> str: + if not os.path.isfile(file_name): + print(f"HTML File {file_name} does not exist!") + sys.exit(1) + + with open(file_name, "r") as f: + return str(f.read()) diff --git a/www/footer.html b/www/footer.html new file mode 100644 index 0000000..d87d9c8 --- /dev/null +++ b/www/footer.html @@ -0,0 +1,62 @@ + + + + + + + + + + + +