summaryrefslogtreecommitdiffstats
path: root/combo/apps/assets/urls.py
blob: 38770b91cfaa4ff41b81f9ebcf043c58e3c671fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# combo - content management system
# Copyright (C) 2017-2018  Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from django.conf.urls import url, include

from combo.urls_utils import decorated_includes, manager_required

from . import views

assets_manager_urls = [
    url(r'^$', views.assets, name='combo-manager-assets'),
    url(r'^delete$', views.asset_delete, name='combo-manager-asset-delete'),
    url(r'^overwrite/$', views.asset_overwrite, name='combo-manager-asset-overwrite'),
    url(r'^upload/$', views.asset_upload, name='combo-manager-asset-upload'),
    url(r'^upload/(?P<key>[\w_:-]+)/$', views.slot_asset_upload, name='combo-manager-slot-asset-upload'),
    url(r'^delete/(?P<key>[\w_:-]+)/$', views.slot_asset_delete, name='combo-manager-slot-asset-delete'),
    url(r'^export/$', views.assets_export, name='combo-manager-assets-export'),
    url(r'^import/$', views.assets_import, name='combo-manager-assets-import'),
]

urlpatterns = [
    url(r'^assets/(?P<key>[\w_:-]+)$', views.serve_asset),
    url(r'^manage/assets/', decorated_includes(manager_required,
        include(assets_manager_urls))),
]