Skip to content

Commit 5a4e9de

Browse files
committed
Remove the hardcoded " - WCF" from the title.
Export server_mode into the template context, and use it to conditionalize the addition of the server mode into the title. - Legacy-Id: 632
1 parent 705957c commit 5a4e9de

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

ietf/context_processors.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.conf import settings
2+
3+
def server_mode(request):
4+
return {'server_mode': settings.SERVER_MODE}
5+

ietf/settings.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
BASE_DIR + "/templates"
101101
)
102102

103+
TEMPLATE_CONTEXT_PROCESSORS = (
104+
'django.core.context_processors.auth',
105+
'django.core.context_processors.debug',
106+
'django.core.context_processors.i18n',
107+
'ietf.context_processors.server_mode',
108+
)
109+
103110
INSTALLED_APPS = (
104111
'django.contrib.auth',
105112
'django.contrib.contenttypes',

ietf/templates/base.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
55
{% endblock %}
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
7-
<head><title>{% block title %}IETF Data{% endblock %} - WCF</title>
8-
<link rel="icon" href="http://tools.ietf.org/images/django-ietf.png" />
7+
<head><title>{% block title %}IETF Data{% endblock %}{% ifnotequal server_mode "production" %} - {{ server_mode|upper }} MODE{% endifnotequal %}</title>
8+
{% ifnotequal server_mode "production" %}
9+
<link rel="icon" href="/images/ietf-dev-icon.bmp" />
10+
{% else %}
11+
<link rel="icon" href="/images/ietf-icon.bmp" />
12+
{% endifnotequal %}
913
{% block head %}{% endblock %}
1014
<style type="text/css"><!--
1115
{% block css %}{% endblock %}

0 commit comments

Comments
 (0)