diff --git a/data/sidebar.yml b/data/sidebar.yml index 4d052b5..03318ba 100644 --- a/data/sidebar.yml +++ b/data/sidebar.yml @@ -2,6 +2,7 @@ abs_href: "/" icon: fad fa-home active_id: home + has_new_until_utc: 0 - @@ -9,6 +10,7 @@ abs_href: "/articles/" icon: fad fa-newspaper active_id: articles + has_new_until_utc: 0 - @@ -16,31 +18,37 @@ abs_href: "/content/?tags=application;web" icon: fad fa-browser active_id: application + has_new_until_utc: 0 - title_key: text.libraries abs_href: "/content/?tags=library" icon: fad fa-puzzle-piece active_id: library + has_new_until_utc: 0 - title_key: text.electronics abs_href: "/content/?tags=electronic" icon: fad fa-microchip active_id: electronic + has_new_until_utc: 0 - title_key: text.experiments abs_href: "/content/?tags=experiments" icon: fad fa-flask-vial active_id: electronic + has_new_until_utc: 0 - title_key: text.tools abs_href: "/tools" icon: fad fa-toolbox active_id: tools + has_new_until_utc: 0 - title_key: text.downloads raw_href: "https://files.nibblepoker.lu/" icon: fad fa-download active_id: "" + has_new_until_utc: 1760986472 - @@ -48,13 +56,16 @@ abs_href: "/about" icon: fad fa-user active_id: about + has_new_until_utc: 0 - title_key: text.contact abs_href: "/contact" icon: fad fa-mailbox active_id: "" + has_new_until_utc: 0 - title_key: text.links abs_href: "/links" icon: fad fa-link active_id: links + has_new_until_utc: 0 diff --git a/data/strings/en/commons.yml b/data/strings/en/commons.yml index d29aa2b..e9183a0 100644 --- a/data/strings/en/commons.yml +++ b/data/strings/en/commons.yml @@ -21,3 +21,5 @@ user-agent: User-Agent server: Server cpu.architecture: Architecture de CPU + +python: Python diff --git a/data/strings/fr/commons.yml b/data/strings/fr/commons.yml index c50a7af..5c98c95 100644 --- a/data/strings/fr/commons.yml +++ b/data/strings/fr/commons.yml @@ -21,3 +21,5 @@ user-agent: User-Agent server: Serveur cpu.architecture: CPU Architecture + +python: Python diff --git a/data/strings/fr/sidebar.yml b/data/strings/fr/sidebar.yml index b8879e7..e9bd837 100644 --- a/data/strings/fr/sidebar.yml +++ b/data/strings/fr/sidebar.yml @@ -12,7 +12,7 @@ text.libraries: Librairies text.electronics: Électronique text.experiments: Expériences text.3d-print: Impression 3D -text.tools: Outils +text.tools: Utilitaires text.links: Liens text.downloads: Téléchargements text.gitea: Dépôts Git diff --git a/templates/base_www.jinja b/templates/base_www.jinja index 6af4dbb..adebbed 100644 --- a/templates/base_www.jinja +++ b/templates/base_www.jinja @@ -78,6 +78,9 @@
{% else %} diff --git a/website/sidebar.py b/website/sidebar.py index 9007f65..375466e 100644 --- a/website/sidebar.py +++ b/website/sidebar.py @@ -1,4 +1,5 @@ from dataclasses import dataclass, field +from datetime import datetime, timezone from typing import Optional import yaml @@ -9,9 +10,13 @@ class SidebarEntry: title_key: str icon: str active_id: str + has_new_until_utc: int abs_href: Optional[str] = field(default=None) raw_href: Optional[str] = field(default=None) + def has_new(self) -> bool: + return datetime.fromtimestamp(self.has_new_until_utc, tz=timezone.utc) > datetime.now(timezone.utc) + __SIDEBAR_ENTRIES: list[Optional[SidebarEntry]] = list()