mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-13 07:29:39 +00:00
VC/Vidyo: Fixed dummy plugin, added custom service button
This commit is contained in:
parent
1947e99a61
commit
822dd08374
@ -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):
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
{% extends 'admin/base.html' %}
|
||||
{% from 'forms/form_widget.html' import form_header, form_footer, form_rows %}
|
||||
|
||||
{% block title %}
|
||||
Dummy Plugin
|
||||
{% endblock %}
|
||||
{% block subtitle %}{{ plugin.title }}{% endblock %}
|
||||
{%- block content %}
|
||||
{{ form_header(id='vc-room-form') }}
|
||||
|
||||
{{ form_rows(form) }}
|
||||
|
||||
{% call form_footer() %}
|
||||
<input class="i-button big highlight" type="submit" value="{% trans %}Save{% endtrans %}">
|
||||
<a href="{{ url_for('vc.manage_vc_rooms', event) }}" class="i-button big" data-button-back>{% trans %}Cancel{% endtrans %}</a>
|
||||
{% endcall %}
|
||||
{%- endblock %}
|
||||
@ -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()],
|
||||
|
||||
@ -17,17 +17,19 @@
|
||||
from __future__ import unicode_literals
|
||||
import re
|
||||
|
||||
from flask import render_template
|
||||
|
||||
from wtforms.fields import IntegerField, TextAreaField
|
||||
from wtforms.fields.html5 import URLField, EmailField
|
||||
from wtforms.fields.simple import StringField
|
||||
from wtforms.validators import NumberRange, DataRequired
|
||||
|
||||
from indico.core.config import Config
|
||||
from indico.util.user import retrieve_principals
|
||||
from indico.modules.vc import VCPluginSettingsFormBase, VCPluginMixin
|
||||
from indico.modules.vc.views import WPVCManageEvent
|
||||
from indico.core.plugins import IndicoPlugin, url_for_plugin, IndicoPluginBlueprint
|
||||
from indico.util.i18n import _
|
||||
from indico.web.flask.templating import get_overridable_template_name
|
||||
from indico.web.forms.fields import EmailListField, IndicoPasswordField
|
||||
from indico.web.forms.widgets import CKEditorWidget
|
||||
from indico_vc_vidyo.forms import VCRoomForm
|
||||
|
||||
@ -48,3 +48,11 @@ $dropdown-transition: $dropdown-transition-step ease-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.i-button.js-create-room {
|
||||
line-height: 2em;
|
||||
img {
|
||||
vertical-align: middle;
|
||||
width: 2em;
|
||||
}
|
||||
}
|
||||
BIN
vc_vidyo/indico_vc_vidyo/static/images/vidyo_logo_notext.png
Normal file
BIN
vc_vidyo/indico_vc_vidyo/static/images/vidyo_logo_notext.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
6
vc_vidyo/indico_vc_vidyo/templates/create_button.html
Normal file
6
vc_vidyo/indico_vc_vidyo/templates/create_button.html
Normal file
@ -0,0 +1,6 @@
|
||||
<a data-vc-system="{{plugin.service_name}}"
|
||||
class="i-button bottom i-form-button js-create-room right"
|
||||
href="{{ url_for_plugin('.manage_vc_rooms_create', event, service=plugin.service_name) }}">
|
||||
<img src="{{ url_for_plugin('vc_vidyo.static', filename='images/vidyo_logo_notext.png') }}" />
|
||||
{%trans%}Add new Vidyo Room{%endtrans%}
|
||||
</a>
|
||||
Loading…
x
Reference in New Issue
Block a user