From cae4f3b563b2f9a6175f104c76226d46e4d5456f Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Wed, 26 Sep 2018 11:21:11 +0100
Subject: [PATCH] Make the funds use a consistent base template

---
 opentech/apply/funds/models/applications.py                 | 1 +
 .../funds/{fund_type.html => application_base.html}         | 6 +++---
 ...fund_type_landing.html => application_base_landing.html} | 0
 opentech/apply/funds/templates/funds/lab_type.html          | 2 +-
 opentech/apply/funds/templates/funds/lab_type_landing.html  | 2 +-
 opentech/apply/funds/templates/funds/round.html             | 2 +-
 opentech/apply/funds/templates/funds/round_landing.html     | 2 +-
 7 files changed, 8 insertions(+), 7 deletions(-)
 rename opentech/apply/funds/templates/funds/{fund_type.html => application_base.html} (86%)
 rename opentech/apply/funds/templates/funds/{fund_type_landing.html => application_base_landing.html} (100%)

diff --git a/opentech/apply/funds/models/applications.py b/opentech/apply/funds/models/applications.py
index 0d7e1b531..92e2c33ae 100644
--- a/opentech/apply/funds/models/applications.py
+++ b/opentech/apply/funds/models/applications.py
@@ -37,6 +37,7 @@ class ApplicationBaseManager(PageQuerySet):
 
 class ApplicationBase(EmailForm, WorkflowStreamForm):  # type: ignore
     is_createable = False
+    template = 'funds/application_base.html'
 
     # Adds validation around forms & workflows. Isn't on Workflow class due to not displaying workflow field on Round
     base_form_class = WorkflowFormAdminForm
diff --git a/opentech/apply/funds/templates/funds/fund_type.html b/opentech/apply/funds/templates/funds/application_base.html
similarity index 86%
rename from opentech/apply/funds/templates/funds/fund_type.html
rename to opentech/apply/funds/templates/funds/application_base.html
index 126f364f7..f3c0e80f6 100644
--- a/opentech/apply/funds/templates/funds/fund_type.html
+++ b/opentech/apply/funds/templates/funds/application_base.html
@@ -1,6 +1,6 @@
 {% extends "base.html" %}
 
-{% load wagtailcore_tags static i18n %}
+{% load wagtailcore_tags static i18n util_tags %}
 {# Dont include fixed apply button on this page #}
 {% block apply_button %}{% endblock %}
 {% block header_modifier %}header--light-bg{% endblock %}
@@ -23,8 +23,8 @@
 
 <div class="wrapper wrapper--medium wrapper--light-grey-bg wrapper--form">
     {% if not page.open_round and not page.start_date and not request.is_preview %}
-        {# the fund has no open rounds and we arent on a round page #}
-        <h3>{% trans "Sorry this fund is not accepting applications at the moment" %}</h3>
+        {# the page has no open rounds and we arent on a round page #}
+        <h3>{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applications at the moment{% endblocktrans %}</h3>
     {% else%}
         <form class="form" action="" method="POST" enctype="multipart/form-data">
             {{ form.media }}
diff --git a/opentech/apply/funds/templates/funds/fund_type_landing.html b/opentech/apply/funds/templates/funds/application_base_landing.html
similarity index 100%
rename from opentech/apply/funds/templates/funds/fund_type_landing.html
rename to opentech/apply/funds/templates/funds/application_base_landing.html
diff --git a/opentech/apply/funds/templates/funds/lab_type.html b/opentech/apply/funds/templates/funds/lab_type.html
index baf5e0176..a72feba69 100644
--- a/opentech/apply/funds/templates/funds/lab_type.html
+++ b/opentech/apply/funds/templates/funds/lab_type.html
@@ -1 +1 @@
-{% extends "funds/fund_type.html" %}
+{% extends "funds/application_base.html" %}
diff --git a/opentech/apply/funds/templates/funds/lab_type_landing.html b/opentech/apply/funds/templates/funds/lab_type_landing.html
index 1b73052e1..b6fcf631f 100644
--- a/opentech/apply/funds/templates/funds/lab_type_landing.html
+++ b/opentech/apply/funds/templates/funds/lab_type_landing.html
@@ -1 +1 @@
-{% extends "funds/fund_type_landing.html" %}
+{% extends "funds/application_base_landing.html" %}
diff --git a/opentech/apply/funds/templates/funds/round.html b/opentech/apply/funds/templates/funds/round.html
index 953606218..3b266d76d 100644
--- a/opentech/apply/funds/templates/funds/round.html
+++ b/opentech/apply/funds/templates/funds/round.html
@@ -1,4 +1,4 @@
-{% extends "funds/fund_type.html" %}
+{% extends "funds/application_base.html" %}
 
 {% block page_title %}{{ page.get_parent.title }}{% endblock %}
 
diff --git a/opentech/apply/funds/templates/funds/round_landing.html b/opentech/apply/funds/templates/funds/round_landing.html
index f4f585931..0ed5e7f0e 100644
--- a/opentech/apply/funds/templates/funds/round_landing.html
+++ b/opentech/apply/funds/templates/funds/round_landing.html
@@ -1,3 +1,3 @@
-{% extends "funds/fund_type_landing.html" %}
+{% extends "funds/application_base_landing.html" %}
 
 {% block page_title %}{{ page.get_parent.title }}{% endblock %}
-- 
GitLab