Use WEBROOT setting for the 500 page home button

The home button on the 500 page currently links to "/" which is not
always the true app root, in settings we define a WEBROOT
variable so that we can inform the app of its actual location.

This patch uses that variable to set href location for the home link
on the 500 page, so it will be acurate for all cases.

To make this possible the load_conf template tag now returns conf
itself instead of conf.HORIZON_CONFIG giving the template access to
more of the settings including WEBROOT.

Change-Id: I9d42ac8eeb7f2bf558ba86440fd5ae85ef591568
Closes-Bug: 1427903
This commit is contained in:
Sam Betts 2015-03-30 13:55:28 +01:00
parent 2f7a2dd891
commit 48a257185b
2 changed files with 4 additions and 4 deletions

View File

@ -190,7 +190,7 @@ def jstemplate(parser, token):
@register.assignment_tag
def load_config():
return conf.HORIZON_CONFIG
return conf
@register.assignment_tag

View File

@ -1,7 +1,7 @@
{% load branding i18n staticfiles %}
{% load load_config from horizon %}
{% load_config as HORIZON_CONFIG %}
{% load_config as CONF %}
{% comment %}
@ -70,8 +70,8 @@
</div>
<div id="links">
{% block links %}
<p><a href="/">{% trans "Home" %}</a></p>
<p><a href="{{ HORIZON_CONFIG.help_url }}">{% trans "Help" %}</a></p>
<p><a href="{{ CONF.WEBROOT }}">{% trans "Home" %}</a></p>
<p><a href="{{ CONF.HORIZON_CONFIG.help_url }}">{% trans "Help" %}</a></p>
{% endblock %}
</div>
</div>