##// END OF EJS Templates
Add search view only if haystack enabled
neko259 -
r1479:20f15e36 default
parent child Browse files
Show More
@@ -1,87 +1,90 b''
1 from django.conf.urls import patterns, url
1 from django.conf.urls import patterns, url
2 #from django.views.i18n import javascript_catalog
2 #from django.views.i18n import javascript_catalog
3
3
4 import neboard
4 from boards import views
5 from boards import views
5 from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed
6 from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed
6 from boards.views import api, tag_threads, all_threads, \
7 from boards.views import api, tag_threads, all_threads, \
7 settings, all_tags, feed
8 settings, all_tags, feed
8 from boards.views.authors import AuthorsView
9 from boards.views.authors import AuthorsView
9 from boards.views.notifications import NotificationView
10 from boards.views.notifications import NotificationView
10 from boards.views.search import BoardSearchView
11 from boards.views.static import StaticPageView
11 from boards.views.static import StaticPageView
12 from boards.views.preview import PostPreviewView
12 from boards.views.preview import PostPreviewView
13 from boards.views.random import RandomImageView
13 from boards.views.random import RandomImageView
14 from boards.views.tag_gallery import TagGalleryView
14 from boards.views.tag_gallery import TagGalleryView
15 from boards.views.translation import cached_javascript_catalog
15 from boards.views.translation import cached_javascript_catalog
16
16
17
17
18 js_info_dict = {
18 js_info_dict = {
19 'packages': ('boards',),
19 'packages': ('boards',),
20 }
20 }
21
21
22 urlpatterns = patterns('',
22 urlpatterns = patterns('',
23 # /boards/
23 # /boards/
24 url(r'^$', all_threads.AllThreadsView.as_view(), name='index'),
24 url(r'^$', all_threads.AllThreadsView.as_view(), name='index'),
25
25
26 # /boards/tag/tag_name/
26 # /boards/tag/tag_name/
27 url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(),
27 url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(),
28 name='tag'),
28 name='tag'),
29
29
30 # /boards/thread/
30 # /boards/thread/
31 url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(),
31 url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(),
32 name='thread'),
32 name='thread'),
33 url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(),
33 url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(),
34 name='thread_gallery'),
34 name='thread_gallery'),
35 url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(),
35 url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(),
36 name='thread_tree'),
36 name='thread_tree'),
37 # /feed/
37 # /feed/
38 url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'),
38 url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'),
39
39
40 url(r'^settings/$', settings.SettingsView.as_view(), name='settings'),
40 url(r'^settings/$', settings.SettingsView.as_view(), name='settings'),
41 url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'),
41 url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'),
42 url(r'^authors/$', AuthorsView.as_view(), name='authors'),
42 url(r'^authors/$', AuthorsView.as_view(), name='authors'),
43
43
44 url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'),
44 url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'),
45 url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(),
45 url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(),
46 name='staticpage'),
46 name='staticpage'),
47
47
48 url(r'^random/$', RandomImageView.as_view(), name='random'),
48 url(r'^random/$', RandomImageView.as_view(), name='random'),
49 url(r'^tag/(?P<tag_name>\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'),
49 url(r'^tag/(?P<tag_name>\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'),
50
50
51 # RSS feeds
51 # RSS feeds
52 url(r'^rss/$', AllThreadsFeed()),
52 url(r'^rss/$', AllThreadsFeed()),
53 url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()),
53 url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()),
54 url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()),
54 url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()),
55 url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()),
55 url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()),
56 url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()),
56 url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()),
57
57
58 # i18n
58 # i18n
59 url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict,
59 url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict,
60 name='js_info_dict'),
60 name='js_info_dict'),
61
61
62 # API
62 # API
63 url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"),
63 url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"),
64 url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"),
64 url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"),
65 url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads,
65 url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads,
66 name='get_threads'),
66 name='get_threads'),
67 url(r'^api/tags/$', api.api_get_tags, name='get_tags'),
67 url(r'^api/tags/$', api.api_get_tags, name='get_tags'),
68 url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts,
68 url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts,
69 name='get_thread'),
69 name='get_thread'),
70 url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post,
70 url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post,
71 name='add_post'),
71 name='add_post'),
72 url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications,
72 url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications,
73 name='api_notifications'),
73 name='api_notifications'),
74 url(r'^api/preview/$', api.api_get_preview, name='preview'),
74 url(r'^api/preview/$', api.api_get_preview, name='preview'),
75 url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'),
75 url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'),
76
76
77 # Search
78 url(r'^search/$', BoardSearchView.as_view(), name='search'),
79
80 # Notifications
77 # Notifications
81 url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'),
78 url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'),
82 url(r'^notifications/$', NotificationView.as_view(), name='notifications'),
79 url(r'^notifications/$', NotificationView.as_view(), name='notifications'),
83
80
84 # Post preview
81 # Post preview
85 url(r'^preview/$', PostPreviewView.as_view(), name='preview')
82 url(r'^preview/$', PostPreviewView.as_view(), name='preview')
86
83
87 )
84 )
85
86 # Search
87 if 'haystack' in neboard.settings.INSTALLED_APPS:
88 from boards.views.search import BoardSearchView
89 urlpatterns.append(url(r'^search/$', BoardSearchView.as_view(), name='search'))
90
General Comments 0
You need to be logged in to leave comments. Login now