From 392c6bc748afd461aa5aa023959bd22ca34b977e Mon Sep 17 00:00:00 2001
From: Yax <1949284+kianby@users.noreply.github.com>
Date: Sun, 30 Jan 2022 19:07:22 +0100
Subject: [PATCH] localize web template
---
run.py | 1 +
stacosys/interface/web/admin.py | 4 +-
.../templates/fr/web_comment_approval.tpl | 41 -------------------
3 files changed, 3 insertions(+), 43 deletions(-)
delete mode 100644 stacosys/templates/fr/web_comment_approval.tpl
diff --git a/run.py b/run.py
index 3608da2..b1b3fa9 100644
--- a/run.py
+++ b/run.py
@@ -107,6 +107,7 @@ def stacosys_server(config_pathname):
# inject config parameters into flask
app.config.update(SITE_REDIRECT=conf.get(ConfigParameter.SITE_REDIRECT))
app.config.update(SITE_URL=conf.get(ConfigParameter.SITE_URL))
+ app.config.update(LANG=conf.get(ConfigParameter.LANG))
logger.info(f"start interfaces {api} {form} {admin}")
# start Flask
diff --git a/stacosys/interface/web/admin.py b/stacosys/interface/web/admin.py
index 29f97f2..df77ba9 100644
--- a/stacosys/interface/web/admin.py
+++ b/stacosys/interface/web/admin.py
@@ -13,9 +13,9 @@ logger = logging.getLogger(__name__)
@app.route("/web", methods=["GET"])
def admin_homepage():
- lang = "fr"
comments = dao.find_not_published_comments()
- return render_template("admin_" + lang + ".html", comments=comments, baseurl=app.config.get("SITE_URL"))
+ return render_template("admin_" + app.config.get("LANG") + ".html", comments=comments,
+ baseurl=app.config.get("SITE_URL"))
@app.route("/web", methods=["POST"])
diff --git a/stacosys/templates/fr/web_comment_approval.tpl b/stacosys/templates/fr/web_comment_approval.tpl
deleted file mode 100644
index 9f16c78..0000000
--- a/stacosys/templates/fr/web_comment_approval.tpl
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-Stacosys
-
-
-
-
- Modération des commentaires
-
-
-
-
-
-
- Auteur
- Commentaire
- Article
- Actions
-
-
-
-
- Gégé
- Merci pour ce commentaire ! Malheureusement je n'ai pas utilisé Isso suffisamment longtemps pour être en capacité de vous aider avec MathJax. Suite à cet [évènement](https://blogduyax.madyanne.fr/2019/je-vous-lavais-bien-dit/) je suis revenu à [mon ancestral système de commentaires](https://blogduyax.madyanne.fr/2020/bilan-hebergement-2020/).
- /2019/refonte-complete-du-blog/
-
- Accepter
- Rejeter
-
-
-
-
-
-
-
-
\ No newline at end of file