From 7684e48ccb2cbeec297dc04d833ece98322ed42a Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Tue, 2 Mar 2021 14:09:59 +0100 Subject: [PATCH 1/2] VC/Zoom: Add option to show phone join link --- vc_zoom/README.md | 1 + vc_zoom/indico_vc_zoom/plugin.py | 11 ++++++++--- vc_zoom/indico_vc_zoom/templates/info_box.html | 11 +++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/vc_zoom/README.md b/vc_zoom/README.md index de652aa..8ea4084 100644 --- a/vc_zoom/README.md +++ b/vc_zoom/README.md @@ -16,6 +16,7 @@ - Fix deleting Zoom meetings that were already deleted on the Zoom side when running outside a web request context (e.g. during scheduled deletion of events) - Fix overwriting co-hosts added via the Zoom client when using "make me co-host" in Indico - Always refresh data from Zoom before editing via Indico to avoid saving with stale data +- Add option to link to an external page with phone-in instructions ### 2.3b2 diff --git a/vc_zoom/indico_vc_zoom/plugin.py b/vc_zoom/indico_vc_zoom/plugin.py index b59cf4d..4929191 100644 --- a/vc_zoom/indico_vc_zoom/plugin.py +++ b/vc_zoom/indico_vc_zoom/plugin.py @@ -13,8 +13,9 @@ from requests.exceptions import HTTPError from sqlalchemy.orm.attributes import flag_modified from wtforms.fields import TextAreaField from wtforms.fields.core import BooleanField +from wtforms.fields.html5 import URLField from wtforms.fields.simple import StringField -from wtforms.validators import DataRequired, ValidationError +from wtforms.validators import DataRequired, Optional, URL, ValidationError from indico.core import signals from indico.core.auth import multipass @@ -45,7 +46,7 @@ class PluginSettingsForm(VCPluginSettingsFormBase): _fieldsets = [ (_('API Credentials'), ['api_key', 'api_secret', 'webhook_token']), (_('Zoom Account'), ['user_lookup_mode', 'email_domains', 'authenticators', 'enterprise_domain', - 'allow_webinars']), + 'allow_webinars', 'phone_link']), (_('Room Settings'), ['mute_audio', 'mute_host_video', 'mute_participant_video', 'join_before_host', 'waiting_room']), (_('Notifications'), ['creation_email_footer', 'send_host_url', 'notification_emails']), @@ -114,6 +115,9 @@ class PluginSettingsForm(VCPluginSettingsFormBase): description=_('Whether to send an e-mail with the Host URL to the meeting host upon ' 'creation of a meeting')) + phone_link = URLField(_('Join via phone'), [Optional(), URL()], + description=_('Link to the list of VidyoVoice phone numbers')) + def validate_authenticators(self, field): invalid = set(field.data) - set(multipass.identity_providers) if invalid: @@ -145,7 +149,8 @@ class ZoomPlugin(VCPluginMixin, IndicoPlugin): 'join_before_host': True, 'waiting_room': False, 'creation_email_footer': None, - 'send_host_url': False + 'send_host_url': False, + 'phone_link': '', }) def init(self): diff --git a/vc_zoom/indico_vc_zoom/templates/info_box.html b/vc_zoom/indico_vc_zoom/templates/info_box.html index 08ed536..6a8e671 100644 --- a/vc_zoom/indico_vc_zoom/templates/info_box.html +++ b/vc_zoom/indico_vc_zoom/templates/info_box.html @@ -1,6 +1,7 @@ {% from '_clipboard_input.html' import clipboard_input %} {% set host = vc_room.data.host %} {% set alt_hosts = vc_room.data.alternative_hosts %} +{% set phone_link = settings.get('phone_link') %}
{% trans %}Zoom Meeting ID{% endtrans %}
{{ vc_room.data.zoom_id }}
@@ -37,4 +38,14 @@ {{ clipboard_input(vc_room.data.url, name="vc-room-url-%s"|format(event_vc_room.id)) }} {% endif %} + {% if phone_link %} +
+ {% trans %}Useful links{% endtrans %} +
+
+ + {% trans %}Join via phone{% endtrans %} + +
+ {% endif %}
From 23eed33eb327ce5afed93788cf457bb729eb48f0 Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Tue, 2 Mar 2021 14:13:18 +0100 Subject: [PATCH 2/2] VC/Zoom: Fix zoom URL display in info box We were never showing it due to checking an undefined variable. We now always show it, but only include the passcode if the passcode is also visible to the user. --- vc_zoom/README.md | 1 + .../indico_vc_zoom/templates/info_box.html | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/vc_zoom/README.md b/vc_zoom/README.md index 8ea4084..69577ce 100644 --- a/vc_zoom/README.md +++ b/vc_zoom/README.md @@ -17,6 +17,7 @@ - Fix overwriting co-hosts added via the Zoom client when using "make me co-host" in Indico - Always refresh data from Zoom before editing via Indico to avoid saving with stale data - Add option to link to an external page with phone-in instructions +- Fix showing the zoom join link in the info box ### 2.3b2 diff --git a/vc_zoom/indico_vc_zoom/templates/info_box.html b/vc_zoom/indico_vc_zoom/templates/info_box.html index 6a8e671..d034908 100644 --- a/vc_zoom/indico_vc_zoom/templates/info_box.html +++ b/vc_zoom/indico_vc_zoom/templates/info_box.html @@ -2,6 +2,12 @@ {% set host = vc_room.data.host %} {% set alt_hosts = vc_room.data.alternative_hosts %} {% set phone_link = settings.get('phone_link') %} +{% set passcode_visible = ( + event_vc_room.data.password_visibility == 'everyone' or + event_vc_room.event.can_manage(session.user) or + (session.user and event_vc_room.data.password_visibility == 'logged_in') or + (session.user and event_vc_room.data.password_visibility == 'registered' and event_vc_room.event.is_user_registered(session.user)) +) %}
{% trans %}Zoom Meeting ID{% endtrans %}
{{ vc_room.data.zoom_id }}
@@ -25,19 +31,10 @@ {{ alt_hosts | map('decodeprincipal') | map(attribute='full_name') | join(', ') }} {% endif %} - {% if event_vc_room.data.password_visibility == 'everyone' or - event_vc_room.event.can_manage(session.user) or - (session.user and event_vc_room.data.password_visibility == 'logged_in') or - (session.user and event_vc_room.data.password_visibility == 'registered' and event_vc_room.event.is_user_registered(session.user)) %} + {% if passcode_visible %}
{% trans %}Passcode{% endtrans %}
{{ vc_room.data.password }}
{% endif %} - {% if event_vc_room.data.show_autojoin %} -
{% trans %}Zoom URL{% endtrans %}
-
- {{ clipboard_input(vc_room.data.url, name="vc-room-url-%s"|format(event_vc_room.id)) }} -
- {% endif %} {% if phone_link %}
{% trans %}Useful links{% endtrans %} @@ -48,4 +45,9 @@ {% endif %} +
{% trans %}Zoom URL{% endtrans %}
+
+ {{ clipboard_input(vc_room.data.url if passcode_visible else vc_room.data.public_url, + name="vc-room-url-%s"|format(event_vc_room.id)) }} +