Show More
@@ -1,6 +1,7 b'' | |||||
1 | from boards.abstracts.settingsmanager import get_settings_manager, \ |
|
1 | from boards.abstracts.settingsmanager import get_settings_manager, \ | |
2 | SETTING_LAST_NOTIFICATION_ID, SETTING_IMAGE_VIEWER |
|
2 | SETTING_LAST_NOTIFICATION_ID, SETTING_IMAGE_VIEWER | |
3 | from boards.models.user import Notification |
|
3 | from boards.models.user import Notification | |
|
4 | from boards.models import Banner | |||
4 |
|
5 | |||
5 | __author__ = 'neko259' |
|
6 | __author__ = 'neko259' | |
6 |
|
7 | |||
@@ -23,6 +24,7 b" CONTEXT_HAS_FAV_THREADS = 'has_fav_threa" | |||||
23 | CONTEXT_POW_DIFFICULTY = 'pow_difficulty' |
|
24 | CONTEXT_POW_DIFFICULTY = 'pow_difficulty' | |
24 | CONTEXT_NEW_POST_COUNT = 'new_post_count' |
|
25 | CONTEXT_NEW_POST_COUNT = 'new_post_count' | |
25 | CONTEXT_SEARCH_ENABLED = 'search_enabled' |
|
26 | CONTEXT_SEARCH_ENABLED = 'search_enabled' | |
|
27 | CONTEXT_BANNERS = 'banners' | |||
26 |
|
28 | |||
27 |
|
29 | |||
28 | def get_notifications(context, request): |
|
30 | def get_notifications(context, request): | |
@@ -80,6 +82,7 b' def user_and_ui_processor(request):' | |||||
80 | len(settings_manager.get_fav_threads()) > 0 |
|
82 | len(settings_manager.get_fav_threads()) > 0 | |
81 |
|
83 | |||
82 | context[CONTEXT_SEARCH_ENABLED] = 'haystack' in neboard.settings.INSTALLED_APPS |
|
84 | context[CONTEXT_SEARCH_ENABLED] = 'haystack' in neboard.settings.INSTALLED_APPS | |
|
85 | context[CONTEXT_BANNERS] = Banner.objects.order_by('-id') | |||
83 |
|
86 | |||
84 | get_notifications(context, request) |
|
87 | get_notifications(context, request) | |
85 | get_new_post_count(context, request) |
|
88 | get_new_post_count(context, request) |
@@ -12,7 +12,7 b' from boards import utils, settings' | |||||
12 | from boards.abstracts.paginator import get_paginator |
|
12 | from boards.abstracts.paginator import get_paginator | |
13 | from boards.abstracts.settingsmanager import get_settings_manager |
|
13 | from boards.abstracts.settingsmanager import get_settings_manager | |
14 | from boards.forms import ThreadForm, PlainErrorList |
|
14 | from boards.forms import ThreadForm, PlainErrorList | |
15 |
from boards.models import Post, Thread, Ban |
|
15 | from boards.models import Post, Thread, Ban | |
16 | from boards.views.banned import BannedView |
|
16 | from boards.views.banned import BannedView | |
17 | from boards.views.base import BaseBoardView, CONTEXT_FORM |
|
17 | from boards.views.base import BaseBoardView, CONTEXT_FORM | |
18 | from boards.views.posting_mixin import PostMixin |
|
18 | from boards.views.posting_mixin import PostMixin | |
@@ -29,7 +29,6 b" TAG_DELIMITER = ' '" | |||||
29 | PARAMETER_CURRENT_PAGE = 'current_page' |
|
29 | PARAMETER_CURRENT_PAGE = 'current_page' | |
30 | PARAMETER_PAGINATOR = 'paginator' |
|
30 | PARAMETER_PAGINATOR = 'paginator' | |
31 | PARAMETER_THREADS = 'threads' |
|
31 | PARAMETER_THREADS = 'threads' | |
32 | PARAMETER_BANNERS = 'banners' |
|
|||
33 | PARAMETER_ADDITIONAL = 'additional_params' |
|
32 | PARAMETER_ADDITIONAL = 'additional_params' | |
34 | PARAMETER_MAX_FILE_SIZE = 'max_file_size' |
|
33 | PARAMETER_MAX_FILE_SIZE = 'max_file_size' | |
35 | PARAMETER_RSS_URL = 'rss_url' |
|
34 | PARAMETER_RSS_URL = 'rss_url' | |
@@ -80,7 +79,6 b' class AllThreadsView(PostMixin, FileUplo' | |||||
80 |
|
79 | |||
81 | params[PARAMETER_THREADS] = threads |
|
80 | params[PARAMETER_THREADS] = threads | |
82 | params[CONTEXT_FORM] = form |
|
81 | params[CONTEXT_FORM] = form | |
83 | params[PARAMETER_BANNERS] = Banner.objects.order_by('-id').all() |
|
|||
84 | params[PARAMETER_MAX_FILE_SIZE] = self.get_max_upload_size() |
|
82 | params[PARAMETER_MAX_FILE_SIZE] = self.get_max_upload_size() | |
85 | params[PARAMETER_RSS_URL] = self.get_rss_url() |
|
83 | params[PARAMETER_RSS_URL] = self.get_rss_url() | |
86 |
|
84 |
General Comments 0
You need to be logged in to leave comments.
Login now