From 8e974e374505c541bbae365b5d556d20dc04f629 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 26 Oct 2017 15:57:44 +1100 Subject: [PATCH] Set on every page --- lemoncurry/templates/lemoncurry/layout.html | 1 + lemoncurry/templatetags/lemoncurry_tags.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lemoncurry/templates/lemoncurry/layout.html b/lemoncurry/templates/lemoncurry/layout.html index 2914305..3fa1a38 100644 --- a/lemoncurry/templates/lemoncurry/layout.html +++ b/lemoncurry/templates/lemoncurry/layout.html @@ -1,6 +1,7 @@ {% load compress favtags lemoncurry_tags meta static %} {% site_name as site_name %}{% request_uri request as uri %} + {% if title %}{{ title }} ~ {% endif %}{{ site_name }} diff --git a/lemoncurry/templatetags/lemoncurry_tags.py b/lemoncurry/templatetags/lemoncurry_tags.py index 37bc703..c9c2017 100644 --- a/lemoncurry/templatetags/lemoncurry_tags.py +++ b/lemoncurry/templatetags/lemoncurry_tags.py @@ -30,14 +30,18 @@ def get_package_json(): @register.simple_tag -def request_uri(request): - return '{scheme}://{host}{path}'.format( +def request_origin(request): + return '{scheme}://{host}'.format( scheme=request.scheme, host=request.META['HTTP_HOST'], - path=request.path ) +@register.simple_tag +def request_uri(request): + return request_origin(request) + request.path + + @register.simple_tag def site_name(): return settings.LEMONCURRY_SITE_NAME