Example #1
0
    'users',
    {
        'lang': None,
        'timezone': None,
        'force_timezone':
        False,  # always use the user's timezone instead of an event's timezone
        'show_future_events': False,
        'show_past_events': False,
        'name_format': NameFormat.first_last,
        'use_previewer_pdf': True,
        'synced_fields':
        None,  # None to synchronize all fields, empty set to not synchronize
        'suggest_categories':
        False  # whether the user should receive category suggestions
    },
    converters={'name_format': EnumConverter(NameFormat)})

user_management_settings = SettingsProxy('user_management',
                                         {'notify_account_creation': False})


@signals.category.deleted.connect
def _category_deleted(category, **kwargs):
    category.favorite_of.clear()


@signals.menu.items.connect_via('admin-sidemenu')
def _extend_admin_menu(sender, **kwargs):
    if session.user.is_admin:
        yield SideMenuItem('admins',
                           _("Admins"),
Example #2
0
DEFAULT_BADGE_SETTINGS = {
    'top_margin': 1.6,
    'bottom_margin': 1.1,
    'left_margin': 1.6,
    'right_margin': 1.4,
    'margin_columns': 1.0,
    'margin_rows': 0.0,
    'page_size': PageSize.A4,
    'page_orientation': PageOrientation.portrait,
    'dashed_border': True,
    'page_layout': None
}

BADGE_SETTING_CONVERTERS = {
    'page_orientation': EnumConverter(PageOrientation),
    'page_size': EnumConverter(PageSize)
}


class RegistrationSettingsProxy(EventSettingsProxy):
    """Store per-event registration settings."""
    def get_participant_list_columns(self, event, form=None):
        if form is None:
            # Columns when forms are merged
            return self.get(event, 'participant_list_columns')
        else:
            try:
                # The int values are automatically converted to unicode when saved as JSON
                form_columns = self.get(
                    event, 'participant_list_form_columns')[unicode(form.id)]
Example #3
0
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.

from indico.core.db.sqlalchemy.descriptions import RenderMode
from indico.core.settings.converters import EnumConverter
from indico.modules.events.settings import EventSettingsProxy

track_settings = EventSettingsProxy(
    'tracks', {
        'program': '',
        'program_render_mode': RenderMode.markdown
    },
    converters={'program_render_mode': EnumConverter(RenderMode)})
Example #4
0
    'authorized_submitters'
}, converters={
    'start_dt': DatetimeConverter,
    'end_dt': DatetimeConverter,
    'modification_end_dt': DatetimeConverter
})


abstracts_reviewing_settings = EventSettingsProxy('abstracts_reviewing', {
    'scale_lower': 0,
    'scale_upper': 5,
    'allow_comments': True,
    'allow_convener_judgment': False,  # whether track conveners can make a judgment (e.g. accept/reject)
    'allow_contributors_in_comments': False,
    'reviewing_instructions': '',
    'judgment_instructions': ''
})


boa_settings = EventSettingsProxy('abstracts_book', {
    'extra_text': '',
    'sort_by': BOASortField.id,
    'corresponding_author': BOACorrespondingAuthorType.submitter,
    'show_abstract_ids': False,
    'cache_path': None
}, converters={
    'sort_by': EnumConverter(BOASortField),
    'corresponding_author': EnumConverter(BOACorrespondingAuthorType),
    'announcement_render_mode': EnumConverter(RenderMode)
})
Example #5
0
    {
        'lang': None,
        'timezone': None,
        'force_timezone':
        False,  # always use the user's timezone instead of an event's timezone
        'show_future_events': False,
        'show_past_events': False,
        'name_format': NameFormat.first_last,
        'use_previewer_pdf': True,
        'synced_fields':
        None,  # None to synchronize all fields, empty set to not synchronize
        'suggest_categories':
        False,  # whether the user should receive category suggestions
    },
    converters={
        'name_format': EnumConverter(NameFormat),
    })

user_management_settings = SettingsProxy('user_management',
                                         {'notify_account_creation': False})


@signals.category.deleted.connect
def _category_deleted(category, **kwargs):
    category.favorite_of.clear()


@signals.menu.items.connect_via('admin-sidemenu')
def _extend_admin_menu(sender, **kwargs):
    if session.user.is_admin:
        yield SideMenuItem('admins',
    'tracks_required': False,
    'allow_attachments': False,
    'copy_attachments': False,
    'allow_speakers': True,
    'speakers_required': True,
    'allow_editing': AllowEditingType.submitter_all,
    'contribution_submitters': SubmissionRightsType.all,
    'contrib_type_required': False,
    'submission_instructions': ''
}, acls={
    'authorized_submitters'
}, converters={
    'start_dt': DatetimeConverter,
    'end_dt': DatetimeConverter,
    'modification_end_dt': DatetimeConverter,
    'allow_editing': EnumConverter(AllowEditingType),
})


abstracts_reviewing_settings = EventSettingsProxy('abstracts_reviewing', {
    'scale_lower': 0,
    'scale_upper': 5,
    'allow_comments': True,
    'allow_convener_judgment': False,  # whether track conveners can make a judgment (e.g. accept/reject)
    'allow_contributors_in_comments': False,
    'reviewing_instructions': '',
    'judgment_instructions': ''
})


boa_settings = EventSettingsProxy('abstracts_book', {
Example #7
0
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.

from indico.core.settings.converters import EnumConverter, ModelListConverter
from indico.modules.users import UserSettingsProxy
from indico.util.i18n import _
from indico.util.struct.enum import RichIntEnum


class RoomEmailMode(RichIntEnum):
    __titles__ = (_('None'), _('Rooms I own'), _('Rooms I manage'),
                  _('Rooms I own or manage'))
    none = 0
    owned = 1
    managed = 2
    all = 3


rb_user_settings = UserSettingsProxy('roombooking', {
    'email_mode': RoomEmailMode.all,
    'email_blacklist': [],
},
                                     converters={
                                         'email_mode':
                                         EnumConverter(RoomEmailMode),
                                         'email_blacklist':
                                         ModelListConverter('Room'),
                                     })
Example #8
0
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.

from __future__ import unicode_literals

from indico.core.settings.converters import EnumConverter, ModelListConverter
from indico.modules.users import UserSettingsProxy
from indico.util.i18n import _
from indico.util.struct.enum import RichIntEnum


class RoomEmailMode(RichIntEnum):
    __titles__ = (_('None'), _('Rooms I own'), _('Rooms I manage'), _('Rooms I own or manage'))
    none = 0
    owned = 1
    managed = 2
    all = 3


rb_user_settings = UserSettingsProxy('roombooking', {
    'email_mode': RoomEmailMode.all,
    'email_blacklist': [],
}, converters={
    'email_mode': EnumConverter(RoomEmailMode),
    'email_blacklist': ModelListConverter('Room'),
})