Skip to content

Instantly share code, notes, and snippets.

@pferreir
Created February 17, 2015 19:15
Show Gist options
  • Save pferreir/849634eb9bb6368bd817 to your computer and use it in GitHub Desktop.
Save pferreir/849634eb9bb6368bd817 to your computer and use it in GitHub Desktop.
diff --git a/vc_dummy/indico_vc_dummy/plugin.py b/vc_dummy/indico_vc_dummy/plugin.py
index 1b90df9..f6326b5 100644
--- a/vc_dummy/indico_vc_dummy/plugin.py
+++ b/vc_dummy/indico_vc_dummy/plugin.py
@@ -16,8 +16,19 @@
from __future__ import unicode_literals
+from wtforms.fields.core import BooleanField
+
from indico.core.plugins import IndicoPlugin
from indico.modules.vc import VCPluginMixin
+from indico.modules.vc.plugins import VCRoomFormBase
+from indico.util.i18n import _
+from indico.web.forms.widgets import SwitchWidget
+
+
+class VCRoomForm(VCRoomFormBase):
+ show_phone_numbers = BooleanField(_('What is your favorite color?'),
+ widget=SwitchWidget(),
+ description=_("Yes. It doesn't make any sense."))
class DummyPlugin(VCPluginMixin, IndicoPlugin):
@@ -26,6 +37,7 @@ class DummyPlugin(VCPluginMixin, IndicoPlugin):
Dummy Video conferencing plugin
"""
configurable = True
+ vc_room_form = VCRoomForm
@property
def logo_url(self):
diff --git a/vc_vidyo/indico_vc_vidyo/forms.py b/vc_vidyo/indico_vc_vidyo/forms.py
index af7a30d..b78f5d8 100644
--- a/vc_vidyo/indico_vc_vidyo/forms.py
+++ b/vc_vidyo/indico_vc_vidyo/forms.py
@@ -19,7 +19,7 @@ from __future__ import unicode_literals
import re
from wtforms.fields.core import BooleanField, SelectField
-from wtforms.fields.simple import StringField, TextAreaField
+from wtforms.fields.simple import TextAreaField
from wtforms.validators import DataRequired, Length, Regexp, Optional, ValidationError
from indico.modules.vc.models import VCRoom
@@ -30,7 +30,6 @@ from indico.web.forms.fields import PrincipalField, IndicoPasswordField, IndicoR
from indico.web.forms.widgets import SwitchWidget, JinjaWidget
-ROOM_NAME_RE = re.compile(r'[\w\-]+')
PIN_RE = re.compile(r'^\d+$')
ERROR_MSG_PIN = _("The PIN must be a number")
@@ -43,8 +42,6 @@ class VCRoomForm(VCRoomFormBase):
conditional_fields = {'contribution', 'session'}
skip_fields = advanced_fields | conditional_fields
- name = StringField(_('Name'), [DataRequired(), Length(min=3, max=60), Regexp(ROOM_NAME_RE)],
- description=_('The name of the room'))
description = TextAreaField(_('Description'), [DataRequired()], description=_('The description of the room'))
linking = IndicoRadioField(_("Link to"), [DataRequired()],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment