mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-18 09:44:42 +00:00
VC/Vidyo: Scaffolding for Vidyo plugin
This commit is contained in:
parent
1e27112835
commit
0a3d08c32a
0
vc_vidyo/indico_vc_vidyo/__init__.py
Normal file
0
vc_vidyo/indico_vc_vidyo/__init__.py
Normal file
34
vc_vidyo/indico_vc_vidyo/forms.py
Normal file
34
vc_vidyo/indico_vc_vidyo/forms.py
Normal file
@ -0,0 +1,34 @@
|
||||
# This file is part of Indico.
|
||||
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
|
||||
#
|
||||
# Indico is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# Indico is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from wtforms.fields.core import BooleanField
|
||||
from wtforms.fields.simple import StringField, TextAreaField
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
from indico.web.forms.base import IndicoForm
|
||||
from indico.util.i18n import _
|
||||
from indico.web.forms.fields import SingleUserField
|
||||
|
||||
|
||||
class VCRoomForm(IndicoForm):
|
||||
name = StringField(_('Name'), [DataRequired()], description=_('The name of the room'))
|
||||
description = TextAreaField(_('Description'), description=_('The description of the room'))
|
||||
moderator = SingleUserField(_('Moderator'), description=_('The moderator of the room'))
|
||||
auto_mute = BooleanField(_('Auto mute'),
|
||||
description=_('The VidyoDesktop clients will join the meeting muted by default'
|
||||
'(audio and video)'))
|
||||
57
vc_vidyo/indico_vc_vidyo/plugin.py
Normal file
57
vc_vidyo/indico_vc_vidyo/plugin.py
Normal file
@ -0,0 +1,57 @@
|
||||
# This file is part of Indico.
|
||||
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
|
||||
#
|
||||
# Indico is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# Indico is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from wtforms.fields.html5 import URLField, EmailField
|
||||
from wtforms.fields.simple import StringField
|
||||
|
||||
from indico.core.plugins import IndicoPlugin, url_for_plugin, IndicoPluginBlueprint
|
||||
from indico.modules.vc import VCPluginSettingsFormBase, VCPluginMixin
|
||||
from indico.util.i18n import _
|
||||
from indico.web.forms.fields import MultipleItemsField, EmailListField, UnsafePasswordField
|
||||
from indico_vc_vidyo.forms import VCRoomForm
|
||||
|
||||
|
||||
class PluginSettingsForm(VCPluginSettingsFormBase):
|
||||
event_types = MultipleItemsField(_('Supported event types'), fields=(('type', 'Type'),),
|
||||
description=_("Kind of event types (conference, meeting, simple_event) supported"))
|
||||
vidyo_support = EmailField(_('Vidyo email support'))
|
||||
notify_emails = EmailListField(_('Notification emails'),
|
||||
description=_('Additional email addresses who will always receive notifications'
|
||||
'(one per line)'))
|
||||
username = StringField(_('Username'), description=_('Indico username for Vidyo'))
|
||||
password = UnsafePasswordField(_('Password'), description=_('Indico password for Vidyo'))
|
||||
api_base_url = URLField(_('Vidyo API base URL'))
|
||||
api_wsdl_url = URLField(_('Admin API WSDL URL'))
|
||||
user_api = StringField(_('User API Service'))
|
||||
|
||||
|
||||
class VidyoPlugin(VCPluginMixin, IndicoPlugin):
|
||||
"""Vidyo
|
||||
|
||||
Video conferencing with Vidyo
|
||||
"""
|
||||
configurable = True
|
||||
settings_form = PluginSettingsForm
|
||||
vc_room_form = VCRoomForm
|
||||
|
||||
@property
|
||||
def logo_url(self):
|
||||
return url_for_plugin(self.name + '.static', filename='images/logo.png')
|
||||
|
||||
def get_blueprints(self):
|
||||
return IndicoPluginBlueprint('vc_vidyo', __name__)
|
||||
BIN
vc_vidyo/indico_vc_vidyo/static/images/logo.png
Normal file
BIN
vc_vidyo/indico_vc_vidyo/static/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
@ -0,0 +1,20 @@
|
||||
{% extends 'admin/base.html' %}
|
||||
{% from 'forms/form_widget.html' import form_header, form_fieldset, form_footer, form_rows %}
|
||||
|
||||
{% block title %}
|
||||
{%- if existing_vc_room -%}
|
||||
{% trans %}Edit {% endtrans %}
|
||||
{%- else -%}
|
||||
{% trans %}Create {% endtrans %}
|
||||
{%- endif -%}
|
||||
{% trans %}Video Conference Room{% endtrans %}
|
||||
{% 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 %}
|
||||
33
vc_vidyo/indico_vc_vidyo/util.py
Normal file
33
vc_vidyo/indico_vc_vidyo/util.py
Normal file
@ -0,0 +1,33 @@
|
||||
# This file is part of Indico.
|
||||
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
|
||||
#
|
||||
# Indico is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# Indico is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from indico.util.user import retrieve_principals
|
||||
|
||||
|
||||
def get_auth_users():
|
||||
"""Returns a list of authorized users
|
||||
|
||||
:return: list of Avatar/Group objects
|
||||
"""
|
||||
from indico_vc_vidyo.plugin import VidyoPlugin
|
||||
return retrieve_principals(VidyoPlugin.settings.get('authorized_users'))
|
||||
|
||||
|
||||
def is_auth_user(user):
|
||||
"""Checks if a user is authorized"""
|
||||
return any(principal.containsUser(user) for principal in get_auth_users())
|
||||
44
vc_vidyo/setup.py
Normal file
44
vc_vidyo/setup.py
Normal file
@ -0,0 +1,44 @@
|
||||
# This file is part of Indico.
|
||||
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
|
||||
#
|
||||
# Indico is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# Indico is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
|
||||
setup(
|
||||
name='indico_vc_vidyo',
|
||||
version='0.1',
|
||||
url='https://github.com/indico/indico-plugins',
|
||||
license='https://www.gnu.org/licenses/gpl-3.0.txt',
|
||||
author='Indico Team',
|
||||
author_email='indico-team@cern.ch',
|
||||
packages=find_packages(),
|
||||
zip_safe=False,
|
||||
include_package_data=True,
|
||||
platforms='any',
|
||||
install_requires=[
|
||||
'indico>=1.9.1',
|
||||
'sleekxmpp'
|
||||
],
|
||||
classifiers=[
|
||||
'Environment :: Plugins',
|
||||
'Environment :: Web Environment',
|
||||
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
|
||||
'Programming Language :: Python :: 2.7'
|
||||
],
|
||||
entry_points={'indico.plugins': {'vc_vidyo = indico_vc_vidyo.plugin:VidyoPlugin'}}
|
||||
)
|
||||
Loading…
x
Reference in New Issue
Block a user