Commit 5204b6fc authored by Claude Paroz's avatar Claude Paroz

Add a custom context processor for the bug_url context variable

parent 1516d5a7
# -*- coding: utf-8 -*-
from django.conf import settings
def utils(request):
return {'bug_url': settings.ENTER_BUG_URL}
......@@ -37,7 +37,6 @@ def languages(request):
context = {
'pageSection': "languages",
'languages': utils.trans_sort_object_list(languages, 'name'),
'bug_url': settings.ENTER_BUG_URL,
}
return render(request, 'languages/language_list.html', context)
......
......@@ -101,6 +101,18 @@ TEMPLATE_LOADERS = (
'django.template.loaders.app_directories.Loader',
)
TEMPLATE_CONTEXT_PROCESSORS = (
# Default:
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.contrib.messages.context_processors.messages",
# Custom:
"common.context_processors.utils",
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
......
......@@ -43,7 +43,6 @@ def modules(request, format='html'):
context = {
'pageSection': "module",
'modules': utils.sort_object_list(all_modules, 'get_description'),
'bug_url': settings.ENTER_BUG_URL,
}
return render(request, 'module_list.html', context)
......@@ -245,7 +244,6 @@ def releases(request, format='html'):
'pageSection' : "releases",
'active_releases': active_releases,
'old_releases' : old_releases,
'bug_url' : settings.ENTER_BUG_URL,
}
return render(request, 'release_list.html', context)
......
......@@ -41,7 +41,6 @@ def teams(request, format='html'):
context = {
'pageSection': 'teams',
'teams': utils.trans_sort_object_list(teams, 'description'),
'bug_url': settings.ENTER_BUG_URL,
}
return render(request, 'teams/team_list.html', context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment