1 # This file is part of Indico.
2 # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
4 # Indico is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3 of the
7 # License, or (at your option) any later version.
9 # Indico is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with Indico; if not, see <http://www.gnu.org/licenses/>.
17 from __future__
import unicode_literals
19 from indico
.modules
.events
.notes
.controllers
import RHEditNote
20 from indico
.web
.flask
.wrappers
import IndicoBlueprint
23 _bp
= IndicoBlueprint('event_notes', __name__
, template_folder
='templates', virtual_template_folder
='events/notes',
24 url_prefix
='/event/<confId>')
26 _bp
.add_url_rule('/note', 'edit', RHEditNote
, methods
=('GET', 'POST', 'DELETE'), defaults
={'object_type': 'event'})
27 _bp
.add_url_rule('/session/<sessionId>/note', 'edit', RHEditNote
, defaults
={'object_type': 'session'},
28 methods
=('GET', 'POST', 'DELETE'))
30 with _bp
.add_prefixed_rules('/session/<sessionId>'):
31 _bp
.add_url_rule('/contribution/<contribId>/note', 'edit', RHEditNote
, defaults
={'object_type': 'contribution'},
32 methods
=('GET', 'POST', 'DELETE'))
33 _bp
.add_url_rule('/contribution/<contribId>/<subContId>/note', 'edit', RHEditNote
,
34 defaults
={'object_type': 'subcontribution'}, methods
=('GET', 'POST', 'DELETE'))