draft web admin page
This commit is contained in:
parent
9352ca665d
commit
52b962b0c6
4 changed files with 72 additions and 1 deletions
3
run.py
3
run.py
|
@ -14,6 +14,7 @@ from stacosys.core.mailer import Mailer
|
||||||
from stacosys.interface import app
|
from stacosys.interface import app
|
||||||
from stacosys.interface import api
|
from stacosys.interface import api
|
||||||
from stacosys.interface import form
|
from stacosys.interface import form
|
||||||
|
from stacosys.interface import webadmin
|
||||||
from stacosys.interface import scheduler
|
from stacosys.interface import scheduler
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@ def stacosys_server(config_pathname):
|
||||||
|
|
||||||
# inject config parameters into flask
|
# inject config parameters into flask
|
||||||
app.config.update(SITE_REDIRECT=conf.get(ConfigParameter.SITE_REDIRECT))
|
app.config.update(SITE_REDIRECT=conf.get(ConfigParameter.SITE_REDIRECT))
|
||||||
logger.info(f"start interfaces {api} {form}")
|
logger.info(f"start interfaces {api} {form} {webadmin}")
|
||||||
|
|
||||||
# start Flask
|
# start Flask
|
||||||
app.run(
|
app.run(
|
||||||
|
|
|
@ -11,6 +11,7 @@ class Template(Enum):
|
||||||
NEW_COMMENT = "new_comment"
|
NEW_COMMENT = "new_comment"
|
||||||
NOTIFY_MESSAGE = "notify_message"
|
NOTIFY_MESSAGE = "notify_message"
|
||||||
RSS_TITLE_MESSAGE = "rss_title_message"
|
RSS_TITLE_MESSAGE = "rss_title_message"
|
||||||
|
WEB_COMMENT_APPROVAL = "web_comment_approval"
|
||||||
|
|
||||||
|
|
||||||
class Templater:
|
class Templater:
|
||||||
|
|
28
stacosys/interface/webadmin.py
Normal file
28
stacosys/interface/webadmin.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
from stacosys.core.templater import Templater, Template
|
||||||
|
|
||||||
|
from flask import jsonify, request
|
||||||
|
from flask import render_template
|
||||||
|
|
||||||
|
from stacosys.db import dao
|
||||||
|
from stacosys.interface import app
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
current_path = os.path.dirname(__file__)
|
||||||
|
template_path = os.path.abspath(os.path.join(current_path, "../templates"))
|
||||||
|
templater = Templater(template_path)
|
||||||
|
|
||||||
|
@app.route("/web/comment", methods=["GET"])
|
||||||
|
def web_comment_approval():
|
||||||
|
lang = "fr"
|
||||||
|
return templater.get_template(lang, Template.WEB_COMMENT_APPROVAL).render(
|
||||||
|
name="Yax")
|
||||||
|
|
||||||
|
|
||||||
|
|
41
stacosys/templates/fr/web_comment_approval.tpl
Normal file
41
stacosys/templates/fr/web_comment_approval.tpl
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en-US">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Stacosys</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>Modération des commentaires</h1>
|
||||||
|
<!--p>cette page permet d'accepter ou rejeter un commentaire</p-->
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Auteur</th>
|
||||||
|
<th>Commentaire</th>
|
||||||
|
<th>Article</th>
|
||||||
|
<th>Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Gégé</td>
|
||||||
|
<td>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/).</td>
|
||||||
|
<td>/2019/refonte-complete-du-blog/</td>
|
||||||
|
<td>
|
||||||
|
<button>Accepter</button>
|
||||||
|
<button>Rejeter</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
<p>Cette page a été conçue par Yax avec <a href="https://simplecss.org">Simple.css</a>.</p>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Reference in a new issue