|
|
from django.conf.urls import patterns, url, include
|
|
|
from boards import views
|
|
|
from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed
|
|
|
from boards.views import api
|
|
|
|
|
|
js_info_dict = {
|
|
|
'packages': ('boards',),
|
|
|
}
|
|
|
|
|
|
urlpatterns = patterns('',
|
|
|
|
|
|
# /boards/
|
|
|
url(r'^$', views.index, name='index'),
|
|
|
# /boards/page/
|
|
|
url(r'^page/(?P<page>\w+)/$', views.index, name='index'),
|
|
|
|
|
|
url(r'^archive/$', views.archive, name='archive'),
|
|
|
url(r'^archive/page/(?P<page>\w+)/$', views.archive, name='archive'),
|
|
|
|
|
|
# login page
|
|
|
url(r'^login/$', views.login, name='login'),
|
|
|
|
|
|
# /boards/tag/tag_name/
|
|
|
url(r'^tag/(?P<tag_name>\w+)/$', views.tag, name='tag'),
|
|
|
# /boards/tag/tag_id/page/
|
|
|
url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', views.tag, name='tag'),
|
|
|
|
|
|
# /boards/tag/tag_name/unsubscribe/
|
|
|
url(r'^tag/(?P<tag_name>\w+)/subscribe/$', views.tag_subscribe,
|
|
|
name='tag_subscribe'),
|
|
|
# /boards/tag/tag_name/unsubscribe/
|
|
|
url(r'^tag/(?P<tag_name>\w+)/unsubscribe/$', views.tag_unsubscribe,
|
|
|
name='tag_unsubscribe'),
|
|
|
|
|
|
# /boards/thread/
|
|
|
url(r'^thread/(?P<post_id>\w+)/$', views.thread, name='thread'),
|
|
|
url(r'^thread/(?P<post_id>\w+)/(?P<mode>\w+)/$', views.thread, name='thread_mode'),
|
|
|
url(r'^settings/$', views.settings, name='settings'),
|
|
|
url(r'^tags/$', views.all_tags, name='tags'),
|
|
|
url(r'^captcha/', include('captcha.urls')),
|
|
|
url(r'^jump/(?P<post_id>\w+)/$', views.jump_to_post, name='jumper'),
|
|
|
url(r'^authors/$', views.authors, name='authors'),
|
|
|
url(r'^delete/(?P<post_id>\w+)/$', views.delete, name='delete'),
|
|
|
url(r'^ban/(?P<post_id>\w+)/$', views.ban, name='ban'),
|
|
|
|
|
|
url(r'^banned/$', views.you_are_banned, name='banned'),
|
|
|
url(r'^staticpage/(?P<name>\w+)/$', views.static_page, name='staticpage'),
|
|
|
|
|
|
# RSS feeds
|
|
|
url(r'^rss/$', AllThreadsFeed()),
|
|
|
url(r'^page/(?P<page>\w+)/rss/$', AllThreadsFeed()),
|
|
|
url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()),
|
|
|
url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()),
|
|
|
url(r'^thread/(?P<post_id>\w+)/rss/$', ThreadPostsFeed()),
|
|
|
|
|
|
# i18n
|
|
|
url(r'^jsi18n/$', 'boards.views.cached_js_catalog', js_info_dict, name='js_info_dict'),
|
|
|
|
|
|
# API
|
|
|
url(r'^api/post/(?P<post_id>\w+)/$', api.get_post, name="get_post"),
|
|
|
url(r'^api/diff_thread/(?P<thread_id>\w+)/(?P<last_update_time>\w+)/$',
|
|
|
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'),
|
|
|
|
|
|
)
|
|
|
|