##// END OF EJS Templates
Need to manually join lazy strings in authors now
Need to manually join lazy strings in authors now

File last commit:

r1987:c91779e9 default
r1990:9be6ed3d default
Show More
urls.py
90 lines | 3.8 KiB | text/x-python | PythonLexer
from django.conf.urls import url
from django.urls import path
from django.views.i18n import JavaScriptCatalog
from boards import views
from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed
from boards.views import api, tag_threads, all_threads, settings, feed, stickers
from boards.views.authors import AuthorsView
from boards.views.landing import LandingView
from boards.views.notifications import NotificationView
from boards.views.preview import PostPreviewView
from boards.views.random import RandomImageView
from boards.views.search import BoardSearchView
from boards.views.static import StaticPageView
from boards.views.sync import get_post_sync_data, response_get, response_list
from boards.views.tag_gallery import TagGalleryView
from boards.views.utils import UtilsView
urlpatterns = [
# /boards/
path('all/', all_threads.AllThreadsView.as_view(), name='index'),
# /boards/tag/tag_name/
url(r'^tag/(?P<tag_name>[\w\d\']+)/', tag_threads.TagView.as_view(),
name='tag'),
url(r'^tag/(?P<tag_name>[\w\d\']+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'),
# /boards/thread/
path('thread/<int:post_id>/', views.thread.NormalThreadView.as_view(),
name='thread'),
path('thread/<int:post_id>/mode/gallery/', views.thread.GalleryThreadView.as_view(),
name='thread_gallery'),
path('thread/<int:post_id>/mode/tree/', views.thread.TreeThreadView.as_view(),
name='thread_tree'),
# /feed/
path('feed/', views.feed.FeedView.as_view(), name='feed'),
path('settings/', settings.SettingsView.as_view(), name='settings'),
path('stickers/', stickers.AliasesView.as_view(), name='stickers'),
path('stickers/<str:category>/', stickers.AliasesView.as_view(), name='stickers'),
path('authors/', AuthorsView.as_view(), name='authors'),
path('banned/', views.banned.BannedView.as_view(), name='banned'),
path('staticpage/<str:name>/', StaticPageView.as_view(), name='staticpage'),
path('random/', RandomImageView.as_view(), name='random'),
path('search/', BoardSearchView.as_view(), name='search'),
path('', LandingView.as_view(), name='landing'),
path('utils', UtilsView.as_view(), name='utils'),
# RSS feeds
path('rss/', AllThreadsFeed()),
path('all/rss/', AllThreadsFeed()),
url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()),
path('thread/<int:post_id>/rss/', ThreadPostsFeed()),
# i18n
path('jsi18n/', JavaScriptCatalog.as_view(packages=['boards']), name='js_info_dict'),
# API
url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"),
url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"),
url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads,
name='get_threads'),
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,
name='get_thread'),
url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post,
name='add_post'),
url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications,
name='api_notifications'),
url(r'^api/preview/$', api.api_get_preview, name='preview'),
url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'),
url(r'^api/stickers/$', api.api_get_stickers, name='get_stickers'),
# Sync protocol API
url(r'^api/sync/list/$', response_list, name='api_sync_list'),
url(r'^api/sync/get/$', response_get, name='api_sync_get'),
# Notifications
path('notifications/<str:username>/', NotificationView.as_view(), name='notifications'),
path('notifications/', NotificationView.as_view(), name='notifications'),
# Post preview
path('preview/', PostPreviewView.as_view(), name='preview'),
path('post_xml/<int:post_id>', get_post_sync_data,
name='post_sync_data'),
]