##// END OF EJS Templates
Moved imageboard settings to the boards settings module. Added setting to disable archive
Moved imageboard settings to the boards settings module. Added setting to disable archive

File last commit:

r716:a6b9dd95 1.8.1 default
r716:a6b9dd95 1.8.1 default
Show More
context_processors.py
29 lines | 824 B | text/x-python | PythonLexer
/ boards / context_processors.py
neko259
Moved imageboard settings to the boards settings module. Added setting to disable archive
r716 from boards import utils, settings
neko259
Implemented search over posts. Moved get_user and get_theme to utils module. Use context processors instead of creating context in the base view. Removed unused imports in some modules
r690 from boards.models import Post
from boards.models.post import SETTING_MODERATE
__author__ = 'neko259'
def user_and_ui_processor(request):
context = {}
user = utils.get_user(request)
context['user'] = user
context['tags'] = user.fav_tags.all()
context['posts_per_day'] = float(Post.objects.get_posts_per_day())
theme = utils.get_theme(request, user)
context['theme'] = theme
context['theme_css'] = 'css/' + theme + '/base_page.css'
# This shows the moderator panel
moderate = user.get_setting(SETTING_MODERATE)
if moderate == 'True':
context['moderator'] = user.is_moderator()
else:
context['moderator'] = False
neko259
Moved imageboard settings to the boards settings module. Added setting to disable archive
r716 context['version'] = settings.VERSION
context['site_name'] = settings.SITE_NAME
neko259
Implemented search over posts. Moved get_user and get_theme to utils module. Use context processors instead of creating context in the base view. Removed unused imports in some modules
r690
return context