summaryrefslogtreecommitdiffstats
path: root/welco/urls.py
blob: 9712223ca23d2c68f9c2feeaf20c28b37e310950 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# welco - multichannel request processing
# Copyright (C) 2015  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 import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.decorators.cache import never_cache

from ckeditor import views as ckeditor_views

from . import apps
from .kb.views import kb_manager_required

import welco.views
import welco.contacts.views
import welco.kb.views


urlpatterns = [
    url(r'^$', welco.views.home, name='home'),
    url(r'^mail/$', welco.views.home_mail, name='home-mail'),
    url(r'^phone/$', welco.views.home_phone, name='home-phone'),
    url(r'^counter/$', welco.views.home_counter, name='home-counter'),
    url(r'^', include('welco.sources.phone.urls')),
    url(r'^', include('welco.sources.counter.urls')),
    url(r'^ajax/qualification$', welco.views.qualification, name='qualif-zone'),
    url(r'^ajax/remove-association/(?P<pk>\w+)$',
        welco.views.remove_association, name='ajax-remove-association'),
    url(r'^ajax/create-formdata/(?P<pk>\w+)$',
        welco.views.create_formdata, name='ajax-create-formdata'),

    url(r'^ajax/kb$', welco.kb.views.zone, name='kb-zone'),
    url(r'^kb/$', welco.kb.views.page_list, name='kb-home'),
    url(r'^kb/add/$', welco.kb.views.page_add, name='kb-page-add'),
    url(r'^kb/search/$', welco.kb.views.page_search, name='kb-page-search'),
    url(r'^kb/search/json/$', welco.kb.views.page_search_json, name='kb-page-search-json'),
    url(r'^kb/(?P<slug>[\w-]+)/$', welco.kb.views.page_detail, name='kb-page-view'),
    url(r'^ajax/kb/(?P<slug>[\w-]+)/$', welco.kb.views.page_detail_fragment, name='kb-page-fragment'),
    url(r'^kb/(?P<slug>[\w-]+)/edit$', welco.kb.views.page_edit, name='kb-page-edit'),
    url(r'^kb/(?P<slug>[\w-]+)/delete$', welco.kb.views.page_delete, name='kb-page-delete'),
    url(r'^kb/(?P<slug>[\w-]+)/history$', welco.kb.views.page_history, name='kb-page-history'),
    url(r'^kb/(?P<slug>[\w-]+)/version/(?P<version>\w+)/$', welco.kb.views.page_version, name='kb-page-version'),

    url(r'^ajax/contacts$', welco.contacts.views.zone, name='contacts-zone'),
    url(r'^contacts/search/json/$', welco.contacts.views.search_json, name='contacts-search-json'),
    url(r'^ajax/contacts/(?P<slug>[\w-]+)/$',
        welco.contacts.views.contact_detail_fragment, name='contact-page-fragment'),
    url(r'^contacts/add/$', welco.contacts.views.contact_add, name='contacts-add'),

    url(r'^ajax/summary/(?P<source_type>\w+)/(?P<source_pk>\w+)/$',
        welco.views.wcs_summary, name='wcs-summary'),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^logout/$', welco.views.logout, name='auth_logout'),
    url(r'^login/$', welco.views.login, name='auth_login'),
    url(r'^menu.json$', welco.views.menu_json, name='menu_json'),

    url(r'^ckeditor/upload/', kb_manager_required(ckeditor_views.upload), name='ckeditor_upload'),
    url(r'^ckeditor/browse/', never_cache(kb_manager_required(ckeditor_views.browse)), name='ckeditor_browse'),
]

if 'mellon' in settings.INSTALLED_APPS:
    urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls')))

# static and media files
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns = apps.register_urls(urlpatterns)