|
1 from django.views.generic import list_detail |
|
2 from django.views.generic import create_update |
|
3 from django.contrib.auth.models import User |
|
4 from django.conf.urls.defaults import * |
|
5 from django.conf import settings |
|
6 from cm.views import * |
|
7 from cm.views.create import * |
|
8 from cm.views.export import * |
|
9 from cm.views.texts import * |
|
10 from cm.views.user import * |
|
11 from cm.views.timezone import * |
|
12 from cm.views.site import * |
|
13 from cm.views.feeds import * |
|
14 from cm.views.notifications import * |
|
15 from cm.views import i18n |
|
16 |
|
17 urlpatterns = patterns('', |
|
18 ) |
|
19 |
|
20 urlpatterns += patterns('', |
|
21 url(r'^$', dashboard, name="index"), |
|
22 url(r'^text/$', text_list, name="text"), |
|
23 url(r'^settings/$', settingss, name="settings"), |
|
24 |
|
25 # system pages |
|
26 url(r'^i18n/setlang/(?P<lang_code>\w+)/$', i18n.set_language, name="setlang"), |
|
27 url(r'^unauthorized/$', unauthorized, name="unauthorized"), |
|
28 url(r'^timezone_set/$', timezone_set, name="timezone_set"), |
|
29 |
|
30 # user login/logout/profile pages |
|
31 url(r'^login/$', login, name="login"), |
|
32 url(r'^register/$', register, name="register"), |
|
33 url(r'^logout/$', logout, name="logout"), |
|
34 url(r'^profile/$', profile, name="profile"), |
|
35 |
|
36 # users |
|
37 url(r'^user/$', user_list, name="user"), |
|
38 url(r'^user/(?P<key>\w*)/activate/$', user_activate, name="user-activate"), |
|
39 url(r'^user/(?P<key>\w*)/suspend/$', user_suspend, name="user-suspend"), |
|
40 url(r'^user/(?P<key>\w*)/enable/$', user_enable, name="user-enable"), |
|
41 url(r'^user/(?P<key>\w*)/edit/$', user_edit, name="user-edit"), |
|
42 url(r'^user/-/edit/$', user_anon_edit, name="user-anon-edit"), |
|
43 url(r'^user/(?P<key>\w*)/contact/$', user_contact, name="user-contact"), |
|
44 url(r'^user/(?P<key>\w*)/send_invitation/$', user_send_invitation, name="user-send-invitation"), |
|
45 url(r'^user/add/$', user_add, name="user-add"), |
|
46 url(r'^user/mass-add/$', user_mass_add, name="user-mass-add"), |
|
47 |
|
48 # new texts |
|
49 url(r'^text/(?P<key>\w*)/share/$', text_share, name="text-share"), |
|
50 |
|
51 # text create |
|
52 url(r'^create/upload/$', text_create_upload, name="text-create-upload"), |
|
53 url(r'^create/content/$', text_create_content, name="text-create-content"), |
|
54 |
|
55 # text |
|
56 url(r'^text/(?P<key>\w*)/view/$', text_view, name="text-view"), |
|
57 url(r'^text/(?P<key>\w*)/edit/$', text_edit, name="text-edit"), |
|
58 url(r'^text/(?P<key>\w*)/pre_edit/$', text_pre_edit, name="text-preedit"), |
|
59 url(r'^text/(?P<key>\w*)/share/$', text_share, name="text-share"), |
|
60 url(r'^text/(?P<key>\w*)/settings/$', text_settings, name="text-settings"), |
|
61 url(r'^text/(?P<key>\w*)/history/$', text_history, name="text-history"), |
|
62 url(r'^text/(?P<key>\w*)/history-version/(?P<v1_nid>\d*)/$', text_history, name="text-history-version"), |
|
63 url(r'^text/(?P<key>\w*)/history/(?P<v1_nid>\w*)/(?P<v2_nid>\d*)/$', text_history, name="text-history-compare"), |
|
64 url(r'^text/(?P<key>\w*)/revert/(?P<v1_nid>\w*)/$', text_revert, name="text-revert"), |
|
65 url(r'^text/(?P<key>\w*)/attach/(?P<attach_key>\w*)/$', text_attach, name="text-attach"), |
|
66 url(r'^text/(?P<key>\w*)/delete/$', text_delete, name="text-delete"), |
|
67 url(r'^text/(?P<key>\w*)/export/(?P<format>\w*)/(?P<download>\w*)/(?P<whichcomments>\w*)/(?P<withcolor>\w*)/$', text_export, name="text-export"), |
|
68 url(r'^text/(?P<key>\w*)/history/$', text_history, name="text-history"), |
|
69 url(r'^text/(?P<key>\w*)/diff/(?P<id_v1>\w*)/(?P<id_v2>\w*)/$', text_diff, name="text-diff"), |
|
70 url(r'^text/(?P<key>\w*)/version/(?P<id_version>\w*)/$', text_version, name="text-version"), |
|
71 url(r'^text/(?P<key>\w*)/comments_frame/$', text_view_frame, name="text-view-comments-frame"), |
|
72 url(r'^text/(?P<key>\w*)/comments/$', text_view_comments, name="text-view-comments"), |
|
73 |
|
74 url(r'^text/(?P<key>\w*)/user/add/$', user_add, name="user-add-text"), |
|
75 url(r'^text/(?P<key>\w*)/user/mass-add/$', user_mass_add, name="user-mass-add-text"), |
|
76 |
|
77 # comments |
|
78 url(r'^text/(?P<key>\w*)/view/\?comment_key=(?P<id>\w*)$', text_view, name="text-view-show-comment"), |
|
79 |
|
80 # site |
|
81 url(r'^contact/', contact, name="contact"), |
|
82 url(r'^help/', help, name="help"), |
|
83 |
|
84 # notifications |
|
85 ## workspace notifications |
|
86 url(r'^notifications/$', notifications, name="notifications"), |
|
87 url(r'^notification/(?P<adminkey>\w*)/desactivate/$', desactivate_notification, name="desactivate-notification"), |
|
88 ## text notifications |
|
89 url(r'^text/(?P<key>\w*)/notifications/$', text_notifications, name="text-notifications"), |
|
90 |
|
91 # feeds |
|
92 ## workspace feeds |
|
93 url(r'^feed/(?P<key>\w*)/$', private_feed, name="private-feed"), |
|
94 url(r'^feed/$', public_feed, name="public-feed"), |
|
95 ## text feeds |
|
96 url(r'^text/(?P<key>\w*)/feed/$', text_feed, name="text-feed"), |
|
97 url(r'^text/(?P<key>\w*)/feed/(?P<private_feed_key>\w*)/$', text_feed_private, name="text-private-feed"), |
|
98 |
|
99 url(r'^wysiwyg-preview/(?P<format>\w*)/$', text_wysiwyg_preview, name="text-wysiwyg-preview"), |
|
100 ) |
|
101 |
|
102 # static pages |
|
103 urlpatterns += patterns('django.views.generic.simple', |
|
104 url(r'^help/format/$', 'direct_to_template', {'template': 'static/help_format.html'}, name='help-format'), |
|
105 ) |
|
106 |
|
107 |
|
108 if settings.DEBUG: # client experiments |
|
109 urlpatterns += patterns('django.views.generic.simple', |
|
110 url(r'anim_io_sync/$','direct_to_template', {'template': 'static/experiment/anim_io_sync.html'}, name='experiment-anim_io_sync'), |
|
111 url(r'test0/$','direct_to_template', {'template': 'static/experiment/test0.html'}, name='test0'), |
|
112 ) |
|
113 |
|
114 urlpatterns += patterns('', |
|
115 url(r'^client/$', client_exchange, name="text-client-exchange"), |
|
116 ) |
|
117 |
|
118 if settings.DEBUG: |
|
119 urlpatterns += patterns('', |
|
120 (r'^themedia/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), |
|
121 |
|
122 (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'src/cm/media/'}), |
|
123 (r'^robots.txt$', 'django.views.static.serve', {'document_root': 'src/cm/media/', 'path':'robots.txt'}), |
|
124 (r'^favicon.ico$', 'django.views.static.serve', {'document_root': 'src/cm/media/', 'path':'favicon.ico'}), |
|
125 |
|
126 ) |
|
127 |
|
128 js_info_dict = { |
|
129 'packages': ('cm', ), |
|
130 } |
|
131 |
|
132 urlpatterns += patterns('', |
|
133 (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), |
|
134 ) |