예제 #1
0
def _register_template_hook_cleanup(name, *args, **kwargs):
    old_recvs = set(signals.plugin.template_hook.receivers_for(name))
    register_template_hook(name, *args, **kwargs)
    try:
        yield
    finally:
        for recv in signals.plugin.template_hook.receivers_for(name):
            if recv not in old_recvs:
                signals.plugin.template_hook.disconnect(recv)
예제 #2
0
    def template_hook(self, name, receiver, priority=50, markup=True):
        """Registers a function to be called when a template hook is invoked.

        For details see :func:~`indico.web.flask.templating.register_template_hook`
        """
        register_template_hook(name, receiver, priority, markup, self)
예제 #3
0
    def template_hook(self, name, receiver, priority=50, markup=True):
        """Registers a function to be called when a template hook is invoked.

        For details see :func:~`indico.web.flask.templating.register_template_hook`
        """
        register_template_hook(name, receiver, priority, markup, self)
예제 #4
0
from flask import render_template, request, session
from sqlalchemy.orm import joinedload

from indico.core import signals
from indico.modules.events.layout import theme_settings
from indico.modules.events.management.views import WPEventManagement
from indico.modules.events.timetable.models.entries import TimetableEntryType
from indico.modules.events.timetable.views.weeks import inject_week_timetable
from indico.modules.events.util import get_theme
from indico.modules.events.views import WPConferenceDisplayBase
from indico.util.signals import values_from_signal
from indico.web.flask.templating import register_template_hook, template_hook


register_template_hook('week-meeting-body', inject_week_timetable)


class WPManageTimetable(WPEventManagement):
    template_prefix = 'events/timetable/'
    sidemenu_option = 'timetable'
    bundles = ('module_events.contributions.js',)

    def __init__(self, rh, event_, **kwargs):
        custom_links = dict(values_from_signal(signals.event.timetable_buttons.send(self)))
        WPEventManagement.__init__(self, rh, event_, custom_links=custom_links, **kwargs)


class WPDisplayTimetable(WPConferenceDisplayBase):
    template_prefix = 'events/timetable/'
    menu_entry_name = 'timetable'
예제 #5
0
파일: __init__.py 프로젝트: florv/indico
from sqlalchemy.orm import joinedload

from indico.core import signals
from indico.modules.events.contributions import Contribution
from indico.modules.events.layout import theme_settings
from indico.modules.events.timetable.models.entries import TimetableEntryType
from indico.modules.events.timetable.views.weeks import inject_week_timetable
from indico.util.signals import values_from_signal
from indico.web.flask.templating import template_hook, register_template_hook

from MaKaC.common.timezoneUtils import DisplayTZ
from MaKaC.webinterface.pages.base import WPJinjaMixin
from MaKaC.webinterface.pages.conferences import WPConferenceModifBase, WPConferenceDefaultDisplayBase


register_template_hook('week-meeting-body', inject_week_timetable)


class WPManageTimetable(WPJinjaMixin, WPConferenceModifBase):
    template_prefix = 'events/timetable/'
    sidemenu_option = 'timetable'

    def __init__(self, rh, conference, **kwargs):
        custom_links = dict(values_from_signal(signals.event.timetable_buttons.send(self)))
        WPConferenceModifBase.__init__(self, rh, conference, custom_links=custom_links, **kwargs)

    def getJSFiles(self):
        return (WPConferenceModifBase.getJSFiles(self) + self._asset_env['modules_timetable_js'].urls() +
                self._asset_env['modules_contributions_js'].urls())

    def getCSSFiles(self):