_bp.add_url_rule('/reset-password/', 'resetpass', RHResetPassword, methods=('GET', 'POST')) with _bp.add_prefixed_rules('/user/<int:user_id>', '/user'): _bp.add_url_rule('/accounts/', 'accounts', RHAccounts, methods=('GET', 'POST')) _bp.add_url_rule('/accounts/<identity>/remove/', 'remove_account', RHRemoveAccount, methods=('POST', )) @_bp.url_defaults def _add_user_id(endpoint, values): if endpoint in {'auth.accounts', 'auth.remove_account' } and 'user_id' not in values: values['user_id'] = request.view_args.get('user_id') # Legacy URLs auth_compat_blueprint = _compat_bp = IndicoBlueprint('compat_auth', __name__) _compat_bp.add_url_rule('/user/login', 'login', make_compat_redirect_func(_bp, 'login')) _compat_bp.add_url_rule('/user/register', 'register', make_compat_redirect_func(_bp, 'register'))
_bp.add_url_rule('/event/<confId>/manage/videoconference/', 'manage_vc_rooms', RHVCManageEvent) _bp.add_url_rule('/event/<confId>/manage/videoconference/select', 'manage_vc_rooms_select', RHVCManageEventSelectService, methods=('GET', 'POST')) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/create', 'manage_vc_rooms_create', RHVCManageEventCreate, methods=('GET', 'POST')) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/<int:event_vc_room_id>/', 'manage_vc_rooms_modify', RHVCManageEventModify, methods=('GET', 'POST')) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/<int:event_vc_room_id>/remove', 'manage_vc_rooms_remove', RHVCManageEventRemove, methods=('POST',)) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/<int:event_vc_room_id>/refresh', 'manage_vc_rooms_refresh', RHVCManageEventRefresh, methods=('POST',)) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/attach/', 'manage_vc_rooms_search_form', RHVCManageAttach, methods=('GET', 'POST')) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/search/', 'manage_vc_rooms_search', RHVCManageSearch) # Room management _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/<int:event_vc_room_id>/room/', 'vc_room_modify', RHVCRoomModify, methods=('POST',)) # Event page _bp.add_url_rule('/event/<confId>/videoconference/', 'event_videoconference', RHVCEventPage) # Legacy URLs vc_compat_blueprint = _compat_bp = IndicoBlueprint('compat_vc', __name__) vc_compat_blueprint.add_url_rule('/event/<confId>/collaboration', 'collaboration', make_compat_redirect_func(_bp, 'event_videoconference')) vc_compat_blueprint.add_url_rule('/collaborationDisplay.py', 'collaborationpy', make_compat_redirect_func(_bp, 'event_videoconference'))
_bp.add_url_rule('/contributions/<int:contrib_id>/contribution.pdf', 'export_pdf', RHContributionExportToPDF) _bp.add_url_rule('/contributions/<int:contrib_id>/contribution.ics', 'export_ics', RHContributionExportToICAL) _bp.add_url_rule('/contributions/<int:contrib_id>/subcontributions/<int:subcontrib_id>', 'display_subcontribution', RHSubcontributionDisplay) # Legacy URLs _compat_bp = IndicoBlueprint('compat_contributions', __name__, url_prefix='/event/<event_id>') with _compat_bp.add_prefixed_rules('/session/<legacy_session_id>'): _compat_bp.add_url_rule('/contribution/<legacy_contribution_id>', 'contribution', partial(compat_contribution, 'display_contribution')) _compat_bp.add_url_rule('/contribution/<legacy_contribution_id>.ics', 'contribution_ics', partial(compat_contribution, 'export_ics')) _compat_bp.add_url_rule('/contribution/<legacy_contribution_id>.pdf', 'contribution_pdf', partial(compat_contribution, 'export_pdf')) _compat_bp.add_url_rule('/contribution/<legacy_contribution_id>/<legacy_subcontribution_id>', 'subcontribution', compat_subcontribution) _compat_bp.add_url_rule('/my-conference/contributions', 'my_contributions', make_compat_redirect_func(_bp, 'my_contributions', view_args_conv={'event_id': 'confId'})) _compat_bp.add_url_rule('!/contributionDisplay.py', 'contribution_modpython', make_compat_redirect_func(_compat_bp, 'contribution', view_args_conv={'confId': 'event_id', 'contribId': 'legacy_contribution_id'})) _compat_bp.add_url_rule('!/subContributionDisplay.py', 'subcontribution_modpython', make_compat_redirect_func(_compat_bp, 'subcontribution', view_args_conv={'confId': 'event_id', 'contribId': 'legacy_contribution_id', 'subContId': 'legacy_subcontribution_id'}))
'/contribution/<contrib_id>/material/<material_id>/<resource_id>.<ext>', '/contribution/<contrib_id>/<subcontrib_id>/material/<material_id>/<resource_id>', '/contribution/<contrib_id>/<subcontrib_id>/material/<material_id>/<resource_id>.<ext>' ] old_obj_prefix_rules = { 'session': ['!/event/<confId>/session/<sessionId>'], 'contribution': ['!/event/<confId>/session/<sessionId>/contribution/<contribId>', '!/event/<confId>/contribution/<contribId>'], 'subcontribution': ['!/event/<confId>/session/<sessionId>/contribution/<contribId>/<subContId>', '!/event/<confId>/contribution/<contribId>/<subContId>'] } for rule in compat_folder_rules: _compat_bp.add_url_rule(rule, 'folder', compat_folder) for rule in compat_attachment_rules: _compat_bp.add_url_rule(rule, 'attachment', compat_attachment) for object_type, prefixes in old_obj_prefix_rules.iteritems(): for prefix in prefixes: # we rely on url normalization to redirect to the proper URL for the object _compat_bp.add_url_rule(prefix + '/attachments/<int:folder_id>/<int:attachment_id>/<filename>', 'compat_download', RHCompatAttachmentNew, defaults={'object_type': object_type}) _compat_bp.add_url_rule('!/getFile.py/access', 'getfile', make_compat_redirect_func(_compat_bp, 'attachment', view_args_conv={'confId': 'event_id', 'sessionId': 'session_id', 'contribId': 'contrib_id', 'subContId': 'subcontrib_id', 'materialId': 'material_id', 'resId': 'resource_id'})) _compat_bp.add_url_rule('!/materialDisplay.py', 'materialdisplay', compat_folder_old)
## ## 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/>. import MaKaC.plugins.InstantMessaging.rh as handlers from indico.web.flask.util import make_compat_redirect_func from indico.web.flask.wrappers import IndicoBlueprint blueprint = IndicoBlueprint('instantmessaging', __name__) blueprint.add_url_rule('/event/<confId>/manage/chat/', 'confModifChat', handlers.RHChatFormModif) blueprint.add_url_rule('/event/<confId>/manage/chat/logs', 'confModifChat-logs', handlers.RHChatSeeLogs) blueprint.add_url_rule('/event/<confId>/chat', 'conferenceInstantMessaging', handlers.RHInstantMessagingDisplay) blueprint.add_url_rule('/InstantMessaging/<path:filepath>', 'htdocs', handlers.RHInstantMessagingHtdocs) # we can't use make_compat_blueprint here because the old url doesn't end in .py compat = IndicoBlueprint('compat_instantmessaging', __name__) compat.add_url_rule('/confModifChat', 'confModifChat', make_compat_redirect_func(blueprint, 'confModifChat')) compat.add_url_rule('/confModifChat/logs', 'confModifChat-logs', make_compat_redirect_func(blueprint, 'confModifChat-logs')) compat.add_url_rule('/conferenceInstantMessaging', 'conferenceInstantMessaging', make_compat_redirect_func(blueprint, 'conferenceInstantMessaging'))
_bp.add_url_rule('/manage/events/move', 'move_events', RHMoveEvents, methods=('POST',)) _bp.add_url_rule('/manage/events/split', 'split_category', RHSplitCategory, methods=('GET', 'POST')) # Subcategory management _bp.add_url_rule('/manage/subcategories/create', 'create_subcategory', RHCreateCategory, methods=('GET', 'POST')) _bp.add_url_rule('/manage/subcategories/delete', 'delete_subcategories', RHDeleteSubcategories, methods=('POST',)) _bp.add_url_rule('/manage/subcategories/move', 'move_subcategories', RHMoveSubcategories, methods=('POST',)) _bp.add_url_rule('/manage/subcategories/sort', 'sort_subcategories', RHSortSubcategories, methods=('POST',)) # Display _bp.add_url_rule('!/', 'display', RHDisplayCategory, defaults={'category_id': 0}) _bp.add_url_rule('/', 'display', RHDisplayCategory) _bp.add_url_rule('/event-list', 'event_list', RHEventList) _bp.add_url_rule('/events.atom', 'export_atom', RHExportCategoryAtom) _bp.add_url_rule('/events.ics', 'export_ical', RHExportCategoryICAL) _bp.add_url_rule('/events.rss', 'export_rss', make_compat_redirect_func(_bp, 'export_atom')) _bp.add_url_rule('/icon-<slug>.png', 'display_icon', RHCategoryIcon) _bp.add_url_rule('/info', 'info', RHCategoryInfo) _bp.add_url_rule('/info-from', 'info_from', RHReachableCategoriesInfo, methods=('GET', 'POST')) _bp.add_url_rule('/logo-<slug>.png', 'display_logo', RHCategoryLogo) _bp.add_url_rule('/overview', 'overview', RHCategoryOverview) _bp.add_url_rule('/show-past-events', 'show_past_events', RHShowPastEventsInCategory, methods=('DELETE', 'PUT')) _bp.add_url_rule('/statistics', 'statistics', RHCategoryStatistics) _bp.add_url_rule('/subcat-info', 'subcat_info', RHSubcatInfo) _bp.add_url_rule('/calendar', 'calendar', RHCategoryCalendarView) # Event creation - redirect to anchor page opening the dialog _bp.add_url_rule('/create/event/<any(lecture,meeting,conference):event_type>', view_func=_redirect_event_creation) # TODO: remember to refactor it at some point _bp.add_url_rule('!/xmlGateway.py/getCategoryInfo', 'category_xml_info', RHXMLExportCategoryInfo)
_bp.add_url_rule('/manage/subcategories/sort', 'sort_subcategories', RHSortSubcategories, methods=('POST', )) # Display _bp.add_url_rule('!/', 'display', RHDisplayCategory, defaults={'category_id': 0}) _bp.add_url_rule('/', 'display', RHDisplayCategory) _bp.add_url_rule('/event-list', 'event_list', RHEventList) _bp.add_url_rule('/events.atom', 'export_atom', RHExportCategoryAtom) _bp.add_url_rule('/events.ics', 'export_ical', RHExportCategoryICAL) _bp.add_url_rule('/events.rss', 'export_rss', make_compat_redirect_func(_bp, 'export_atom')) _bp.add_url_rule('/icon-<slug>.png', 'display_icon', RHCategoryIcon) _bp.add_url_rule('/info', 'info', RHCategoryInfo) _bp.add_url_rule('/info-from', 'info_from', RHReachableCategoriesInfo, methods=('GET', 'POST')) _bp.add_url_rule('/logo-<slug>.png', 'display_logo', RHCategoryLogo) _bp.add_url_rule('/overview', 'overview', RHCategoryOverview) _bp.add_url_rule('/show-future-events', 'show_future_events', RHShowFutureEventsInCategory, methods=('DELETE', 'PUT')) _bp.add_url_rule('/show-past-events', 'show_past_events', RHShowPastEventsInCategory,
virtual_template_folder="events/layout", url_prefix="/event/<confId>", ) _bp_images.add_url_rule("/logo-<slug>.png", "logo_display", RHLogoDisplay) _bp_images.add_url_rule("/images/<int:image_id>-<filename>", "image_display", RHImageDisplay) _bp_pages = IndicoBlueprint( "event_pages", __name__, template_folder="templates", virtual_template_folder="events/layout", url_prefix="/event/<confId>", ) _bp_pages.add_url_rule("/page/<int:page_id>-<slug>", "page_display", RHPageDisplay) _compat_bp = IndicoBlueprint("compat_layout", __name__, url_prefix="/event/<event_id>") _compat_bp.add_url_rule( "!/internalPage.py", "page_modpython", make_compat_redirect_func(_compat_bp, "page", view_args_conv={"confId": "event_id", "pageId": "legacy_page_id"}), ) _compat_bp.add_url_rule("/page/<int:legacy_page_id>", "page", compat_page) _compat_bp.add_url_rule("/picture/<int:legacy_image_id>.<image_ext>", "image", compat_image) _compat_bp.add_url_rule("/picture/<int:legacy_image_id>", "image", compat_image) _compat_bp.add_url_rule( "!/conferenceDisplay.py/getPic", "image_modpython", make_compat_redirect_func(_compat_bp, "image", view_args_conv={"confId": "event_id", "picId": "legacy_image_id"}), )
blocking_handlers.RHRoomBookingDeleteBlocking, methods=('POST',)) _bp.add_url_rule('/blocking/create', 'create_blocking', blocking_handlers.RHRoomBookingCreateBlocking, methods=('GET', 'POST')) _bp.add_url_rule('/blocking/list', 'blocking_list', blocking_handlers.RHRoomBookingBlockingList) _bp.add_url_rule('/blocking/list/my-rooms', 'blocking_my_rooms', blocking_handlers.RHRoomBookingBlockingsForMyRooms) _compat_bp = IndicoBlueprint('compat_rooms', __name__) _compat_bp.add_url_rule('/roomBooking.py', 'roomBooking', make_compat_redirect_func(_bp, 'roomBooking')) _compat_bp.add_url_rule('/roomBooking.py/mapOfRooms', 'roomBooking-mapOfRooms', make_compat_redirect_func(_bp, 'roomBooking-mapOfRooms')) _compat_bp.add_url_rule('/roomBooking.py/search4Bookings', 'roomBooking-search4Bookings', make_compat_redirect_func(_bp, 'roomBooking-search4Bookings')) _compat_bp.add_url_rule('/roomBooking.py/bookingDetails', 'roomBooking-bookingDetails', make_compat_redirect_func(_bp, 'roomBooking-bookingDetails')) _compat_bp.add_url_rule('/roomBooking.py/roomDetails', 'roomBooking-roomDetails', make_compat_redirect_func(_bp, 'roomBooking-roomDetails')) _compat_bp.add_url_rule('/roomBooking.py/roomStats', 'roomBooking-roomStats', make_compat_redirect_func(_bp, 'roomBooking-roomStats'))
"api_registrant", RHAPIRegistrant, methods=("GET", "PATCH"), ) _bp.add_url_rule("!/api/events/<int:event_id>/registrants", "api_registrants", RHAPIRegistrants) # Participants _bp_participation = IndicoBlueprint( "event_participation", __name__, url_prefix="/event/<confId>", template_folder="templates", virtual_template_folder="events/registration", ) _bp_participation.add_url_rule("/manage/participants/", "manage", RHManageParticipants, methods=("GET", "POST")) # Legacy URLs _compat_bp = IndicoBlueprint("compat_event_registration", __name__, url_prefix="/event/<int:event_id>") _compat_bp.add_url_rule("/registration/", "registration", compat_registration) _compat_bp.add_url_rule("/registration/<path:path>", "registration", compat_registration) _compat_bp.add_url_rule( "/registration/registrants", "registrants", make_compat_redirect_func(_bp, "participant_list", view_args_conv={"event_id": "confId"}), ) _compat_bp.add_url_rule( "!/confRegistrantsDisplay.py/list", "registrants_modpython", make_compat_redirect_func(_bp, "participant_list") )
## 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/>. import MaKaC.plugins.InstantMessaging.rh as handlers from indico.web.flask.util import make_compat_redirect_func from indico.web.flask.wrappers import IndicoBlueprint blueprint = IndicoBlueprint("instantmessaging", __name__) blueprint.add_url_rule("/event/<confId>/manage/chat/", "confModifChat", handlers.RHChatFormModif) blueprint.add_url_rule("/event/<confId>/manage/chat/logs/<chatroom>", "confModifChat-logs", handlers.RHChatSeeLogs) blueprint.add_url_rule("/event/<confId>/chat", "conferenceInstantMessaging", handlers.RHInstantMessagingDisplay) blueprint.add_url_rule("/InstantMessaging/<path:filepath>", "htdocs", handlers.RHInstantMessagingHtdocs) # we can't use make_compat_blueprint here because the old url doesn't end in .py compat = IndicoBlueprint("compat_instantmessaging", __name__) compat.add_url_rule("/confModifChat", "confModifChat", make_compat_redirect_func(blueprint, "confModifChat")) compat.add_url_rule( "/confModifChat/logs", "confModifChat-logs", make_compat_redirect_func(blueprint, "confModifChat-logs") ) compat.add_url_rule( "/conferenceInstantMessaging", "conferenceInstantMessaging", make_compat_redirect_func(blueprint, "conferenceInstantMessaging"), )
# Short URLs category.add_url_rule('!/categ/<categId>', view_func=redirect_view('.categoryDisplay'), strict_slashes=False) category.add_url_rule('!/c/<categId>', view_func=redirect_view('.categoryDisplay'), strict_slashes=False) # Display category.add_url_rule('/<categId>/', 'categoryDisplay', categoryDisplay.RHCategoryDisplay) category.add_url_rule('/<categId>/events.atom', 'categoryDisplay-atom', categoryDisplay.RHCategoryToAtom) category.add_url_rule( '/<categId>/events.rss', 'categoryDisplay-rss', make_compat_redirect_func(category, 'categoryDisplay-atom')) category.add_url_rule('/<categId>/events.ics', 'categoryDisplay-ical', categoryDisplay.RHCategoryToiCal) category.add_url_rule('/<categId>/icon', 'categoryDisplay-getIcon', categoryDisplay.RHCategoryGetIcon) # Overview category.add_url_rule('/<categId>/overview', 'categOverview', categoryDisplay.RHCategOverviewDisplay) category.add_url_rule('/<selCateg>/overview', 'categOverview', categoryDisplay.RHCategOverviewDisplay) category.add_url_rule('/overview', 'categOverview', categoryDisplay.RHCategOverviewDisplay) category.add_url_rule( '/<categId>/overview.rss', 'categOverview-rss', make_compat_redirect_func(category, 'categoryDisplay-atom'))
'confModifCollaboration', handlers.RHConfModifCSBookings, methods=('GET', 'POST')) blueprint.add_url_rule('/event/<confId>/manage/collaboration/managers', 'confModifCollaboration-managers', handlers.RHConfModifCSProtection) # Display event blueprint.add_url_rule('/event/<confId>/collaboration', 'collaborationDisplay', handlers.RHCollaborationDisplay) # Collaboration admin blueprint.add_url_rule('/admin/collaboration', 'adminCollaboration', handlers.RHAdminCollaboration) # htdocs blueprint.add_url_rule('/Collaboration/<plugin>/<path:filepath>', 'htdocs', RHCollaborationHtdocs) blueprint.add_url_rule('/Collaboration/<path:filepath>', 'htdocs', RHCollaborationHtdocs) # we can't use make_compat_blueprint here because the old url doesn't end in .py compat = IndicoBlueprint('compat_collaboration', __name__) compat.add_url_rule( '/collaborationDisplay.py', 'collaborationDisplay', make_compat_redirect_func(blueprint, 'collaborationDisplay')) compat.add_url_rule('/Collaboration/elecAgree', 'elecAgree', make_compat_redirect_func(blueprint, 'elecAgree')) compat.add_url_rule('/Collaboration/elecAgreeForm', 'elecAgreeForm', make_compat_redirect_func(blueprint, 'elecAgreeForm'))
from indico.web.flask.util import redirect_view, make_compat_redirect_func from indico.web.flask.wrappers import IndicoBlueprint category = IndicoBlueprint('category', __name__, url_prefix='/category') # Short URLs category.add_url_rule('!/categ/<categId>', view_func=redirect_view('.categoryDisplay'), strict_slashes=False) category.add_url_rule('!/c/<categId>', view_func=redirect_view('.categoryDisplay'), strict_slashes=False) # Display category.add_url_rule('/<categId>/', 'categoryDisplay', categoryDisplay.RHCategoryDisplay) category.add_url_rule('/<categId>/events.atom', 'categoryDisplay-atom', categoryDisplay.RHCategoryToAtom) category.add_url_rule('/<categId>/events.rss', 'categoryDisplay-rss', make_compat_redirect_func(category, 'categoryDisplay-atom')) category.add_url_rule('/<categId>/events.ics', 'categoryDisplay-ical', categoryDisplay.RHCategoryToiCal) category.add_url_rule('/<categId>/icon', 'categoryDisplay-getIcon', categoryDisplay.RHCategoryGetIcon) # Overview category.add_url_rule('/<categId>/overview', 'categOverview', categoryDisplay.RHCategOverviewDisplay) category.add_url_rule('/<selCateg>/overview', 'categOverview', categoryDisplay.RHCategOverviewDisplay) category.add_url_rule('/overview', 'categOverview', categoryDisplay.RHCategOverviewDisplay) category.add_url_rule('/<categId>/overview.rss', 'categOverview-rss', make_compat_redirect_func(category, 'categoryDisplay-atom')) # Event map category.add_url_rule('/<categId>/map', 'categoryMap', categoryDisplay.RHCategoryMap) # Event calendar category.add_url_rule('/calendar/', 'wcalendar', calendar.RHCalendar)
# # 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.modules.events.tracks.controllers import (RHCreateTrack, RHDeleteTrack, RHDisplayTracks, RHEditProgram, RHEditTrack, RHManageTracks, RHSortTracks, RHTracksPDF) from indico.web.flask.util import make_compat_redirect_func from indico.web.flask.wrappers import IndicoBlueprint _bp = IndicoBlueprint('tracks', __name__, template_folder='templates', virtual_template_folder='events/tracks', url_prefix='/event/<confId>') _bp.add_url_rule('/manage/tracks/', 'manage', RHManageTracks) _bp.add_url_rule('/manage/tracks/program', 'edit_program', RHEditProgram, methods=('GET', 'POST')) _bp.add_url_rule('/manage/tracks/create', 'create_track', RHCreateTrack, methods=('GET', 'POST')) _bp.add_url_rule('/manage/tracks/sort', 'sort_tracks', RHSortTracks, methods=('POST',)) _bp.add_url_rule('/manage/tracks/<int:track_id>', 'edit_track', RHEditTrack, methods=('GET', 'POST')) _bp.add_url_rule('/manage/tracks/<int:track_id>', 'delete_track', RHDeleteTrack, methods=('DELETE',)) _bp.add_url_rule('/program', 'program', RHDisplayTracks) _bp.add_url_rule('/program.pdf', 'program_pdf', RHTracksPDF) _compat_bp = IndicoBlueprint('compat_tracks', __name__, url_prefix='/event/<int:confId>') _compat_bp.add_url_rule('/manage/program/tracks/<int:track_id>/contributions/', 'track_contribs', make_compat_redirect_func('contributions', 'contribution_list', view_args_conv={'track_id': None}))
"confModifCollaboration", handlers.RHConfModifCSBookings, methods=("GET", "POST"), ) blueprint.add_url_rule( "/event/<confId>/manage/collaboration/<tab>/", "confModifCollaboration", handlers.RHConfModifCSBookings, methods=("GET", "POST"), ) blueprint.add_url_rule( "/event/<confId>/manage/collaboration/managers", "confModifCollaboration-managers", handlers.RHConfModifCSProtection ) # Display event blueprint.add_url_rule("/event/<confId>/collaboration", "collaborationDisplay", handlers.RHCollaborationDisplay) # Collaboration admin blueprint.add_url_rule("/admin/collaboration", "adminCollaboration", handlers.RHAdminCollaboration) # htdocs blueprint.add_url_rule("/Collaboration/<plugin>/<path:filepath>", "htdocs", RHCollaborationHtdocs) blueprint.add_url_rule("/Collaboration/<path:filepath>", "htdocs", RHCollaborationHtdocs) # we can't use make_compat_blueprint here because the old url doesn't end in .py compat = IndicoBlueprint("compat_collaboration", __name__) compat.add_url_rule("/Collaboration/elecAgree", "elecAgree", make_compat_redirect_func(blueprint, "elecAgree")) compat.add_url_rule( "/Collaboration/elecAgreeForm", "elecAgreeForm", make_compat_redirect_func(blueprint, "elecAgreeForm") )
# Display _bp.add_url_rule('/sessions/mine', 'my_sessions', RHDisplaySessionList) _bp.add_url_rule('/sessions/<int:session_id>/', 'display_session', RHDisplaySession) _bp.add_url_rule('/sessions/<int:session_id>/session.ics', 'export_ics', RHExportSessionToICAL) _bp.add_url_rule('/sessions/<int:session_id>/session-timetable.pdf', 'export_session_timetable', RHExportSessionTimetableToPDF) # Legacy URLs _compat_bp = IndicoBlueprint('compat_sessions', __name__, url_prefix='/event/<int:event_id>') _compat_bp.add_url_rule('/session/<legacy_session_id>/', 'session', partial(compat_session, 'display_session')) _compat_bp.add_url_rule('/session/<legacy_session_id>/session.ics', 'session_ics', partial(compat_session, 'export_ics')) _compat_bp.add_url_rule('/my-conference/sessions', 'my_sessions', make_compat_redirect_func(_bp, 'my_sessions')) _compat_bp.add_url_rule( '!/sessionDisplay.py', 'session_modpython', make_compat_redirect_func(_compat_bp, 'session', view_args_conv={ 'confId': 'event_id', 'sessionId': 'legacy_session_id' }))
_bp.add_url_rule('/entry/<int:entry_id>/move', 'move_entry', RHLegacyTimetableMoveEntry, methods=('GET', 'POST')) _bp.add_url_rule('/entry/<int:entry_id>/shift', 'shift_entries', RHLegacyTimetableShiftEntries, methods=('POST',)) _bp.add_url_rule('/entry/<int:entry_id>/swap', 'swap_entries', RHLegacyTimetableSwapEntries, methods=('POST',)) _bp.add_url_rule('/entry/<int:entry_id>/edit/', 'edit_entry', RHLegacyTimetableEditEntry, methods=('GET', 'POST')) _bp.add_url_rule('/entry/<int:entry_id>/edit/time', 'edit_entry_time', RHLegacyTimetableEditEntryTime, methods=('GET', 'POST')) _bp.add_url_rule('/entry/<int:entry_id>/edit/datetime', 'edit_entry_datetime', RHLegacyTimetableEditEntryDateTime, methods=('POST',)) _bp.add_url_rule('/block/<block_id>/schedule', 'schedule', RHLegacyTimetableScheduleContribution, methods=('POST',)) _bp.add_url_rule('/block/<block_id>/fit', 'fit_session_block', RHLegacyTimetableFitBlock, methods=('POST',)) _bp.add_url_rule('/not-scheduled', 'not_scheduled', RHLegacyTimetableGetUnscheduledContributions) _bp.add_url_rule('/schedule', 'schedule', RHLegacyTimetableScheduleContribution, methods=('POST',)) _bp.add_url_rule('/reschedule', 'reschedule', RHLegacyTimetableReschedule, methods=('POST',)) _bp.add_url_rule('/add-break', 'add_break', RHLegacyTimetableAddBreak, methods=('GET', 'POST')) _bp.add_url_rule('/add-contribution', 'add_contribution', RHLegacyTimetableAddContribution, methods=('GET', 'POST')) _bp.add_url_rule('/add-session-block', 'add_session_block', RHLegacyTimetableAddSessionBlock, methods=('GET', 'POST')) _bp.add_url_rule('/clone-contribution', 'clone_contribution', RHCloneContribution, methods=('POST',)) # Display _bp.add_url_rule('/timetable/', 'timetable', RHTimetable) _bp.add_url_rule('/timetable/pdf', 'export_pdf', RHTimetableExportPDF, methods=('GET', 'POST')) _bp.add_url_rule('/timetable/timetable.pdf', 'export_default_pdf', RHTimetableExportDefaultPDF) _bp.add_url_rule('/timetable/entry/<int:entry_id>/info', 'entry_info', RHTimetableEntryInfo) # Legacy URLs _compat_bp = IndicoBlueprint('compat_timetable', __name__) _compat_bp.add_url_rule('/conferenceTimeTable.py', 'timetable_modpython', make_compat_redirect_func(_bp, 'timetable'))
RHEditProgram, methods=('GET', 'POST')) _bp.add_url_rule('/manage/tracks/create', 'create_track', RHCreateTrack, methods=('GET', 'POST')) _bp.add_url_rule('/manage/tracks/sort', 'sort_tracks', RHSortTracks, methods=('POST', )) _bp.add_url_rule('/manage/tracks/<int:track_id>', 'edit_track', RHEditTrack, methods=('GET', 'POST')) _bp.add_url_rule('/manage/tracks/<int:track_id>', 'delete_track', RHDeleteTrack, methods=('DELETE', )) _bp.add_url_rule('/program', 'program', RHDisplayTracks) _bp.add_url_rule('/program.pdf', 'program_pdf', RHTracksPDF) _compat_bp = IndicoBlueprint('compat_tracks', __name__, url_prefix='/event/<int:confId>') _compat_bp.add_url_rule( '/manage/program/tracks/<int:track_id>/contributions/', 'track_contribs', make_compat_redirect_func('contributions', 'contribution_list', view_args_conv={'track_id': None}))
blueprint.add_url_rule('/event/<confId>/manage/collaboration/elecAgree/download/<spkId>', 'getPaperAgree', handlers.RHElectronicAgreementGetFile) blueprint.add_url_rule('/event/<confId>/collaboration/agreement', 'elecAgreeForm', handlers.RHElectronicAgreementForm) # Manage event blueprint.add_url_rule('/event/<confId>/manage/collaboration/', 'confModifCollaboration', handlers.RHConfModifCSBookings, methods=('GET', 'POST')) blueprint.add_url_rule('/event/<confId>/manage/collaboration/<tab>/', 'confModifCollaboration', handlers.RHConfModifCSBookings, methods=('GET', 'POST')) blueprint.add_url_rule('/event/<confId>/manage/collaboration/managers', 'confModifCollaboration-managers', handlers.RHConfModifCSProtection) # Display event blueprint.add_url_rule('/event/<confId>/collaboration', 'collaborationDisplay', handlers.RHCollaborationDisplay) # Collaboration admin blueprint.add_url_rule('/admin/collaboration', 'adminCollaboration', handlers.RHAdminCollaboration) # htdocs blueprint.add_url_rule('/Collaboration/<plugin>/<path:filepath>', 'htdocs', RHCollaborationHtdocs) blueprint.add_url_rule('/Collaboration/<path:filepath>', 'htdocs', RHCollaborationHtdocs) # we can't use make_compat_blueprint here because the old url doesn't end in .py compat = IndicoBlueprint('compat_collaboration', __name__) compat.add_url_rule('/Collaboration/elecAgree', 'elecAgree', make_compat_redirect_func(blueprint, 'elecAgree')) compat.add_url_rule('/Collaboration/elecAgreeForm', 'elecAgreeForm', make_compat_redirect_func(blueprint, 'elecAgreeForm'))
'/contribution/<contrib_id>/material/<material_id>/' ] compat_attachment_rules = [ '/material/<material_id>/<resource_id>', '/material/<material_id>/<resource_id>.<ext>', '/session/<session_id>/material/<material_id>/<resource_id>', '/session/<session_id>/material/<material_id>/<resource_id>.<ext>', '/session/<session_id>/contribution/<contrib_id>/material/<material_id>/<resource_id>', '/session/<session_id>/contribution/<contrib_id>/material/<material_id>/<resource_id>.<ext>', '/session/<session_id>/contribution/<contrib_id>/<subcontrib_id>/material/<material_id>/<resource_id>', '/session/<session_id>/contribution/<contrib_id>/<subcontrib_id>/material/<material_id>/<resource_id>.<ext>', '/contribution/<contrib_id>/material/<material_id>/<resource_id>', '/contribution/<contrib_id>/material/<material_id>/<resource_id>.<ext>', '/contribution/<contrib_id>/<subcontrib_id>/material/<material_id>/<resource_id>', '/contribution/<contrib_id>/<subcontrib_id>/material/<material_id>/<resource_id>.<ext>' ] for rule in compat_folder_rules: _compat_bp.add_url_rule(rule, 'folder', compat_folder) for rule in compat_attachment_rules: _compat_bp.add_url_rule(rule, 'attachment', compat_attachment) _compat_bp.add_url_rule('!/getFile.py/access', 'getfile', make_compat_redirect_func(_compat_bp, 'attachment', view_args_conv={'confId': 'event_id', 'sessionId': 'session_id', 'contribId': 'contrib_id', 'subContId': 'subcontrib_id', 'materialId': 'material_id', 'resId': 'resource_id'})) _compat_bp.add_url_rule('!/materialDisplay.py', 'materialdisplay', compat_folder_old)
blueprint.add_url_rule('/event/<confId>/collaboration/agreement', 'elecAgreeForm', handlers.RHElectronicAgreementForm) # Manage event blueprint.add_url_rule('/event/<confId>/manage/collaboration/', 'confModifCollaboration', handlers.RHConfModifCSBookings, methods=('GET', 'POST')) blueprint.add_url_rule('/event/<confId>/manage/collaboration/<tab>/', 'confModifCollaboration', handlers.RHConfModifCSBookings, methods=('GET', 'POST')) blueprint.add_url_rule('/event/<confId>/manage/collaboration/managers', 'confModifCollaboration-managers', handlers.RHConfModifCSProtection) # Display event blueprint.add_url_rule('/event/<confId>/collaboration', 'collaborationDisplay', handlers.RHCollaborationDisplay) # Collaboration admin blueprint.add_url_rule('/admin/collaboration', 'adminCollaboration', handlers.RHAdminCollaboration) # htdocs blueprint.add_url_rule('/Collaboration/<plugin>/<path:filepath>', 'htdocs', RHCollaborationHtdocs) blueprint.add_url_rule('/Collaboration/<path:filepath>', 'htdocs', RHCollaborationHtdocs) # we can't use make_compat_blueprint here because the old url doesn't end in .py compat = IndicoBlueprint('compat_collaboration', __name__) compat.add_url_rule('/collaborationDisplay.py', 'collaborationDisplay', make_compat_redirect_func(blueprint, 'collaborationDisplay')) compat.add_url_rule('/Collaboration/elecAgree', 'elecAgree', make_compat_redirect_func(blueprint, 'elecAgree')) compat.add_url_rule('/Collaboration/elecAgreeForm', 'elecAgreeForm', make_compat_redirect_func(blueprint, 'elecAgreeForm'))
_bp.add_url_rule('/css', 'upload_css', RHLayoutCSSUpload, methods=('POST',)) _bp.add_url_rule('/css', 'delete_css', RHLayoutCSSDelete, methods=('DELETE',)) _bp.add_url_rule('/logo', 'upload_logo', RHLayoutLogoUpload, methods=('POST',)) _bp.add_url_rule('/logo', 'delete_logo', RHLayoutLogoDelete, methods=('DELETE',)) _bp.add_url_rule('/images/', 'images', RHImages) _bp.add_url_rule('/images/upload', 'images_upload', RHImageUpload, methods=('POST',)) _bp.add_url_rule('/images/<int:image_id>-<filename>', 'image_delete', RHImageDelete, methods=('DELETE',)) _bp.add_url_rule('!/event/<confId>/<slug>.css', 'css_display', RHLayoutCSSDisplay) _bp_images = IndicoBlueprint('event_images', __name__, template_folder='templates', virtual_template_folder='events/layout', url_prefix='/event/<confId>') _bp_images.add_url_rule('/logo-<slug>.png', 'logo_display', RHLogoDisplay) _bp_images.add_url_rule('/images/<int:image_id>-<filename>', 'image_display', RHImageDisplay) _bp_pages = IndicoBlueprint('event_pages', __name__, template_folder='templates', virtual_template_folder='events/layout', url_prefix='/event/<confId>') _bp_pages.add_url_rule('/page/<int:page_id>-<slug>', 'page_display', RHPageDisplay) _compat_bp = IndicoBlueprint('compat_layout', __name__, url_prefix='/event/<event_id>') _compat_bp.add_url_rule('!/internalPage.py', 'page_modpython', make_compat_redirect_func(_compat_bp, 'page', view_args_conv={'confId': 'event_id', 'pageId': 'legacy_page_id'})) _compat_bp.add_url_rule('/page/<int:legacy_page_id>', 'page', compat_page) _compat_bp.add_url_rule('/picture/<int:legacy_image_id>.<image_ext>', 'image', compat_image) _compat_bp.add_url_rule('/picture/<int:legacy_image_id>', 'image', compat_image) _compat_bp.add_url_rule('!/conferenceDisplay.py/getPic', 'image_modpython', make_compat_redirect_func(_compat_bp, 'image', view_args_conv={'confId': 'event_id', 'picId': 'legacy_image_id'}))
_bp.add_url_rule('/event/create/<any(lecture,meeting,conference):event_type>', 'create', RHCreateEvent, methods=('GET', 'POST')) # Main entry points supporting shortcut URLs # /e/ accepts slashes, /event/ doesn't - this is intended. We do not want to support slashes in the old namespace # since it's a major pain in the ass to do so (and its route would eat anything that's usually a 404) _bp.add_url_rule('/e/<path:event_id>', 'shorturl', event_or_shorturl, strict_slashes=False, defaults={'shorturl_namespace': True}) # XXX: these two entries below use a string event_id on purpose, since they need to handle shortcuts # and possibly legacy ids as well _bp.add_url_rule('/event/<event_id>/', 'display', event_or_shorturl) _bp.add_url_rule('/event/<event_id>/overview', 'display_overview', event_or_shorturl, defaults={'force_overview': True}) _bp.add_url_rule('/event/<int:event_id>/other-view', 'display_other', redirect_view('timetable.timetable')) # Misc _bp.add_url_rule('/event/<int:event_id>/key-access', 'key_access', RHEventAccessKey, methods=('POST',)) _bp.add_url_rule('/event/<int:event_id>/event.marc.xml', 'marcxml', RHEventMarcXML) # Legacy URLs _compat_bp = IndicoBlueprint('compat_events', __name__) _compat_bp.add_url_rule('/conferenceDisplay.py', 'display_modpython', make_compat_redirect_func(_bp, 'display')) _compat_bp.add_url_rule('/conferenceOtherViews.py', 'display_other_modpython', make_compat_redirect_func(_bp, 'display_other')) _compat_bp.add_url_rule('/conferenceDisplay.py/overview', 'display_overview_modpython', make_compat_redirect_func(_bp, 'display_overview')) _compat_bp.add_url_rule('/event/<int:event_id>/my-conference/', 'display_mystuff', make_compat_redirect_func(_bp, 'display')) _compat_bp.add_url_rule('/myconference.py', 'display_mystuff_modpython', make_compat_redirect_func(_bp, 'display'))
_bp.add_url_rule('/event/<confId>/event.ics', 'export_event_ical', RHExportEventICAL) # Creation _bp.add_url_rule('/event/create/<any(lecture,meeting,conference):event_type>', 'create', RHCreateEvent, methods=('GET', 'POST')) # Main entry points supporting shortcut URLs # /e/ accepts slashes, /event/ doesn't - this is intended. We do not want to support slashes in the old namespace # since it's a major pain in the ass to do so (and its route would eat anything that's usually a 404) _bp.add_url_rule('/e/<path:confId>', 'shorturl', event_or_shorturl, strict_slashes=False, defaults={'shorturl_namespace': True}) _bp.add_url_rule('/event/<confId>/', 'display', event_or_shorturl) _bp.add_url_rule('/event/<confId>/overview', 'display_overview', event_or_shorturl, defaults={'force_overview': True}) _bp.add_url_rule('/event/<confId>/other-view', 'display_other', redirect_view('timetable.timetable')) # Misc _bp.add_url_rule('/event/<confId>/key-access', 'key_access', RHEventAccessKey, methods=('POST',)) _bp.add_url_rule('/event/<confId>/event.marc.xml', 'marcxml', RHEventMarcXML) # Legacy URLs _compat_bp = IndicoBlueprint('compat_events', __name__) _compat_bp.add_url_rule('/conferenceDisplay.py', 'display_modpython', make_compat_redirect_func(_bp, 'display')) _compat_bp.add_url_rule('/conferenceOtherViews.py', 'display_other_modpython', make_compat_redirect_func(_bp, 'display_other')) _compat_bp.add_url_rule('/conferenceDisplay.py/overview', 'display_overview_modpython', make_compat_redirect_func(_bp, 'display_overview')) _compat_bp.add_url_rule('/event/<confId>/my-conference/', 'display_mystuff', make_compat_redirect_func(_bp, 'display')) _compat_bp.add_url_rule('/myconference.py', 'display_mystuff_modpython', make_compat_redirect_func(_bp, 'display'))
_bp.add_url_rule('/registrations/<int:reg_form_id>/', 'display_regform', RHRegistrationForm, methods=('GET', 'POST')) _bp.add_url_rule('/registrations/<int:reg_form_id>/edit', 'edit_registration_display', RHRegistrationDisplayEdit, methods=('GET', 'POST')) _bp.add_url_rule('/registrations/<int:reg_form_id>/check-email', 'check_email', RHRegistrationFormCheckEmail) _bp.add_url_rule('/registrations/<int:reg_form_id>/decline-invitation', 'decline_invitation', RHRegistrationFormDeclineInvitation, methods=('POST',)) _bp.add_url_rule('/registrations/<int:reg_form_id>/ticket.pdf', 'ticket_download', RHTicketDownload) # API _bp.add_url_rule('!/api/events/<int:event_id>/registrants/<int:registrant_id>', 'api_registrant', RHAPIRegistrant, methods=('GET', 'PATCH')) _bp.add_url_rule('!/api/events/<int:event_id>/registrants', 'api_registrants', RHAPIRegistrants) # Participants _bp_participation = IndicoBlueprint('event_participation', __name__, url_prefix='/event/<confId>', template_folder='templates', virtual_template_folder='events/registration') _bp_participation.add_url_rule('/manage/participants/', 'manage', RHManageParticipants, methods=('GET', 'POST')) # Legacy URLs _compat_bp = IndicoBlueprint('compat_event_registration', __name__, url_prefix='/event/<int:event_id>') _compat_bp.add_url_rule('/registration/', 'registration', compat_registration) _compat_bp.add_url_rule('/registration/<path:path>', 'registration', compat_registration) _compat_bp.add_url_rule('/registration/registrants', 'registrants', make_compat_redirect_func(_bp, 'participant_list', view_args_conv={'event_id': 'confId'})) _compat_bp.add_url_rule('!/confRegistrantsDisplay.py/list', 'registrants_modpython', make_compat_redirect_func(_bp, 'participant_list'))
# XXX: these two entries below use a string event_id on purpose, since they need to handle shortcuts # and possibly legacy ids as well _bp.add_url_rule('/event/<event_id>/', 'display', event_or_shorturl) _bp.add_url_rule('/event/<event_id>/overview', 'display_overview', event_or_shorturl, defaults={'force_overview': True}) _bp.add_url_rule('/event/<int:event_id>/other-view', 'display_other', redirect_view('timetable.timetable')) # Misc _bp.add_url_rule('/event/<int:event_id>/key-access', 'key_access', RHEventAccessKey, methods=('POST', )) # Legacy URLs _compat_bp = IndicoBlueprint('compat_events', __name__) _compat_bp.add_url_rule('/conferenceDisplay.py', 'display_modpython', make_compat_redirect_func(_bp, 'display')) _compat_bp.add_url_rule('/conferenceOtherViews.py', 'display_other_modpython', make_compat_redirect_func(_bp, 'display_other')) _compat_bp.add_url_rule('/conferenceDisplay.py/overview', 'display_overview_modpython', make_compat_redirect_func(_bp, 'display_overview')) _compat_bp.add_url_rule('/event/<int:event_id>/my-conference/', 'display_mystuff', make_compat_redirect_func(_bp, 'display')) _compat_bp.add_url_rule('/myconference.py', 'display_mystuff_modpython', make_compat_redirect_func(_bp, 'display'))
reviewing.RHEditAbstractComment, methods=('GET', 'POST'), defaults=defaults) _bp.add_url_rule(prefix + '/<int:abstract_id>/comments/<int:comment_id>', 'delete_abstract_comment', reviewing.RHDeleteAbstractComment, methods=('DELETE',), defaults=defaults) @_bp.url_defaults def _add_management_flag(endpoint, values): if ('management' not in values and endpoint.split('.')[0] == _bp.name and current_app.url_map.is_endpoint_expecting(endpoint, 'management')): values['management'] = g.rh.management # Legacy URLs - display _compat_bp = IndicoBlueprint('compat_abstracts', __name__, url_prefix='/event/<int:confId>') _compat_bp.add_url_rule('/call-for-abstracts/', 'cfa', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/my-abstracts', 'mine', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/my-abstracts.pdf', 'mine_pdf', make_compat_redirect_func(_bp, 'my_abstracts_pdf')) _compat_bp.add_url_rule('/call-for-abstracts/submit', 'submit', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/<int:friendly_id>/', 'abstract', partial(compat_abstract, 'display_abstract')) _compat_bp.add_url_rule('/call-for-abstracts/<int:friendly_id>/Abstract.pdf', 'abstract_pdf', partial(compat_abstract, 'display_abstract_pdf_export')) _compat_bp.add_url_rule('/abstract-book.pdf', 'boa', make_compat_redirect_func(_bp, 'export_boa')) # Legacy URLs - management _compat_bp.add_url_rule('/manage/call-for-abstracts/abstracts/', 'manage_cfa', make_compat_redirect_func(_bp, 'manage_abstract_list')) _compat_bp.add_url_rule('/manage/call-for-abstracts/abstracts/<int:friendly_id>/', 'manage_abstract',
methods=('GET', 'PATCH')) _bp.add_url_rule('!/api/events/<int:event_id>/registrants', 'api_registrants', api.RHAPIRegistrants) _bp.add_url_rule('/api/registration-forms', 'api_registration_forms', api.RHAPIRegistrationForms) # Participants _bp_participation = IndicoBlueprint( 'event_participation', __name__, url_prefix='/event/<int:event_id>', template_folder='templates', virtual_template_folder='events/registration') _bp_participation.add_url_rule('/manage/participants/', 'manage', regforms.RHManageParticipants, methods=('GET', 'POST')) # Legacy URLs _compat_bp = IndicoBlueprint('compat_event_registration', __name__, url_prefix='/event/<int:event_id>') _compat_bp.add_url_rule('/registration/', 'registration', compat_registration) _compat_bp.add_url_rule('/registration/<path:path>', 'registration', compat_registration) _compat_bp.add_url_rule('/registration/registrants', 'registrants', make_compat_redirect_func(_bp, 'participant_list')) _compat_bp.add_url_rule('!/confRegistrantsDisplay.py/list', 'registrants_modpython', make_compat_redirect_func(_bp, 'participant_list'))
program_codes.RHAssignProgramCodesSessions, methods=('GET', 'POST')) _bp.add_url_rule('/program-codes/assign/session-blocks', 'assign_program_codes_session_blocks', program_codes.RHAssignProgramCodesSessionBlocks, methods=('GET', 'POST')) _bp.add_url_rule('/program-codes/assign/contributions', 'assign_program_codes_contributions', program_codes.RHAssignProgramCodesContributions, methods=('GET', 'POST')) _bp.add_url_rule('/program-codes/assign/subcontributions', 'assign_program_codes_subcontributions', program_codes.RHAssignProgramCodesSubContributions, methods=('GET', 'POST')) for object_type, prefixes in event_management_object_url_prefixes.iteritems(): if object_type == 'subcontribution': continue for prefix in prefixes: prefix = '!/event/<confId>' + prefix _bp.add_url_rule(prefix + '/show-non-inheriting', 'show_non_inheriting', protection.RHShowNonInheriting, defaults={'object_type': object_type}) _compat_bp = IndicoBlueprint('compat_event_management', __name__, url_prefix='/event/<confId>/manage') _compat_bp.add_url_rule('/general/', 'settings', make_compat_redirect_func(_bp, 'settings'))
methods=('GET', 'POST')) # Actions _bp.add_url_rule('/delete', 'delete', actions.RHDeleteEvent, methods=('GET', 'POST')) _bp.add_url_rule('/change-type', 'change_type', actions.RHChangeEventType, methods=('POST',)) _bp.add_url_rule('/lock', 'lock', actions.RHLockEvent, methods=('GET', 'POST')) _bp.add_url_rule('/unlock', 'unlock', actions.RHUnlockEvent, methods=('POST',)) _bp.add_url_rule('/move', 'move', actions.RHMoveEvent, methods=('POST',)) # Protection _bp.add_url_rule('/protection', 'protection', protection.RHEventProtection, methods=('GET', 'POST')) _bp.add_url_rule('/protection/acl', 'acl', protection.RHEventACL) _bp.add_url_rule('/protection/acl-message', 'acl_message', protection.RHEventACLMessage) # Cloning _bp.add_url_rule('/clone', 'clone', cloning.RHCloneEvent, methods=('GET', 'POST')) _bp.add_url_rule('/clone/preview', 'clone_preview', cloning.RHClonePreview, methods=('GET', 'POST')) # Posters _bp.add_url_rule('/print-poster/settings', 'poster_settings', posters.RHPosterPrintSettings, methods=('GET', 'POST')) _bp.add_url_rule('/print-poster/<int:template_id>/<uuid>', 'print_poster', posters.RHPrintEventPoster) for object_type, prefixes in event_management_object_url_prefixes.iteritems(): if object_type == 'subcontribution': continue for prefix in prefixes: prefix = '!/event/<confId>' + prefix _bp.add_url_rule(prefix + '/show-non-inheriting', 'show_non_inheriting', protection.RHShowNonInheriting, defaults={'object_type': object_type}) _compat_bp = IndicoBlueprint('compat_event_management', __name__, url_prefix='/event/<confId>/manage') _compat_bp.add_url_rule('/general/', 'settings', make_compat_redirect_func(_bp, 'settings'))
@_bp.route('/booking/<int:booking_id>/cancel/<date>') def booking_cancellation_link(booking_id, date): modal = 'booking-details:{}:{}'.format(booking_id, json.dumps({'cancel': date})) return redirect(url_for('rb.roombooking', modal=modal)) @_bp.route('/my-bookings') def my_bookings_link(): return redirect( url_for('rb.roombooking', path='calendar', view='list', my_bookings='true')) @_bp.route('/blocking/<int:blocking_id>') def blocking_link(blocking_id): return redirect( url_for('rb.roombooking', path='blockings', modal=f'blocking-details:{blocking_id}')) _compat_bp = IndicoBlueprint('compat_rb', __name__, url_prefix='/rooms') _compat_bp.add_url_rule('/booking/<location>/<int:booking_id>/', 'display_booking', make_compat_redirect_func(_bp, 'booking_link'))
defaults={'force_overview': True}) _bp.add_url_rule('/event/<int:event_id>/other-view', 'display_other', redirect_view('timetable.timetable')) # Misc _bp.add_url_rule('/event/<int:event_id>/key-access', 'key_access', RHEventAccessKey, methods=('POST', )) # Legacy URLs _compat_bp = IndicoBlueprint('compat_events', __name__) _compat_bp.add_url_rule( '/conferenceDisplay.py', 'display_modpython', make_compat_redirect_func(_bp, 'display', view_args_conv={'confId': 'event_id'})) _compat_bp.add_url_rule( '/conferenceOtherViews.py', 'display_other_modpython', make_compat_redirect_func(_bp, 'display_other', view_args_conv={'confId': 'event_id'})) _compat_bp.add_url_rule( '/conferenceDisplay.py/overview', 'display_overview_modpython', make_compat_redirect_func(_bp, 'display_overview', view_args_conv={'confId': 'event_id'})) _compat_bp.add_url_rule( '/event/<int:event_id>/my-conference/', 'display_mystuff', make_compat_redirect_func(_bp, 'display',
_bp_pages = IndicoBlueprint('event_pages', __name__, template_folder='templates', virtual_template_folder='events/layout', url_prefix='/event/<confId>') _bp_pages.add_url_rule('/page/<int:page_id>-<slug>', 'page_display', RHPageDisplay) _compat_bp = IndicoBlueprint('compat_layout', __name__, url_prefix='/event/<event_id>') _compat_bp.add_url_rule( '!/internalPage.py', 'page_modpython', make_compat_redirect_func(_compat_bp, 'page', view_args_conv={ 'confId': 'event_id', 'pageId': 'legacy_page_id' })) _compat_bp.add_url_rule('/page/<int:legacy_page_id>', 'page', compat_page) _compat_bp.add_url_rule('/picture/<int:legacy_image_id>.<image_ext>', 'image', compat_image) _compat_bp.add_url_rule('/picture/<int:legacy_image_id>', 'image', compat_image) _compat_bp.add_url_rule( '!/conferenceDisplay.py/getPic', 'image_modpython', make_compat_redirect_func(_compat_bp, 'image', view_args_conv={ 'confId': 'event_id', 'picId': 'legacy_image_id' }))
reviewing.RHEditAbstractComment, methods=('GET', 'POST'), defaults=defaults) _bp.add_url_rule(prefix + '/<int:abstract_id>/comments/<int:comment_id>', 'delete_abstract_comment', reviewing.RHDeleteAbstractComment, methods=('DELETE',), defaults=defaults) @_bp.url_defaults def _add_management_flag(endpoint, values): if ('management' not in values and endpoint.split('.')[0] == _bp.name and current_app.url_map.is_endpoint_expecting(endpoint, 'management')): values['management'] = g.rh.management # Legacy URLs - display _compat_bp = IndicoBlueprint('compat_abstracts', __name__, url_prefix='/event/<int:event_id>') _compat_bp.add_url_rule('/call-for-abstracts/', 'cfa', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/my-abstracts', 'mine', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/my-abstracts.pdf', 'mine_pdf', make_compat_redirect_func(_bp, 'my_abstracts_pdf')) _compat_bp.add_url_rule('/call-for-abstracts/submit', 'submit', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/<int:friendly_id>/', 'abstract', partial(compat_abstract, 'display_abstract')) _compat_bp.add_url_rule('/call-for-abstracts/<int:friendly_id>/Abstract.pdf', 'abstract_pdf', partial(compat_abstract, 'display_abstract_pdf_export')) _compat_bp.add_url_rule('/abstract-book.pdf', 'boa', make_compat_redirect_func(_bp, 'export_boa')) # Legacy URLs - management _compat_bp.add_url_rule('/manage/call-for-abstracts/abstracts/', 'manage_cfa', make_compat_redirect_func(_bp, 'manage_abstract_list')) _compat_bp.add_url_rule('/manage/call-for-abstracts/abstracts/<int:friendly_id>/', 'manage_abstract',
# Session types _bp.add_url_rule('/manage/sessions/types/', 'manage_types', RHManageSessionTypes) _bp.add_url_rule('/manage/sessions/types/create', 'create_type', RHCreateSessionType, methods=('GET', 'POST')) _bp.add_url_rule('/manage/sessions/types/<int:session_type_id>', 'manage_type', RHEditSessionType, methods=('GET', 'POST')) _bp.add_url_rule('/manage/sessions/types/<int:session_type_id>/delete', 'delete_type', RHDeleteSessionType, methods=('POST',)) # Display _bp.add_url_rule('/sessions/mine', 'my_sessions', RHDisplaySessionList) _bp.add_url_rule('/sessions/<int:session_id>/', 'display_session', RHDisplaySession) _bp.add_url_rule('/sessions/<int:session_id>/session.ics', 'export_ics', RHExportSessionToICAL) _bp.add_url_rule('/sessions/<int:session_id>/session-timetable.pdf', 'export_session_timetable', RHExportSessionTimetableToPDF) # Legacy URLs _compat_bp = IndicoBlueprint('compat_sessions', __name__, url_prefix='/event/<event_id>') _compat_bp.add_url_rule('/session/<legacy_session_id>/', 'session', partial(compat_session, 'display_session')) _compat_bp.add_url_rule('/session/<legacy_session_id>/session.ics', 'session_ics', partial(compat_session, 'export_ics')) _compat_bp.add_url_rule('/my-conference/sessions', 'my_sessions', make_compat_redirect_func(_bp, 'my_sessions', view_args_conv={'event_id': 'confId'})) _compat_bp.add_url_rule('!/sessionDisplay.py', 'session_modpython', make_compat_redirect_func(_compat_bp, 'session', view_args_conv={'confId': 'event_id', 'sessionId': 'legacy_session_id'}))
) @_bp.url_defaults def _add_management_flag(endpoint, values): if ( "management" not in values and endpoint.split(".")[0] == _bp.name and current_app.url_map.is_endpoint_expecting(endpoint, "management") ): values["management"] = g.rh.management # Legacy URLs - display _compat_bp = IndicoBlueprint("compat_abstracts", __name__, url_prefix="/event/<int:confId>") _compat_bp.add_url_rule("/call-for-abstracts/", "cfa", make_compat_redirect_func(_bp, "call_for_abstracts")) _compat_bp.add_url_rule( "/call-for-abstracts/my-abstracts", "mine", make_compat_redirect_func(_bp, "call_for_abstracts") ) _compat_bp.add_url_rule( "/call-for-abstracts/my-abstracts.pdf", "mine_pdf", make_compat_redirect_func(_bp, "my_abstracts_pdf") ) _compat_bp.add_url_rule("/call-for-abstracts/submit", "submit", make_compat_redirect_func(_bp, "call_for_abstracts")) _compat_bp.add_url_rule( "/call-for-abstracts/<int:friendly_id>/", "abstract", partial(compat_abstract, "display_abstract") ) _compat_bp.add_url_rule( "/call-for-abstracts/<int:friendly_id>/Abstract.pdf", "abstract_pdf", partial(compat_abstract, "display_abstract_pdf_export"), )
_bp.add_url_rule('/import', 'import', cloning.RHImportFromEvent, methods=('GET', 'POST')) _bp.add_url_rule('/import/event-details', 'import_event_details', cloning.RHImportEventDetails, methods=('POST',)) # Posters _bp.add_url_rule('/print-poster/settings', 'poster_settings', posters.RHPosterPrintSettings, methods=('GET', 'POST')) _bp.add_url_rule('/print-poster/<int:template_id>/<uuid>', 'print_poster', posters.RHPrintEventPoster) # Program Codes _bp.add_url_rule('/program-codes/', 'program_codes', program_codes.RHProgramCodes) _bp.add_url_rule('/program-codes/templates', 'program_code_templates', program_codes.RHProgramCodeTemplates, methods=('GET', 'POST')) _bp.add_url_rule('/program-codes/assign/sessions', 'assign_program_codes_sessions', program_codes.RHAssignProgramCodesSessions, methods=('GET', 'POST')) _bp.add_url_rule('/program-codes/assign/session-blocks', 'assign_program_codes_session_blocks', program_codes.RHAssignProgramCodesSessionBlocks, methods=('GET', 'POST')) _bp.add_url_rule('/program-codes/assign/contributions', 'assign_program_codes_contributions', program_codes.RHAssignProgramCodesContributions, methods=('GET', 'POST')) _bp.add_url_rule('/program-codes/assign/subcontributions', 'assign_program_codes_subcontributions', program_codes.RHAssignProgramCodesSubContributions, methods=('GET', 'POST')) for object_type, prefixes in event_management_object_url_prefixes.items(): if object_type == 'subcontribution': continue for prefix in prefixes: prefix = '!/event/<int:event_id>' + prefix _bp.add_url_rule(prefix + '/show-non-inheriting', 'show_non_inheriting', protection.RHShowNonInheriting, defaults={'object_type': object_type}) _compat_bp = IndicoBlueprint('compat_event_management', __name__, url_prefix='/event/<int:event_id>/manage') _compat_bp.add_url_rule('/general/', 'settings', make_compat_redirect_func(_bp, 'settings'))
RHLegacyTimetableAddBreak, methods=('GET', 'POST')) _bp.add_url_rule('/add-contribution', 'add_contribution', RHLegacyTimetableAddContribution, methods=('GET', 'POST')) _bp.add_url_rule('/add-session-block', 'add_session_block', RHLegacyTimetableAddSessionBlock, methods=('GET', 'POST')) _bp.add_url_rule('/clone-contribution', 'clone_contribution', RHCloneContribution, methods=('POST', )) # Display _bp.add_url_rule('/timetable/', 'timetable', RHTimetable) _bp.add_url_rule('/timetable/pdf', 'export_pdf', RHTimetableExportPDF, methods=('GET', 'POST')) _bp.add_url_rule('/timetable/timetable.pdf', 'export_default_pdf', RHTimetableExportDefaultPDF) _bp.add_url_rule('/timetable/entry/<int:entry_id>/info', 'entry_info', RHTimetableEntryInfo) # Legacy URLs _compat_bp = IndicoBlueprint('compat_timetable', __name__) _compat_bp.add_url_rule('/conferenceTimeTable.py', 'timetable_modpython', make_compat_redirect_func(_bp, 'timetable'))
'/contribution/<legacy_contribution_id>', 'contribution', partial(compat_contribution, 'display_contribution')) _compat_bp.add_url_rule('/contribution/<legacy_contribution_id>.ics', 'contribution_ics', partial(compat_contribution, 'export_ics')) _compat_bp.add_url_rule('/contribution/<legacy_contribution_id>.pdf', 'contribution_pdf', partial(compat_contribution, 'export_pdf')) _compat_bp.add_url_rule( '/contribution/<legacy_contribution_id>/<legacy_subcontribution_id>', 'subcontribution', compat_subcontribution) _compat_bp.add_url_rule( '/my-conference/contributions', 'my_contributions', make_compat_redirect_func(_bp, 'my_contributions', view_args_conv={'event_id': 'confId'})) _compat_bp.add_url_rule( '!/contributionDisplay.py', 'contribution_modpython', make_compat_redirect_func(_compat_bp, 'contribution', view_args_conv={ 'confId': 'event_id', 'contribId': 'legacy_contribution_id' })) _compat_bp.add_url_rule( '!/subContributionDisplay.py', 'subcontribution_modpython', make_compat_redirect_func(_compat_bp, 'subcontribution', view_args_conv={
_bp.add_url_rule('/login/', 'login', RHLogin, methods=('GET', 'POST')) _bp.add_url_rule('/login/<provider>/', 'login', RHLogin) _bp.add_url_rule('/login/<provider>/form', 'login_form', RHLoginForm) _bp.add_url_rule('/login/<provider>/link-account', 'link_account', RHLinkAccount, methods=('GET', 'POST')) _bp.add_url_rule('/logout/', 'logout', RHLogout) _bp.add_url_rule('/register/', 'register', RHRegister, methods=('GET', 'POST'), defaults={'provider': None}) _bp.add_url_rule('/register/<provider>', 'register', RHRegister, methods=('GET', 'POST')) _bp.add_url_rule('/reset-password/', 'resetpass', RHResetPassword, methods=('GET', 'POST')) _bp.add_url_rule('/admin/users/impersonate', 'admin_impersonate', RHAdminImpersonate, methods=('POST',)) with _bp.add_prefixed_rules('/user/<int:user_id>', '/user'): _bp.add_url_rule('/accounts/', 'accounts', RHAccounts, methods=('GET', 'POST')) _bp.add_url_rule('/accounts/<identity>/remove/', 'remove_account', RHRemoveAccount, methods=('POST',)) @_bp.url_defaults def _add_user_id(endpoint, values): if endpoint in {'auth.accounts', 'auth.remove_account'} and 'user_id' not in values: values['user_id'] = request.view_args.get('user_id') # Legacy URLs auth_compat_blueprint = _compat_bp = IndicoBlueprint('compat_auth', __name__) _compat_bp.add_url_rule('/user/login', 'login', make_compat_redirect_func(_bp, 'login')) _compat_bp.add_url_rule('/user/register', 'register', make_compat_redirect_func(_bp, 'register'))
_bp = IndicoBlueprint('auth', __name__, template_folder='templates', virtual_template_folder='auth') _bp.add_url_rule('/login/', 'login', RHLogin, methods=('GET', 'POST')) _bp.add_url_rule('/login/<provider>/', 'login', RHLogin) _bp.add_url_rule('/login/<provider>/form', 'login_form', RHLoginForm) _bp.add_url_rule('/login/<provider>/link-account', 'link_account', RHLinkAccount, methods=('GET', 'POST')) _bp.add_url_rule('/logout/', 'logout', RHLogout, methods=('GET', 'POST')) _bp.add_url_rule('/register/', 'register', RHRegister, methods=('GET', 'POST'), defaults={'provider': None}) _bp.add_url_rule('/register/<provider>', 'register', RHRegister, methods=('GET', 'POST')) _bp.add_url_rule('/reset-password/', 'resetpass', RHResetPassword, methods=('GET', 'POST')) with _bp.add_prefixed_rules('/user/<int:user_id>', '/user'): _bp.add_url_rule('/accounts/', 'accounts', RHAccounts, methods=('GET', 'POST')) _bp.add_url_rule('/accounts/<identity>/remove/', 'remove_account', RHRemoveAccount, methods=('POST',)) @_bp.url_defaults def _add_user_id(endpoint, values): if endpoint in {'auth.accounts', 'auth.remove_account'} and 'user_id' not in values: values['user_id'] = request.view_args.get('user_id') # Legacy URLs auth_compat_blueprint = _compat_bp = IndicoBlueprint('compat_auth', __name__) _compat_bp.add_url_rule('/user/login', 'login', make_compat_redirect_func(_bp, 'login')) _compat_bp.add_url_rule('/user/register', 'register', make_compat_redirect_func(_bp, 'register'))
@_bp.url_defaults def _add_management_flag(endpoint, values): if ('management' not in values and endpoint.split('.')[0] == _bp.name and current_app.url_map.is_endpoint_expecting( endpoint, 'management')): values['management'] = g.rh.management # Legacy URLs - display _compat_bp = IndicoBlueprint('compat_abstracts', __name__, url_prefix='/event/<int:confId>') _compat_bp.add_url_rule('/call-for-abstracts/', 'cfa', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/my-abstracts', 'mine', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/my-abstracts.pdf', 'mine_pdf', make_compat_redirect_func(_bp, 'my_abstracts_pdf')) _compat_bp.add_url_rule('/call-for-abstracts/submit', 'submit', make_compat_redirect_func(_bp, 'call_for_abstracts')) _compat_bp.add_url_rule('/call-for-abstracts/<int:friendly_id>/', 'abstract', partial(compat_abstract, 'display_abstract')) _compat_bp.add_url_rule( '/call-for-abstracts/<int:friendly_id>/Abstract.pdf', 'abstract_pdf', partial(compat_abstract, 'display_abstract_pdf_export')) _compat_bp.add_url_rule('/abstract-book.pdf', 'boa', make_compat_redirect_func(_bp, 'export_boa')) # Legacy URLs - management
methods=('GET', 'POST')) _bp.add_url_rule( '/event/<confId>/manage/videoconference/<service>/<int:event_vc_room_id>/remove', 'manage_vc_rooms_remove', RHVCManageEventRemove, methods=('POST', )) _bp.add_url_rule( '/event/<confId>/manage/videoconference/<service>/<int:event_vc_room_id>/refresh', 'manage_vc_rooms_refresh', RHVCManageEventRefresh, methods=('POST', )) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/attach/', 'manage_vc_rooms_search_form', RHVCManageAttach, methods=('GET', 'POST')) _bp.add_url_rule('/event/<confId>/manage/videoconference/<service>/search/', 'manage_vc_rooms_search', RHVCManageSearch) # Event page _bp.add_url_rule('/event/<confId>/videoconference/', 'event_videoconference', RHVCEventPage) # Legacy URLs vc_compat_blueprint = _compat_bp = IndicoBlueprint('compat_vc', __name__) vc_compat_blueprint.add_url_rule( '/event/<confId>/collaboration', 'collaboration', make_compat_redirect_func(_bp, 'event_videoconference')) vc_compat_blueprint.add_url_rule( '/collaborationDisplay.py', 'collaborationpy', make_compat_redirect_func(_bp, 'event_videoconference'))
## ## 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/>. import MaKaC.plugins.InstantMessaging.rh as handlers from indico.web.flask.util import make_compat_redirect_func from indico.web.flask.wrappers import IndicoBlueprint blueprint = IndicoBlueprint('instantmessaging', __name__) blueprint.add_url_rule('/event/<confId>/manage/chat/', 'confModifChat', handlers.RHChatFormModif) blueprint.add_url_rule('/event/<confId>/manage/chat/logs/<chatroom>', 'confModifChat-logs', handlers.RHChatSeeLogs) blueprint.add_url_rule('/event/<confId>/chat', 'conferenceInstantMessaging', handlers.RHInstantMessagingDisplay) blueprint.add_url_rule('/InstantMessaging/<path:filepath>', 'htdocs', handlers.RHInstantMessagingHtdocs) # we can't use make_compat_blueprint here because the old url doesn't end in .py compat = IndicoBlueprint('compat_instantmessaging', __name__) compat.add_url_rule('/confModifChat', 'confModifChat', make_compat_redirect_func(blueprint, 'confModifChat')) compat.add_url_rule('/confModifChat/logs', 'confModifChat-logs', make_compat_redirect_func(blueprint, 'confModifChat-logs')) compat.add_url_rule('/conferenceInstantMessaging', 'conferenceInstantMessaging', make_compat_redirect_func(blueprint, 'conferenceInstantMessaging'))