diff --git a/src/stacosys/interface/templates/admin_en.html b/src/stacosys/interface/templates/admin_en.html
new file mode 100644
index 0000000..59c8f19
--- /dev/null
+++ b/src/stacosys/interface/templates/admin_en.html
@@ -0,0 +1,64 @@
+
+
+
+
+
+Stacosys Comment Moderation
+
+
+
+
+ Comment Moderation
+
+
+
+ {% with messages = get_flashed_messages() %}
+ {% if messages %}
+
+ {% for message in messages %}
+ {{ message }}
+ {% endfor %}
+
+ {% endif %}
+ {% endwith %}
+
+
+
+ Date |
+ Author |
+ Comment |
+ Article |
+ Actions |
+
+
+
+ {% for comment in comments %}
+
+ {{ comment.created }} |
+ {{ comment.author_name }} |
+ {{ comment.content }} |
+ {{ comment.url }} |
+
+
+
+ |
+
+ {% endfor %}
+
+
+
+
+
+
diff --git a/src/stacosys/interface/templates/login_en.html b/src/stacosys/interface/templates/login_en.html
new file mode 100644
index 0000000..6d81754
--- /dev/null
+++ b/src/stacosys/interface/templates/login_en.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+Stacosys
+
+
+
+
+
+ Comment Moderation Login
+
+
+ {% with messages = get_flashed_messages() %}
+ {% if messages %}
+
+ {% for message in messages %}
+ {{ message }}
+ {% endfor %}
+
+ {% endif %}
+ {% endwith %}
+
+
+
+
+
diff --git a/src/stacosys/interface/web/admin.py b/src/stacosys/interface/web/admin.py
index 64aa3da..9e35d50 100644
--- a/src/stacosys/interface/web/admin.py
+++ b/src/stacosys/interface/web/admin.py
@@ -37,8 +37,10 @@ def login():
if is_login_ok(username, password):
session["user"] = username
return redirect("/web/admin")
- # TODO localization
- flash("Identifiant ou mot de passe incorrect")
+ if app.config["CONFIG"].get(ConfigParameter.LANG) == "fr":
+ flash("Identifiant ou mot de passe incorrect")
+ else:
+ flash("Username or password incorrect")
return redirect("/web/login")
# GET
return render_template(
@@ -49,6 +51,10 @@ def login():
@app.route("/web/logout", methods=["GET"])
def logout():
session.pop("user")
+ if app.config["CONFIG"].get(ConfigParameter.LANG) == "fr":
+ flash("Vous avez été déconnecté.")
+ else:
+ flash("You have been logged out.")
return redirect("/web/admin")
@@ -58,8 +64,6 @@ def admin_homepage():
"user" in session
and session["user"] == app.config["CONFIG"].get(ConfigParameter.WEB_USERNAME)
):
- # TODO localization
- flash("Vous avez été déconnecté.")
return redirect("/web/login")
comments = dao.find_not_published_comments()
@@ -74,15 +78,21 @@ def admin_homepage():
def admin_action():
comment = dao.find_comment_by_id(request.form.get("comment"))
if comment is None:
- # TODO localization
- flash("Commentaire introuvable")
+ if app.config["CONFIG"].get(ConfigParameter.LANG) == "fr":
+ flash("Commentaire introuvable")
+ else:
+ flash("Comment not found.")
elif request.form.get("action") == "APPROVE":
dao.publish_comment(comment)
app.config["RSS"].generate()
- # TODO localization
- flash("Commentaire publié")
+ if app.config["CONFIG"].get(ConfigParameter.LANG) == "fr":
+ flash("Commentaire publié")
+ else:
+ flash("Comment published.")
else:
dao.delete_comment(comment)
- # TODO localization
- flash("Commentaire supprimé")
+ if app.config["CONFIG"].get(ConfigParameter.LANG) == "fr":
+ flash("Commentaire supprimé")
+ else:
+ flash("Comment deleted.")
return redirect("/web/admin")