urls.py
80 lines
| 3.0 KiB
| text/x-python
|
PythonLexer
/ boards / urls.py
|
r1090 | from django.conf.urls import patterns, url | ||
|
r0 | from boards import views | ||
|
r89 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | ||
|
r652 | from boards.views import api, tag_threads, all_threads, \ | ||
|
r811 | settings, all_tags | ||
|
r551 | from boards.views.authors import AuthorsView | ||
|
r990 | from boards.views.notifications import NotificationView | ||
|
r718 | from boards.views.search import BoardSearchView | ||
|
r565 | from boards.views.static import StaticPageView | ||
|
r825 | from boards.views.preview import PostPreviewView | ||
|
r0 | |||
|
r1090 | |||
|
r122 | js_info_dict = { | ||
'packages': ('boards',), | ||||
} | ||||
|
r0 | urlpatterns = patterns('', | ||
# /boards/ | ||||
|
r542 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), | ||
|
r46 | # /boards/page/ | ||
|
r542 | url(r'^page/(?P<page>\w+)/$', all_threads.AllThreadsView.as_view(), | ||
name='index'), | ||||
|
r9 | |||
|
r46 | # /boards/tag/tag_name/ | ||
|
r542 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), | ||
name='tag'), | ||||
|
r46 | # /boards/tag/tag_id/page/ | ||
|
r542 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', | ||
tag_threads.TagView.as_view(), name='tag'), | ||||
|
r145 | |||
|
r46 | # /boards/thread/ | ||
|
r1086 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.normal.NormalThreadView.as_view(), | ||
|
r542 | name='thread'), | ||
|
r1086 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.gallery.GalleryThreadView.as_view(), | ||
|
r951 | name='thread_gallery'), | ||
|
r550 | |||
|
r547 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), | ||
|
r1069 | url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), | ||
|
r551 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), | ||
|
r156 | |||
|
r545 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), | ||
|
r565 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), | ||
|
r577 | name='staticpage'), | ||
|
r89 | |||
# RSS feeds | ||||
url(r'^rss/$', AllThreadsFeed()), | ||||
|
r1086 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), | ||
|
r89 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), | ||
|
r91 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), | ||
|
r1086 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), | ||
|
r122 | |||
|
r221 | # i18n | ||
|
r566 | url(r'^jsi18n/$', 'boards.views.cached_js_catalog', js_info_dict, | ||
name='js_info_dict'), | ||||
|
r221 | |||
# API | ||||
|
r1086 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), | ||
url(r'^api/diff_thread$', | ||||
|
r500 | api.api_get_threaddiff, name="get_thread_diff"), | ||
url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, | ||||
name='get_threads'), | ||||
|
r542 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), | ||
url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, | ||||
|
r502 | name='get_thread'), | ||
|
r566 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, | ||
name='add_post'), | ||||
|
r994 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, | ||
name='api_notifications'), | ||||
|
r500 | |||
|
r690 | # Search | ||
|
r718 | url(r'^search/$', BoardSearchView.as_view(), name='search'), | ||
|
r690 | |||
|
r990 | # Notifications | ||
url(r'^notifications/(?P<username>\w+)$', NotificationView.as_view(), name='notifications'), | ||||
|
r825 | # Post preview | ||
url(r'^preview/$', PostPreviewView.as_view(), name='preview') | ||||
|
r137 | ) | ||