urls.py
100 lines
| 4.1 KiB
| text/x-python
|
PythonLexer
/ boards / urls.py
neko259
|
r1486 | from django.conf.urls import url | ||
neko259
|
r1090 | |||
neko259
|
r1502 | import neboard | ||
neko259
|
r0 | from boards import views | ||
neko259
|
r89 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | ||
neko259
|
r652 | from boards.views import api, tag_threads, all_threads, \ | ||
neko259
|
r1701 | settings, all_tags, feed, alias | ||
neko259
|
r551 | from boards.views.authors import AuthorsView | ||
neko259
|
r990 | from boards.views.notifications import NotificationView | ||
neko259
|
r565 | from boards.views.static import StaticPageView | ||
neko259
|
r825 | from boards.views.preview import PostPreviewView | ||
neko259
|
r1566 | from boards.views.sync import get_post_sync_data, response_get, response_list | ||
neko259
|
r1246 | from boards.views.random import RandomImageView | ||
neko259
|
r1419 | from boards.views.tag_gallery import TagGalleryView | ||
neko259
|
r1393 | from boards.views.translation import cached_javascript_catalog | ||
neko259
|
r1729 | from boards.views.search import BoardSearchView | ||
neko259
|
r1732 | from boards.views.landing import LandingView | ||
neko259
|
r1899 | from boards.views.utils import UtilsView | ||
neko259
|
r0 | |||
neko259
|
r1090 | |||
neko259
|
r122 | js_info_dict = { | ||
'packages': ('boards',), | ||||
} | ||||
neko259
|
r1486 | urlpatterns = [ | ||
neko259
|
r0 | # /boards/ | ||
neko259
|
r1732 | url(r'^all/$', all_threads.AllThreadsView.as_view(), name='index'), | ||
Ilyas
|
r9 | |||
neko259
|
r46 | # /boards/tag/tag_name/ | ||
neko259
|
r542 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), | ||
name='tag'), | ||||
neko259
|
r145 | |||
neko259
|
r46 | # /boards/thread/ | ||
neko259
|
r1180 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(), | ||
neko259
|
r542 | name='thread'), | ||
neko259
|
r1180 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), | ||
neko259
|
r951 | name='thread_gallery'), | ||
neko259
|
r1180 | url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), | ||
name='thread_tree'), | ||||
neko259
|
r1165 | # /feed/ | ||
url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), | ||||
neko259
|
r550 | |||
neko259
|
r547 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), | ||
neko259
|
r1701 | url(r'^aliases/(?P<category>\w+)/$', alias.AliasesView.as_view(), name='aliases'), | ||
neko259
|
r1741 | url(r'^tags/$', all_tags.AllTagsView.as_view(), name='tags'), | ||
neko259
|
r551 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), | ||
neko259
|
r156 | |||
neko259
|
r545 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), | ||
neko259
|
r565 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), | ||
neko259
|
r577 | name='staticpage'), | ||
neko259
|
r89 | |||
neko259
|
r1246 | url(r'^random/$', RandomImageView.as_view(), name='random'), | ||
neko259
|
r1419 | url(r'^tag/(?P<tag_name>\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), | ||
neko259
|
r1729 | url(r'^search/$', BoardSearchView.as_view(), name='search'), | ||
neko259
|
r1732 | url(r'^$', LandingView.as_view(), name='landing'), | ||
neko259
|
r1899 | url(r'^utils$', UtilsView.as_view(), name='utils'), | ||
neko259
|
r1246 | |||
neko259
|
r89 | # RSS feeds | ||
url(r'^rss/$', AllThreadsFeed()), | ||||
neko259
|
r1914 | url(r'^all/rss/$', AllThreadsFeed()), | ||
neko259
|
r1086 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), | ||
neko259
|
r89 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), | ||
neko259
|
r91 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), | ||
neko259
|
r1086 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), | ||
neko259
|
r122 | |||
neko259
|
r221 | # i18n | ||
neko259
|
r1393 | url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict, | ||
neko259
|
r566 | name='js_info_dict'), | ||
neko259
|
r221 | |||
# API | ||||
neko259
|
r1086 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), | ||
neko259
|
r1191 | url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"), | ||
neko259
|
r500 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, | ||
name='get_threads'), | ||||
neko259
|
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, | ||||
neko259
|
r502 | name='get_thread'), | ||
neko259
|
r566 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, | ||
name='add_post'), | ||||
neko259
|
r994 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, | ||
name='api_notifications'), | ||||
neko259
|
r1217 | url(r'^api/preview/$', api.api_get_preview, name='preview'), | ||
neko259
|
r1340 | url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'), | ||
neko259
|
r1702 | url(r'^api/stickers/$', api.api_get_stickers, name='get_stickers'), | ||
neko259
|
r500 | |||
neko259
|
r1144 | # Sync protocol API | ||
neko259
|
r1566 | url(r'^api/sync/list/$', response_list, name='api_sync_list'), | ||
url(r'^api/sync/get/$', response_get, name='api_sync_get'), | ||||
neko259
|
r1144 | |||
neko259
|
r990 | # Notifications | ||
neko259
|
r1429 | url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'), | ||
url(r'^notifications/$', NotificationView.as_view(), name='notifications'), | ||||
neko259
|
r990 | |||
neko259
|
r825 | # Post preview | ||
neko259
|
r1486 | url(r'^preview/$', PostPreviewView.as_view(), name='preview'), | ||
neko259
|
r837 | url(r'^post_xml/(?P<post_id>\d+)$', get_post_sync_data, | ||
name='post_sync_data'), | ||||
neko259
|
r1486 | ] | ||
neko259
|
r1479 | |||