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