diff --git a/web/b3desk/__init__.py b/web/b3desk/__init__.py index 7e6c4bf3..1681f750 100644 --- a/web/b3desk/__init__.py +++ b/web/b3desk/__init__.py @@ -169,9 +169,11 @@ def internal_error(error): def setup_endpoints(app): with app.app_context(): - import b3desk.routes + import b3desk.endpoints.public + import b3desk.endpoints.routes - app.register_blueprint(b3desk.routes.bp) + app.register_blueprint(b3desk.endpoints.public.bp) + app.register_blueprint(b3desk.endpoints.routes.bp) def setup_oidc(app): @@ -179,7 +181,7 @@ def setup_oidc(app): from flask_pyoidc.provider_configuration import ProviderConfiguration with app.app_context(): - logout_url = url_for("routes.logout", _external=True) + logout_url = url_for("public.logout", _external=True) user_provider_configuration = ProviderConfiguration( issuer=app.config["OIDC_ISSUER"], diff --git a/web/b3desk/endpoints/__init__.py b/web/b3desk/endpoints/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web/b3desk/endpoints/public.py b/web/b3desk/endpoints/public.py new file mode 100644 index 00000000..9db4d698 --- /dev/null +++ b/web/b3desk/endpoints/public.py @@ -0,0 +1,144 @@ +import requests +from flask import Blueprint +from flask import current_app +from flask import redirect +from flask import render_template +from flask import url_for + +from .. import auth +from .. import cache +from ..session import get_current_user +from ..session import has_user_session +from ..templates.content import FAQ_CONTENT +from .routes import meeting_mailto_params + + +bp = Blueprint("public", __name__) + + +@cache.cached( + timeout=current_app.config["STATS_CACHE_DURATION"], key_prefix="meetings_stats" +) +def get_meetings_stats(): + # TODO: do this asynchroneously + # Currently, the page needs to wait another network request in get_meetings_stats + # before it can be rendered. This is mitigated by caching though. + + if not current_app.config["STATS_URL"]: + return None + + response = requests.get(current_app.config["STATS_URL"]) + if response.status_code != 200: + return None + + try: + stats_array = response.content.decode(encoding="utf-8").split("\n") + stats_array = [row.split(",") for row in stats_array] + participant_count = int(stats_array[current_app.config["STATS_INDEX"]][1]) + running_count = int(stats_array[current_app.config["STATS_INDEX"]][2]) + except Exception: + return None + + result = {"participantCount": participant_count, "runningCount": running_count} + return result + + +@bp.route("/") +def index(): + if has_user_session(): + return redirect(url_for("public.welcome")) + else: + return redirect(url_for("public.home")) + + +@bp.route("/home") +def home(): + if has_user_session(): + return redirect(url_for("public.welcome")) + + stats = get_meetings_stats() + return render_template( + "index.html", + stats=stats, + mail_meeting=current_app.config["MAIL_MEETING"], + max_participants=current_app.config["MAX_PARTICIPANTS"], + ) + + +@bp.route("/welcome") +@auth.oidc_auth("default") +def welcome(): + user = get_current_user() + stats = get_meetings_stats() + + return render_template( + "welcome.html", + stats=stats, + max_participants=current_app.config["MAX_PARTICIPANTS"], + can_create_meetings=user.can_create_meetings, + max_meetings_per_user=current_app.config["MAX_MEETINGS_PER_USER"], + meeting_mailto_params=meeting_mailto_params, + mailto=current_app.config["MAILTO_LINKS"], + quick_meeting=current_app.config["QUICK_MEETING"], + file_sharing=current_app.config["FILE_SHARING"], + clipboard=current_app.config["CLIPBOARD"], + ) + + +@bp.route("/mentions_legales") +def mentions_legales(): + return render_template( + "footer/mentions_legales.html", + service_title=current_app.config["SERVICE_TITLE"], + service_tagline=current_app.config["SERVICE_TAGLINE"], + ) + + +@bp.route("/cgu") +def cgu(): + return render_template( + "footer/cgu.html", + service_title=current_app.config["SERVICE_TITLE"], + service_tagline=current_app.config["SERVICE_TAGLINE"], + ) + + +@bp.route("/donnees_personnelles") +def donnees_personnelles(): + return render_template( + "footer/donnees_personnelles.html", + service_title=current_app.config["SERVICE_TITLE"], + service_tagline=current_app.config["SERVICE_TAGLINE"], + ) + + +@bp.route("/accessibilite") +def accessibilite(): + return render_template( + "footer/accessibilite.html", + service_title=current_app.config["SERVICE_TITLE"], + service_tagline=current_app.config["SERVICE_TAGLINE"], + ) + + +@bp.route("/documentation") +def documentation(): + if current_app.config["DOCUMENTATION_LINK"]["is_external"]: + return redirect(current_app.config["DOCUMENTATION_LINK"]["url"]) + return render_template( + "footer/documentation.html", + ) + + +@bp.route("/logout") +@auth.oidc_logout +def logout(): + return redirect(url_for("public.index")) + + +@bp.route("/faq") +def faq(): + return render_template( + "faq.html", + contents=FAQ_CONTENT, + ) diff --git a/web/b3desk/routes.py b/web/b3desk/endpoints/routes.py similarity index 87% rename from web/b3desk/routes.py rename to web/b3desk/endpoints/routes.py index a3ad5dd9..f8f509c7 100644 --- a/web/b3desk/routes.py +++ b/web/b3desk/endpoints/routes.py @@ -53,15 +53,13 @@ from webdav3.exceptions import WebDavException from werkzeug.utils import secure_filename -from . import auth -from . import cache -from .session import get_authenticated_attendee_fullname -from .session import get_current_user -from .session import has_user_session -from .templates.content import FAQ_CONTENT -from .utils import is_accepted_email -from .utils import is_valid_email -from .utils import send_quick_meeting_mail +from .. import auth +from ..session import get_authenticated_attendee_fullname +from ..session import get_current_user +from ..session import has_user_session +from ..utils import is_accepted_email +from ..utils import is_valid_email +from ..utils import send_quick_meeting_mail bp = Blueprint("routes", __name__) @@ -78,39 +76,12 @@ def meeting_mailto_params(meeting, role): ).replace("\n", "%0D%0A") -@cache.cached( - timeout=current_app.config["STATS_CACHE_DURATION"], key_prefix="meetings_stats" -) -def get_meetings_stats(): - # TODO: do this asynchroneously - # Currently, the page needs to wait another network request in get_meetings_stats - # before it can be rendered. This is mitigated by caching though. - - if not current_app.config["STATS_URL"]: - return None - - response = requests.get(current_app.config["STATS_URL"]) - if response.status_code != 200: - return None - - try: - stats_array = response.content.decode(encoding="utf-8").split("\n") - stats_array = [row.split(",") for row in stats_array] - participant_count = int(stats_array[current_app.config["STATS_INDEX"]][1]) - running_count = int(stats_array[current_app.config["STATS_INDEX"]][2]) - except Exception: - return None - - result = {"participantCount": participant_count, "runningCount": running_count} - return result - - @bp.route("/api/meetings") @auth.token_auth(provider_name="default") def api_meetings(): # TODO: probably unused if not auth.current_token_identity: - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) info = { "given_name": auth.current_token_identity["given_name"], @@ -179,101 +150,6 @@ def insertDocuments(meeting): return jsonify(status=200, msg="SUCCESS") -@bp.route("/mentions_legales") -def mentions_legales(): - return render_template( - "footer/mentions_legales.html", - service_title=current_app.config["SERVICE_TITLE"], - service_tagline=current_app.config["SERVICE_TAGLINE"], - ) - - -@bp.route("/cgu") -def cgu(): - return render_template( - "footer/cgu.html", - service_title=current_app.config["SERVICE_TITLE"], - service_tagline=current_app.config["SERVICE_TAGLINE"], - ) - - -@bp.route("/donnees_personnelles") -def donnees_personnelles(): - return render_template( - "footer/donnees_personnelles.html", - service_title=current_app.config["SERVICE_TITLE"], - service_tagline=current_app.config["SERVICE_TAGLINE"], - ) - - -@bp.route("/accessibilite") -def accessibilite(): - return render_template( - "footer/accessibilite.html", - service_title=current_app.config["SERVICE_TITLE"], - service_tagline=current_app.config["SERVICE_TAGLINE"], - ) - - -@bp.route("/documentation") -def documentation(): - if current_app.config["DOCUMENTATION_LINK"]["is_external"]: - return redirect(current_app.config["DOCUMENTATION_LINK"]["url"]) - return render_template( - "footer/documentation.html", - ) - - -@bp.route("/faq") -def faq(): - return render_template( - "faq.html", - contents=FAQ_CONTENT, - ) - - -@bp.route("/") -def index(): - if has_user_session(): - return redirect(url_for("routes.welcome")) - else: - return redirect(url_for("routes.home")) - - -@bp.route("/home") -def home(): - if has_user_session(): - return redirect(url_for("routes.welcome")) - - stats = get_meetings_stats() - return render_template( - "index.html", - stats=stats, - mail_meeting=current_app.config["MAIL_MEETING"], - max_participants=current_app.config["MAX_PARTICIPANTS"], - ) - - -@bp.route("/welcome") -@auth.oidc_auth("default") -def welcome(): - user = get_current_user() - stats = get_meetings_stats() - - return render_template( - "welcome.html", - stats=stats, - max_participants=current_app.config["MAX_PARTICIPANTS"], - can_create_meetings=user.can_create_meetings, - max_meetings_per_user=current_app.config["MAX_MEETINGS_PER_USER"], - meeting_mailto_params=meeting_mailto_params, - mailto=current_app.config["MAILTO_LINKS"], - quick_meeting=current_app.config["QUICK_MEETING"], - file_sharing=current_app.config["FILE_SHARING"], - clipboard=current_app.config["CLIPBOARD"], - ) - - @bp.route("/meeting/mail", methods=["POST"]) def quick_mail_meeting(): #### Almost the same as quick meeting but we do not redirect to join @@ -285,7 +161,7 @@ def quick_mail_meeting(): ), "error_login", ) - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) if not is_accepted_email(email): flash( _( @@ -293,14 +169,14 @@ def quick_mail_meeting(): ), "error_login", ) - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) user = User( id=email ) # this user can probably be removed if we created adock function meeting = get_quick_meeting_from_user_and_random_string(user) send_quick_meeting_mail(meeting, email) flash(_("Vous avez reçu un courriel pour vous connecter"), "success_login") - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) @bp.route("/meeting/quick") @@ -322,7 +198,7 @@ def show_meeting(meeting): _("Vous ne pouvez pas voir cet élément (identifiant incorrect)"), "warning", ) - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) user = get_current_user() if meeting.user_id == user.id: return render_template( @@ -331,7 +207,7 @@ def show_meeting(meeting): meeting=meeting, ) flash(_("Vous ne pouvez pas consulter cet élément"), "warning") - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/recordings/") @@ -347,7 +223,7 @@ def show_meeting_recording(meeting): form=form, ) flash(_("Vous ne pouvez pas consulter cet élément"), "warning") - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting//recordings/", methods=["POST"]) @@ -379,7 +255,7 @@ def update_recording_name(meeting, recording_id): def new_meeting(): user = get_current_user() if not user.can_create_meetings: - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) form = MeetingWithRecordForm() if current_app.config["RECORDING"] else MeetingForm() @@ -409,7 +285,7 @@ def edit_meeting(meeting): recording=current_app.config["RECORDING"], ) flash("Vous ne pouvez pas modifier cet élément", "warning") - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/files/") @@ -444,7 +320,7 @@ def edit_meeting_files(meeting): form=form, ) flash(_("Vous ne pouvez pas modifier cet élément"), "warning") - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/files//") @@ -497,8 +373,8 @@ def download_meeting_files(meeting, file_id=None): "webdav call encountered following exception : %s", exception ) flash("Le fichier ne semble pas accessible", "error") - return redirect(url_for("routes.welcome")) - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/files//toggledownload", methods=["POST"]) @@ -508,14 +384,14 @@ def toggledownload(meeting): data = request.get_json() if user is None: - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) meeting_file = db.session.get(MeetingFiles, data["id"]) if meeting_file is not None and meeting.user_id == user.id: meeting_file.is_downloadable = data["value"] meeting_file.save() return jsonify(status=200, id=data["id"]) - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/files//default", methods=["POST"]) @@ -762,7 +638,7 @@ def add_dropzone_files(meeting): return upload(user, meeting, request.files["dropzoneFiles"]) else: flash("Traitement de requête impossible", "error") - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) # for dropzone chunk file by file validation @@ -847,7 +723,7 @@ def save_meeting(): is_new_meeting = not form.data["id"] if not user.can_create_meetings and is_new_meeting: - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) if not form.validate(): flash("Le formulaire contient des erreurs", "error") @@ -883,7 +759,7 @@ def save_meeting(): meeting=meeting, form=EndMeetingForm(data={"meeting_id": meeting_id}), ) - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/end", methods=["POST"]) @@ -901,7 +777,7 @@ def end_meeting(): f"{current_app.config['WORDING_MEETING'].capitalize()} « {meeting.name} » terminé(e)", "success", ) - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/create/") @@ -911,7 +787,7 @@ def create_meeting(meeting): if meeting.user_id == user.id: meeting.create_bbb() meeting.save() - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) # draft for insertDocument calls to BBB API @@ -977,7 +853,7 @@ def externalUpload(meeting): user = get_current_user() if meeting.is_running() and user is not None and meeting.user_id == user.id: return render_template("meeting/externalUpload.html", meeting=meeting) - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/ncdownload///") @@ -1047,17 +923,17 @@ def signin_mail_meeting(meeting_fake_id, expiration, h): ), "success", ) - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) hash_matches = meeting.get_mail_signin_hash(meeting_fake_id, expiration) == h if not hash_matches: flash(_("Lien invalide"), "error") - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) is_expired = datetime.fromtimestamp(float(expiration)) < datetime.now() if is_expired: flash(_("Lien expiré"), "error") - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) return render_template( "meeting/joinmail.html", @@ -1082,7 +958,7 @@ def signin_meeting(meeting_fake_id, user_id, h): ), "success", ) - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) current_user_id = get_current_user().id if has_user_session() else None role = meeting.get_role(h, current_user_id) @@ -1092,7 +968,7 @@ def signin_meeting(meeting_fake_id, user_id, h): url_for("routes.join_meeting_as_authenticated", meeting_id=meeting_fake_id) ) elif not role: - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) return render_template( "meeting/join.html", @@ -1132,12 +1008,12 @@ def authenticate_then_signin_meeting(meeting_fake_id, user_id, h): def waiting_meeting(meeting_fake_id, user_id, h, fullname="", fullname_suffix=""): meeting = get_meeting_from_meeting_id_and_user_id(meeting_fake_id, user_id) if meeting is None: - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) current_user_id = get_current_user().id if has_user_session() else None role = meeting.get_role(h, current_user_id) if not role: - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) return render_template( "meeting/wait.html", @@ -1155,7 +1031,7 @@ def waiting_meeting(meeting_fake_id, user_id, h, fullname="", fullname_suffix="" def join_meeting(): form = JoinMeetingForm(request.form) if not form.validate(): - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) fullname = form["fullname"].data meeting_fake_id = form["meeting_fake_id"].data @@ -1163,7 +1039,7 @@ def join_meeting(): h = form["h"].data meeting = get_meeting_from_meeting_id_and_user_id(meeting_fake_id, user_id) if meeting is None: - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) current_user_id = get_current_user().id if has_user_session() else None role = meeting.get_role(h, current_user_id) @@ -1171,7 +1047,7 @@ def join_meeting(): if role == "authenticated": fullname = get_authenticated_attendee_fullname() elif not role: - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) return redirect( meeting.get_join_url( @@ -1185,7 +1061,7 @@ def join_mail_meeting(): form = JoinMailMeetingForm(request.form) if not form.validate(): flash("Lien invalide", "error") - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) fullname = form["fullname"].data meeting_fake_id = form["meeting_fake_id"].data @@ -1204,17 +1080,17 @@ def join_mail_meeting(): ), "error", ) - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) hash_matches = meeting.get_mail_signin_hash(meeting_fake_id, expiration) == h if not hash_matches: flash(_("Lien invalide"), "error") - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) is_expired = datetime.fromtimestamp(expiration) < datetime.now() if is_expired: flash(_("Lien expiré"), "error") - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) return redirect(meeting.get_join_url("moderator", fullname, create=True)) @@ -1248,7 +1124,7 @@ def join_meeting_as_role(meeting, role): return redirect(meeting.get_join_url(role, user.fullname, create=True)) else: flash(_("Accès non autorisé"), "error") - return redirect(url_for("routes.index")) + return redirect(url_for("public.index")) @bp.route("/meeting/delete", methods=["POST", "GET"]) @@ -1281,7 +1157,7 @@ def delete_meeting(): flash(_("Élément supprimé"), "success") else: flash(_("Vous ne pouvez pas supprimer cet élément"), "error") - return redirect(url_for("routes.welcome")) + return redirect(url_for("public.welcome")) @bp.route("/meeting/video/delete", methods=["POST"]) @@ -1311,10 +1187,4 @@ def delete_video_meeting(): _("Vous ne pouvez pas supprimer cette enregistrement"), "error", ) - return redirect(url_for("routes.welcome")) - - -@bp.route("/logout") -@auth.oidc_logout -def logout(): - return redirect(url_for("routes.index")) + return redirect(url_for("public.welcome")) diff --git a/web/b3desk/models/meetings.py b/web/b3desk/models/meetings.py index 73a95248..b10b41ac 100644 --- a/web/b3desk/models/meetings.py +++ b/web/b3desk/models/meetings.py @@ -277,7 +277,7 @@ def get_quick_meeting_from_user_and_random_string(user, random_string=None): ], logoutUrl=( current_app.config["QUICK_MEETING_LOGOUT_URL"] - or url_for("routes.index", _external=True) + or url_for("public.index", _external=True) ), ) meeting.fake_id = random_string @@ -323,7 +323,7 @@ def get_mail_meeting(random_string=None): moderatorOnlyMessage=current_app.config["MAIL_MODERATOR_WELCOME_MESSAGE"], logoutUrl=( current_app.config["QUICK_MEETING_LOGOUT_URL"] - or url_for("routes.index", _external=True) + or url_for("public.index", _external=True) ), ) meeting.fake_id = random_string diff --git a/web/b3desk/templates/brand.html b/web/b3desk/templates/brand.html index b82c7d49..291a7451 100644 --- a/web/b3desk/templates/brand.html +++ b/web/b3desk/templates/brand.html @@ -13,7 +13,7 @@ diff --git a/web/b3desk/templates/errors/403.html b/web/b3desk/templates/errors/403.html index ae53bacd..0cd9b355 100644 --- a/web/b3desk/templates/errors/403.html +++ b/web/b3desk/templates/errors/403.html @@ -5,7 +5,7 @@

{% trans %}Erreur 403{% endtrans %}

-

{% trans index_url=url_for("routes.index") %}Vous n’êtes pas autorisé à accéder cette page. Vous pouvez retourner à l’accueil.{% endtrans %}

+

{% trans index_url=url_for("public.index") %}Vous n’êtes pas autorisé à accéder cette page. Vous pouvez retourner à l’accueil.{% endtrans %}

diff --git a/web/b3desk/templates/errors/404.html b/web/b3desk/templates/errors/404.html index 9d450bda..630e4fa4 100644 --- a/web/b3desk/templates/errors/404.html +++ b/web/b3desk/templates/errors/404.html @@ -5,7 +5,7 @@

{% trans %}Erreur 404{% endtrans %}

-

{% trans index_url=url_for("routes.index") %}Cette page n'existe pas. Vous pouvez retourner à l’accueil.{% endtrans %}

+

{% trans index_url=url_for("public.index") %}Cette page n'existe pas. Vous pouvez retourner à l’accueil.{% endtrans %}

diff --git a/web/b3desk/templates/footer.html b/web/b3desk/templates/footer.html index 2e051f33..1f366428 100644 --- a/web/b3desk/templates/footer.html +++ b/web/b3desk/templates/footer.html @@ -46,16 +46,16 @@ diff --git a/web/b3desk/templates/jumbotron.html b/web/b3desk/templates/jumbotron.html index e54bd4cb..81b355b8 100644 --- a/web/b3desk/templates/jumbotron.html +++ b/web/b3desk/templates/jumbotron.html @@ -32,7 +32,7 @@

{% trans %}Vous organisez régulièrement des {{ some_meetings }}{% endtrans %}

{% trans %}Vous êtes agent de l’État, créez un compte pour organiser et conserver vos {{ some_meetings }}.{% endtrans %}

-

{% trans %}Se connecter ou créer un compte{% endtrans %}

+

{% trans %}Se connecter ou créer un compte{% endtrans %}

{% if stats is defined and stats %}

diff --git a/web/b3desk/templates/meeting/end.html b/web/b3desk/templates/meeting/end.html index 3256902a..d9ec1009 100644 --- a/web/b3desk/templates/meeting/end.html +++ b/web/b3desk/templates/meeting/end.html @@ -9,6 +9,6 @@

{{ form.hidden_tag() }} - Patienter jusqu'à la fin {{ of_the_meeting }} + Patienter jusqu'à la fin {{ of_the_meeting }}
{% endblock %} diff --git a/web/b3desk/templates/meeting/files.html b/web/b3desk/templates/meeting/files.html index f4d6d0f0..6439e7d0 100644 --- a/web/b3desk/templates/meeting/files.html +++ b/web/b3desk/templates/meeting/files.html @@ -42,7 +42,7 @@

Gestion des {{ meeting_presentation }}s associées à {{meeting.name }}

@@ -217,7 +217,7 @@

diff --git a/web/b3desk/templates/meeting/jumbotron.html b/web/b3desk/templates/meeting/jumbotron.html index 19b560da..bd82f72c 100644 --- a/web/b3desk/templates/meeting/jumbotron.html +++ b/web/b3desk/templates/meeting/jumbotron.html @@ -4,7 +4,7 @@

{% trans %}Webinaire{% endtrans %} {{ meeting.name {% else %}

{% trans %}Nouveau webinaire{% endtrans %}

{% endif %} - + {% trans %}Retour au tableau de bord{% endtrans %}
diff --git a/web/b3desk/templates/meeting/recordings.html b/web/b3desk/templates/meeting/recordings.html index acc5e425..afea732d 100644 --- a/web/b3desk/templates/meeting/recordings.html +++ b/web/b3desk/templates/meeting/recordings.html @@ -6,7 +6,7 @@ {% block main %}

{% trans meeting_name=meeting.name %}Enregistrements de {{meeting_name }}{% endtrans %}

{% if meeting.is_running() %} @@ -118,7 +118,7 @@

{% endfor %}

{% endblock %} diff --git a/web/b3desk/templates/meeting/submit.html b/web/b3desk/templates/meeting/submit.html index 26fd586a..c1b50bdb 100644 --- a/web/b3desk/templates/meeting/submit.html +++ b/web/b3desk/templates/meeting/submit.html @@ -4,5 +4,5 @@ {% else %} {% endif %} -{% trans %}Annuler{% endtrans %} +{% trans %}Annuler{% endtrans %}
diff --git a/web/b3desk/templates/redirections.html b/web/b3desk/templates/redirections.html index 3721b7ce..e799f9e3 100644 --- a/web/b3desk/templates/redirections.html +++ b/web/b3desk/templates/redirections.html @@ -1,6 +1,6 @@ diff --git a/web/b3desk/templates/rie.html b/web/b3desk/templates/rie.html index 9de11d17..3aba52a5 100644 --- a/web/b3desk/templates/rie.html +++ b/web/b3desk/templates/rie.html @@ -2,6 +2,6 @@ {% endif %} diff --git a/web/b3desk/templates/tools.html b/web/b3desk/templates/tools.html index 40382083..f0265aa2 100644 --- a/web/b3desk/templates/tools.html +++ b/web/b3desk/templates/tools.html @@ -8,7 +8,7 @@
  • - + {% trans %}Modalités d'accès{% endtrans %} @@ -26,7 +26,7 @@
  • {% endif %} -->
  • - +
    {{ user.fullname }}
    {% trans %}se déconnecter{% endtrans %} @@ -35,7 +35,7 @@
  • {% else %}
  • - + {% trans %}S’identifier{% endtrans %} diff --git a/web/b3desk/utils.py b/web/b3desk/utils.py index 3f834040..13790723 100644 --- a/web/b3desk/utils.py +++ b/web/b3desk/utils.py @@ -68,7 +68,7 @@ def send_quick_meeting_mail(meeting, to_email): "meeting/mailto/mail_quick_meeting_body.txt", role="moderator", moderator_mail_signin_url=meeting.get_mail_signin_url(), - welcome_url=url_for("routes.welcome", _external=True), + welcome_url=url_for("public.welcome", _external=True), meeting=meeting, ) msg["Subject"] = str(wordings["meeting_mail_subject"]) diff --git a/web/tests/meeting/test_meeting.py b/web/tests/meeting/test_meeting.py index 119a5ffd..67545ff0 100644 --- a/web/tests/meeting/test_meeting.py +++ b/web/tests/meeting/test_meeting.py @@ -330,7 +330,7 @@ def test_create_without_logout_url_gets_default( def test_create_quick_meeting(client_app, monkeypatch, user, mocker, bbb_response): - from b3desk.routes import get_quick_meeting_from_user_and_random_string + from b3desk.endpoints.routes import get_quick_meeting_from_user_and_random_string mocker.patch("b3desk.tasks.background_upload.delay", return_value=True) monkeypatch.setattr("b3desk.models.users.User.id", 1) diff --git a/web/tests/test_default.py b/web/tests/test_default.py index 2bbc5856..b9754102 100644 --- a/web/tests/test_default.py +++ b/web/tests/test_default.py @@ -53,7 +53,7 @@ def test_home__anonymous_user(client_app, mocker): "participantCount": 123, "runningCount": 33, } - mocker.patch("b3desk.routes.get_meetings_stats", return_value=STATS) + mocker.patch("b3desk.endpoints.public.get_meetings_stats", return_value=STATS) response = client_app.get( "/home", extra_environ={"REMOTE_ADDR": "127.0.0.1"}, status=200 @@ -67,13 +67,13 @@ def test_home__authenticated_user(client_app, mocker, authenticated_user): "participantCount": 123, "runningCount": 33, } - mocker.patch("b3desk.routes.get_meetings_stats", return_value=STATS) + mocker.patch("b3desk.endpoints.public.get_meetings_stats", return_value=STATS) response = client_app.get( "/home", extra_environ={"REMOTE_ADDR": "127.0.0.1"}, status=302 ) - assert response.location == url_for("routes.welcome") + assert response.location == url_for("public.welcome") def test_change_language(app):