Corrected usage of the title block for the main_django template
ECOM-4610
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
""" Django template ontext processors. """
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from microsite_configuration import microsite
|
||||
|
||||
|
||||
def microsite_context(request): # pylint: disable=unused-argument
|
||||
return {
|
||||
'platform_name': microsite.get_value('platform_name', settings.PLATFORM_NAME)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
""" Tests for Django template context processors. """
|
||||
from django.test import TestCase
|
||||
from django.test.client import RequestFactory
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from microsite_configuration.context_processors import microsite_context
|
||||
|
||||
PLATFORM_NAME = 'Test Platform'
|
||||
|
||||
|
||||
@override_settings(PLATFORM_NAME=PLATFORM_NAME)
|
||||
class MicrositeContextProcessorTests(TestCase):
|
||||
""" Tests for the microsite context processor. """
|
||||
|
||||
def setUp(self):
|
||||
request = RequestFactory().get('/')
|
||||
self.context = microsite_context(request)
|
||||
|
||||
def test_platform_name(self):
|
||||
""" Verify the context includes the platform name. """
|
||||
self.assertEqual(self.context['platform_name'], PLATFORM_NAME)
|
||||
@@ -499,6 +499,7 @@ TEMPLATES = [
|
||||
'django.template.context_processors.i18n',
|
||||
'django.contrib.auth.context_processors.auth', # this is required for admin
|
||||
'django.template.context_processors.csrf',
|
||||
'microsite_configuration.context_processors.microsite_context',
|
||||
|
||||
# Added for django-wiki
|
||||
'django.template.context_processors.media',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<html lang="{{LANGUAGE_CODE}}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{% block title %}<title>{% platform_name %}</title>{% endblock %}
|
||||
<title>{% block title %}{{ platform_name }}{% endblock %}</title>
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="{% favicon_path %}" />
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
{% with online_help_token="wiki" %}
|
||||
{% load pipeline %}{% load sekizai_tags i18n microsite %}{% load url from future %}{% load staticfiles %}
|
||||
|
||||
{% block title %}<title>{% block pagetitle %}{% endblock %} | {% trans "Wiki" %} | {% platform_name %}</title>{% endblock %}
|
||||
{% block title %}
|
||||
{% block pagetitle %}{% endblock %} | {% trans "Wiki" %} | {% platform_name %}
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyclass %}view-in-course view-wiki{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user