glados: add some 'say' messages

This commit is contained in:
Darks 2023-06-11 23:05:03 +02:00 committed by Eragon
parent d05942b660
commit 6b74b6fea6
Signed by: Eragon
GPG Key ID: 087126EBFC725006
6 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,7 @@ from app.models.trophy import Title
from app.utils.render import render
from app.utils.send_mail import send_validation_mail, send_reset_password_mail
from app.utils.priv_required import guest_only
from app.utils.glados import say, BOLD
import app.utils.ldap as ldap
import app.utils.validators as vd
from itsdangerous import URLSafeTimedSerializer
@ -187,4 +188,5 @@ def activate_account(token):
flash("L'email a bien été confirmé", "ok")
app.v5logger.info(f"<{m.name}> has activated their account")
say(f"Un nouveau membre sest inscrit ! Il sagit de {BOLD}{m.name}{BOLD}.")
return redirect(url_for('login'))

View File

@ -74,6 +74,8 @@ def forum_page(f, page=1):
flash('Le sujet a bien été créé', 'ok')
app.v5logger.info(f"<{t.author.name}> has created the topic #{t.id}")
if f.is_default_accessible():
say(f"Nouveau topic de {author.name} : {BOLD}{t.title}{BOLD}")
return redirect(url_for('forum_topic', f=f, page=(t,1)))
# Paginate topic pages

View File

@ -5,6 +5,7 @@ from sqlalchemy import desc
from app import app, db
from config import V5Config
from app.utils.render import render
from app.utils.glados import say, BOLD
from app.forms.forum import CommentForm, AnonymousCommentForm
from app.models.thread import Thread
from app.models.comment import Comment
@ -55,6 +56,8 @@ def forum_topic(f, page):
flash('Message envoyé', 'ok')
app.v5logger.info(f"<{c.author.name}> has posted a the comment #{c.id}")
if f.is_default_accessible():
say(f"Nouveau commentaire de {author.name} sur un topic : {BOLD}{t.title}{BOLD}")
# Redirect to empty the form
return redirect(url_for('forum_topic', f=f, page=(t, "fin"),
_anchor=str(c.id)))

View File

@ -42,6 +42,7 @@ def program_view(page):
flash('Message envoyé', 'ok')
app.v5logger.info(f"<{c.author.name}> has posted a the comment #{c.id}")
say(f"Nouveau commentaire de {author.name} sur un programme: {BOLD}{t.name}{BOLD}")
# Redirect to empty the form
return redirect(url_for('program_view', page=(p, "fin"), _anchor=str(c.id)))

View File

@ -5,6 +5,7 @@ from app.models.comment import Comment
from app.models.tag import Tag
from app.models.attachment import Attachment
from app.utils.render import render
from app.utils.glados import say, BOLD
from app.forms.programs import ProgramCreationForm
from flask_login import login_required, current_user
@ -55,6 +56,7 @@ def program_submit():
flash('Le programme a bien été soumis', 'ok')
app.v5logger.info(f"<{p.author.name}> has submitted the program #{c.id}")
say(f"Nouveau programme de {current_user.name} : {BOLD}{p.name}{BOLD}")
return redirect(url_for('program_index'))
return render('/programs/submit.html', form=form)

View File

@ -36,4 +36,4 @@ def say(msg, channels = ["#general"]):
def new_topic(topic):
""" Example wrapper for glados.say """
say(f"Le topic {BOLD}{topic.title}{BOLD} a été créé")
say(f"Nouveau topic de {topic.author.name}: {BOLD}{topic.title}{BOLD}")