diff --git a/app/routes/account/account.py b/app/routes/account/account.py index 72c3c07..a4479ec 100644 --- a/app/routes/account/account.py +++ b/app/routes/account/account.py @@ -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 s’est inscrit ! Il s’agit de {BOLD}{m.name}{BOLD}.") return redirect(url_for('login')) diff --git a/app/routes/forum/index.py b/app/routes/forum/index.py index 6747ac1..944f95a 100644 --- a/app/routes/forum/index.py +++ b/app/routes/forum/index.py @@ -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 diff --git a/app/routes/forum/topic.py b/app/routes/forum/topic.py index e369a48..8b98cf5 100644 --- a/app/routes/forum/topic.py +++ b/app/routes/forum/topic.py @@ -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))) diff --git a/app/routes/programs/program.py b/app/routes/programs/program.py index 3a96ef3..0673fd3 100644 --- a/app/routes/programs/program.py +++ b/app/routes/programs/program.py @@ -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))) diff --git a/app/routes/programs/submit.py b/app/routes/programs/submit.py index f67ba14..0bcdf0e 100644 --- a/app/routes/programs/submit.py +++ b/app/routes/programs/submit.py @@ -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) diff --git a/app/utils/glados.py b/app/utils/glados.py index 978fdf0..0bd1419 100644 --- a/app/utils/glados.py +++ b/app/utils/glados.py @@ -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}")