add basic views to create/edit/delete notes
[chloro.git] / chloro / phyll / urls.py
index e1ae6d1..03fa5cd 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from django.conf.urls import url
+from django.contrib.admin.views.decorators import staff_member_required
+from django.views.decorators.cache import never_cache
+
+import ckeditor.views as ckeditor_views
 
 from . import views
 
 urlpatterns = [
+    url(
+        r'^ckeditor/upload/',
+        staff_member_required(ckeditor_views.upload, login_url='login'),
+        name='ckeditor_upload',
+    ),
+    url(
+        r'^ckeditor/browse/',
+        never_cache(staff_member_required(ckeditor_views.browse, login_url='login')),
+        name='ckeditor_browse',
+    ),
+    url(r'^(?P<slug>[\w:-]+)/edit/$', staff_member_required(views.NoteEditView.as_view(), login_url='login')),
+    url(
+        r'^(?P<slug>[\w:-]+)/delete/$',
+        staff_member_required(views.NoteDeleteView.as_view(), login_url='login'),
+    ),
+    url(r'^new-note/$', staff_member_required(views.NoteAddView.as_view(), login_url='login')),
     url(r'^(?P<slug>[\w:-]+)/$', views.NoteView.as_view()),
 ]