##// END OF EJS Templates
Added tag 1.8.1 for changeset a6b9dd9547bd
Added tag 1.8.1 for changeset a6b9dd9547bd

File last commit:

r716:a6b9dd95 1.8.1 default
r717:9ff462d6 default
Show More
context_processors.py
29 lines | 824 B | text/x-python | PythonLexer
/ boards / context_processors.py
from boards import utils, settings
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
context['version'] = settings.VERSION
context['site_name'] = settings.SITE_NAME
return context