from django.conf.urls import patterns, url from django.views.i18n import javascript_catalog from boards import views from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed from boards.views import api, tag_threads, all_threads, \ settings, all_tags, feed from boards.views.authors import AuthorsView from boards.views.notifications import NotificationView from boards.views.search import BoardSearchView from boards.views.static import StaticPageView from boards.views.preview import PostPreviewView js_info_dict = { 'packages': ('boards',), } urlpatterns = patterns('', # /boards/ url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), # /boards/page/ url(r'^page/(?P\w+)/$', all_threads.AllThreadsView.as_view(), name='index'), # /boards/tag/tag_name/ url(r'^tag/(?P\w+)/$', tag_threads.TagView.as_view(), name='tag'), # /boards/tag/tag_id/page/ url(r'^tag/(?P\w+)/page/(?P\w+)/$', tag_threads.TagView.as_view(), name='tag'), # /boards/thread/ url(r'^thread/(?P\d+)/$', views.thread.NormalThreadView.as_view(), name='thread'), url(r'^thread/(?P\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), name='thread_gallery'), url(r'^thread/(?P\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), name='thread_tree'), # /feed/ url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), url(r'^feed/page/(?P\w+)/$', views.feed.FeedView.as_view(), name='feed'), url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), url(r'^tags/(?P\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), url(r'^authors/$', AuthorsView.as_view(), name='authors'), url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), url(r'^staticpage/(?P\w+)/$', StaticPageView.as_view(), name='staticpage'), # RSS feeds url(r'^rss/$', AllThreadsFeed()), url(r'^page/(?P\d+)/rss/$', AllThreadsFeed()), url(r'^tag/(?P\w+)/rss/$', TagThreadsFeed()), url(r'^tag/(?P\w+)/page/(?P\w+)/rss/$', TagThreadsFeed()), url(r'^thread/(?P\d+)/rss/$', ThreadPostsFeed()), # i18n url(r'^jsi18n/$', javascript_catalog, js_info_dict, name='js_info_dict'), # API url(r'^api/post/(?P\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\w+)/$', api.api_get_threads, name='get_threads'), url(r'^api/tags/$', api.api_get_tags, name='get_tags'), url(r'^api/thread/(?P\w+)/$', api.api_get_thread_posts, name='get_thread'), url(r'^api/add_post/(?P\w+)/$', api.api_add_post, name='add_post'), url(r'^api/notifications/(?P\w+)/$', api.api_get_notifications, name='api_notifications'), # Search url(r'^search/$', BoardSearchView.as_view(), name='search'), # Notifications url(r'^notifications/(?P\w+)$', NotificationView.as_view(), name='notifications'), # Post preview url(r'^preview/$', PostPreviewView.as_view(), name='preview') )