urls.py
93 lines
| 4.0 KiB
| text/x-python
|
PythonLexer
/ boards / urls.py
|
r1486 | from django.conf.urls import url | ||
|
r1986 | from django.urls import path | ||
from django.views.i18n import JavaScriptCatalog | ||||
|
r1090 | |||
|
r0 | from boards import views | ||
|
r89 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | ||
|
r1945 | from boards.views import api, tag_threads, all_threads, settings, feed, stickers | ||
|
r551 | from boards.views.authors import AuthorsView | ||
|
r1945 | from boards.views.landing import LandingView | ||
|
r990 | from boards.views.notifications import NotificationView | ||
|
r1945 | from boards.views.preview import PostPreviewView | ||
from boards.views.random import RandomImageView | ||||
from boards.views.search import BoardSearchView | ||||
|
r565 | from boards.views.static import StaticPageView | ||
|
r1566 | from boards.views.sync import get_post_sync_data, response_get, response_list | ||
|
r1419 | from boards.views.tag_gallery import TagGalleryView | ||
|
r1899 | from boards.views.utils import UtilsView | ||
|
r0 | |||
|
r122 | |||
|
r1486 | urlpatterns = [ | ||
|
r0 | # /boards/ | ||
|
r1732 | url(r'^all/$', all_threads.AllThreadsView.as_view(), name='index'), | ||
|
r9 | |||
|
r46 | # /boards/tag/tag_name/ | ||
|
r1962 | url(r'^tag/(?P<tag_name>[\w\d\']+)/$', tag_threads.TagView.as_view(), | ||
|
r542 | name='tag'), | ||
|
r1962 | url(r'^tag/(?P<tag_name>[\w\d\']+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), | ||
|
r145 | |||
|
r46 | # /boards/thread/ | ||
|
r1180 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(), | ||
|
r542 | name='thread'), | ||
|
r1180 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), | ||
|
r951 | name='thread_gallery'), | ||
|
r1180 | url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), | ||
name='thread_tree'), | ||||
|
r1165 | # /feed/ | ||
url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), | ||||
|
r550 | |||
|
r547 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), | ||
|
r1937 | url(r'^stickers/$', stickers.AliasesView.as_view(), name='stickers'), | ||
url(r'^stickers/(?P<category>\w+)/$', stickers.AliasesView.as_view(), name='stickers'), | ||||
|
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 | |||
|
r1246 | url(r'^random/$', RandomImageView.as_view(), name='random'), | ||
|
r1729 | url(r'^search/$', BoardSearchView.as_view(), name='search'), | ||
|
r1732 | url(r'^$', LandingView.as_view(), name='landing'), | ||
|
r1899 | url(r'^utils$', UtilsView.as_view(), name='utils'), | ||
|
r1246 | |||
|
r89 | # RSS feeds | ||
url(r'^rss/$', AllThreadsFeed()), | ||||
|
r1914 | url(r'^all/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 | ||
|
r1986 | path('jsi18n/', JavaScriptCatalog.as_view(packages=['boards']), name='js_info_dict'), | ||
|
r221 | |||
# API | ||||
|
r1086 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), | ||
|
r1191 | url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"), | ||
|
r500 | 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'), | ||||
|
r1217 | url(r'^api/preview/$', api.api_get_preview, name='preview'), | ||
|
r1340 | url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'), | ||
|
r1702 | url(r'^api/stickers/$', api.api_get_stickers, name='get_stickers'), | ||
|
r500 | |||
|
r1144 | # Sync protocol API | ||
|
r1566 | url(r'^api/sync/list/$', response_list, name='api_sync_list'), | ||
url(r'^api/sync/get/$', response_get, name='api_sync_get'), | ||||
|
r1144 | |||
|
r990 | # Notifications | ||
|
r1429 | url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'), | ||
url(r'^notifications/$', NotificationView.as_view(), name='notifications'), | ||||
|
r990 | |||
|
r825 | # Post preview | ||
|
r1486 | url(r'^preview/$', PostPreviewView.as_view(), name='preview'), | ||
|
r837 | url(r'^post_xml/(?P<post_id>\d+)$', get_post_sync_data, | ||
name='post_sync_data'), | ||||
|
r1486 | ] | ||
|
r1479 | |||