]> git.0d.be Git - chloro.git/blob - chloro/phyll/urls.py
do not include non-feed posts on homepage
[chloro.git] / chloro / phyll / urls.py
1 # chloro - personal space
2 # Copyright (C) 2019  Frederic Peters
3 #
4 # This program is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU Affero General Public License as published
6 # by the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 from functools import partial
18
19 import ckeditor.views as ckeditor_views
20 from django.contrib.admin.views.decorators import staff_member_required
21 from django.urls import path, re_path
22 from django.views.decorators.cache import never_cache
23
24 from . import views
25
26 staff_required = partial(staff_member_required, login_url='login')
27
28
29 urlpatterns = [
30     re_path(
31         r'^ckeditor/upload/',
32         staff_required(ckeditor_views.upload),
33         name='ckeditor_upload',
34     ),
35     re_path(
36         r'^ckeditor/browse/',
37         never_cache(staff_required(ckeditor_views.browse)),
38         name='ckeditor_browse',
39     ),
40     re_path(r'^(?P<slug>[\w:-]+)/edit/$', staff_required(views.NoteEditView.as_view())),
41     re_path(
42         r'^(?P<slug>[\w:-]+)/delete/$',
43         staff_required(views.NoteDeleteView.as_view()),
44     ),
45     re_path(r'^(?P<slug>[\w:-]+)/api-save/$', staff_required(views.NoteApiSaveView.as_view())),
46     path('ajax/upload/', staff_required(views.ajax_upload)),
47     path('ajax/newpage/', staff_required(views.ajax_new_page)),
48     path('ajax/search/', views.ajax_search, name='ajax-search'),
49     path('new-note/', staff_required(views.NoteAddView.as_view())),
50     re_path(r'^feeds/(?P<sub>[\w:-]+)/atom$', views.AtomFeed()),
51     path('feed/atom', views.AtomFeed()),
52     re_path(r'^tag/(?P<tag>[\w:-]+)/$', views.ListOnTagView.as_view()),
53     path('archives/', views.ArchivesView.as_view()),
54     re_path(
55         r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[\w:-]+)/$', views.NoteView.as_view()
56     ),
57     re_path(r'^(?P<slug>[\w:-]+)/$', views.NoteView.as_view()),
58     path('', views.HomeView.as_view()),
59 ]