diff options
| author | Fuwn <[email protected]> | 2023-07-25 01:58:43 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-07-25 01:58:43 -0700 |
| commit | 59a475a252b4a1f72fdb4063da9e0a44bc2fadf9 (patch) | |
| tree | b137dee057508f3145fcd270e407e2ecef76ca0e /src/due/html.py | |
| parent | feat(html): close manga by default (diff) | |
| download | old.due.moe-59a475a252b4a1f72fdb4063da9e0a44bc2fadf9.tar.xz old.due.moe-59a475a252b4a1f72fdb4063da9e0a44bc2fadf9.zip | |
feat(due): make message hideable
Diffstat (limited to 'src/due/html.py')
| -rw-r--r-- | src/due/html.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/due/html.py b/src/due/html.py index d746fef..af22e64 100644 --- a/src/due/html.py +++ b/src/due/html.py @@ -1,6 +1,7 @@ import requests import joblib from due.cache import cache +from flask import request def anime_to_html(releasing_outdated_anime): @@ -134,6 +135,11 @@ def manga_to_html(releasing_outdated_manga): def page(main_content, footer): + message = '<blockquote>Slow loads? If your media hasn\'t been cached in a while, the first load will take a couple seconds longer than the rest. Subsequent requests on cached media should be faster. <a href="/?hide_message">Hide <i>forever</i></a></blockquote>' + + if request.cookies.get("hide_message") == "1": + message = "" + return f""" <!DOCTYPE html> <html> @@ -160,7 +166,7 @@ def page(main_content, footer): <p>{footer}</p> - <blockquote>Slow loads? If your media hasn't been cached in a while, the first load will take a couple seconds longer than the rest. Subsequent requests on cached media should be faster.</blockquote> + {message} </body> </html> """ |