Show More
@@ -1,80 +1,81 b'' | |||||
1 | from django.conf.urls import patterns, url |
|
1 | from django.conf.urls import patterns, url | |
|
2 | from django.views.i18n import javascript_catalog | |||
2 |
|
3 | |||
3 | from boards import views |
|
4 | from boards import views | |
4 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed |
|
5 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | |
5 | from boards.views import api, tag_threads, all_threads, \ |
|
6 | from boards.views import api, tag_threads, all_threads, \ | |
6 | settings, all_tags |
|
7 | settings, all_tags | |
7 | from boards.views.authors import AuthorsView |
|
8 | from boards.views.authors import AuthorsView | |
8 | from boards.views.notifications import NotificationView |
|
9 | from boards.views.notifications import NotificationView | |
9 | from boards.views.search import BoardSearchView |
|
10 | from boards.views.search import BoardSearchView | |
10 | from boards.views.static import StaticPageView |
|
11 | from boards.views.static import StaticPageView | |
11 | from boards.views.preview import PostPreviewView |
|
12 | from boards.views.preview import PostPreviewView | |
12 |
|
13 | |||
13 |
|
14 | |||
14 | js_info_dict = { |
|
15 | js_info_dict = { | |
15 | 'packages': ('boards',), |
|
16 | 'packages': ('boards',), | |
16 | } |
|
17 | } | |
17 |
|
18 | |||
18 | urlpatterns = patterns('', |
|
19 | urlpatterns = patterns('', | |
19 | # /boards/ |
|
20 | # /boards/ | |
20 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), |
|
21 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), | |
21 | # /boards/page/ |
|
22 | # /boards/page/ | |
22 | url(r'^page/(?P<page>\w+)/$', all_threads.AllThreadsView.as_view(), |
|
23 | url(r'^page/(?P<page>\w+)/$', all_threads.AllThreadsView.as_view(), | |
23 | name='index'), |
|
24 | name='index'), | |
24 |
|
25 | |||
25 | # /boards/tag/tag_name/ |
|
26 | # /boards/tag/tag_name/ | |
26 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), |
|
27 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), | |
27 | name='tag'), |
|
28 | name='tag'), | |
28 | # /boards/tag/tag_id/page/ |
|
29 | # /boards/tag/tag_id/page/ | |
29 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', |
|
30 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', | |
30 | tag_threads.TagView.as_view(), name='tag'), |
|
31 | tag_threads.TagView.as_view(), name='tag'), | |
31 |
|
32 | |||
32 | # /boards/thread/ |
|
33 | # /boards/thread/ | |
33 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.normal.NormalThreadView.as_view(), |
|
34 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.normal.NormalThreadView.as_view(), | |
34 | name='thread'), |
|
35 | name='thread'), | |
35 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.gallery.GalleryThreadView.as_view(), |
|
36 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.gallery.GalleryThreadView.as_view(), | |
36 | name='thread_gallery'), |
|
37 | name='thread_gallery'), | |
37 |
|
38 | |||
38 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), |
|
39 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), | |
39 | url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), |
|
40 | url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), | |
40 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), |
|
41 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), | |
41 |
|
42 | |||
42 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), |
|
43 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), | |
43 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), |
|
44 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), | |
44 | name='staticpage'), |
|
45 | name='staticpage'), | |
45 |
|
46 | |||
46 | # RSS feeds |
|
47 | # RSS feeds | |
47 | url(r'^rss/$', AllThreadsFeed()), |
|
48 | url(r'^rss/$', AllThreadsFeed()), | |
48 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), |
|
49 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), | |
49 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), |
|
50 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), | |
50 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), |
|
51 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), | |
51 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), |
|
52 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), | |
52 |
|
53 | |||
53 | # i18n |
|
54 | # i18n | |
54 |
url(r'^jsi18n/$', |
|
55 | url(r'^jsi18n/$', javascript_catalog, js_info_dict, | |
55 | name='js_info_dict'), |
|
56 | name='js_info_dict'), | |
56 |
|
57 | |||
57 | # API |
|
58 | # API | |
58 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), |
|
59 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), | |
59 | url(r'^api/diff_thread$', |
|
60 | url(r'^api/diff_thread$', | |
60 | api.api_get_threaddiff, name="get_thread_diff"), |
|
61 | api.api_get_threaddiff, name="get_thread_diff"), | |
61 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, |
|
62 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, | |
62 | name='get_threads'), |
|
63 | name='get_threads'), | |
63 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), |
|
64 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), | |
64 | url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, |
|
65 | url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, | |
65 | name='get_thread'), |
|
66 | name='get_thread'), | |
66 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, |
|
67 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, | |
67 | name='add_post'), |
|
68 | name='add_post'), | |
68 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, |
|
69 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, | |
69 | name='api_notifications'), |
|
70 | name='api_notifications'), | |
70 |
|
71 | |||
71 | # Search |
|
72 | # Search | |
72 | url(r'^search/$', BoardSearchView.as_view(), name='search'), |
|
73 | url(r'^search/$', BoardSearchView.as_view(), name='search'), | |
73 |
|
74 | |||
74 | # Notifications |
|
75 | # Notifications | |
75 | url(r'^notifications/(?P<username>\w+)$', NotificationView.as_view(), name='notifications'), |
|
76 | url(r'^notifications/(?P<username>\w+)$', NotificationView.as_view(), name='notifications'), | |
76 |
|
77 | |||
77 | # Post preview |
|
78 | # Post preview | |
78 | url(r'^preview/$', PostPreviewView.as_view(), name='preview') |
|
79 | url(r'^preview/$', PostPreviewView.as_view(), name='preview') | |
79 |
|
80 | |||
80 | ) |
|
81 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now