From 2f0eb454036c4b1e2d8c416f7a15cc4c1cdbc961 Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Wed, 14 Feb 2018 16:21:03 +0000 Subject: [PATCH] Ensure that we can always link to the apply homepage --- opentech/public/utils/context_processors.py | 3 +++ opentech/templates/includes/apply_button.html | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/opentech/public/utils/context_processors.py b/opentech/public/utils/context_processors.py index 25bc4c7cd..330053296 100644 --- a/opentech/public/utils/context_processors.py +++ b/opentech/public/utils/context_processors.py @@ -1,7 +1,10 @@ from django.conf import settings +from opentech.apply.home.models import ApplyHomePage + def global_vars(request): return { 'GOOGLE_TAG_MANAGER_ID': getattr(settings, 'GOOGLE_TAG_MANAGER_ID', None), + 'APPLY_SITE': ApplyHomePage.objects.first(), } diff --git a/opentech/templates/includes/apply_button.html b/opentech/templates/includes/apply_button.html index 477d0ed90..53c5218e4 100644 --- a/opentech/templates/includes/apply_button.html +++ b/opentech/templates/includes/apply_button.html @@ -1 +1,2 @@ -<a href="#" class="link link--fixed-apply">Apply</a> +{% load wagtailcore_tags %} +<a href="{% pageurl APPLY_SITE %}" class="link link--fixed-apply">Apply</a> -- GitLab