diff --git a/config.ini b/config.ini index b7ee3c7..f8a090e 100644 --- a/config.ini +++ b/config.ini @@ -5,6 +5,7 @@ base_url = https://ab.21x9.org timezone = Europe/Berlin mail = abgame@21x9.org separator_char = ; +theme = dark [i18n] lang = de diff --git a/game.py b/game.py index 2fd1d6d..ed62bf3 100755 --- a/game.py +++ b/game.py @@ -63,7 +63,6 @@ def log_the_request(response): def hello(): lang = config.get('i18n', 'lang') title = config.get('i18n', 'title') - mail = config.get('main', 'mail') more = config.get('i18n', 'more') desc = config.get('i18n', 'desc') questions_prefix = config.get('i18n', 'questions_prefix') @@ -71,7 +70,9 @@ def hello(): send_questions = config.get('i18n', 'send_questions') separator = config.get('i18n', 'separator') separator_char = config.get('main', 'separator_char') + mail = config.get('main', 'mail') url = config.get('main', 'base_url') + theme = config.get('main', 'theme') ablines = [] now = datetime.now(tz=tz) @@ -93,7 +94,7 @@ def hello(): with open("ab.txt", "r") as f: num_lines = sum(1 for _ in f) - return render_template('index.html', title=title, separator=separator, content=ablines, num_lines=num_lines, epoch=epoch, mailto=mail, more=more, questions_prefix=questions_prefix, questions_suffix=questions_suffix, send_questions=send_questions, lang=lang, url=url, desc=desc) + return render_template('index.html', title=title, separator=separator, content=ablines, num_lines=num_lines, epoch=epoch, mailto=mail, more=more, questions_prefix=questions_prefix, questions_suffix=questions_suffix, send_questions=send_questions, lang=lang, url=url, desc=desc, theme=theme) def getContent(): lines = [a.strip() for a in open("ab.txt", "r").readlines()] diff --git a/templates/index.html b/templates/index.html index 9f991de..747ff57 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,6 +3,9 @@ {{ title }} + {%- if theme == "dark" %} + + {%- endif %}