From b90689d299a50fac96f04d3a06db48eda369fd3d Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Fri, 3 Aug 2018 11:38:06 +0100 Subject: [PATCH] Tidy up how the CTA and related objects appear with funds and rfps --- opentech/public/funds/models.py | 2 +- .../funds/templates/public_funds/fund_page.html | 2 +- opentech/templates/includes/relatedcontent_card.html | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/opentech/public/funds/models.py b/opentech/public/funds/models.py index 89806c9f1..1f0da502a 100644 --- a/opentech/public/funds/models.py +++ b/opentech/public/funds/models.py @@ -59,7 +59,7 @@ class BaseApplicationPage(BasePage): @property def deadline(self): - return self.application_type or self.application_type.specific.next_deadline() + return self.application_type and self.application_type.specific.next_deadline() class FundPage(BaseApplicationPage): diff --git a/opentech/public/funds/templates/public_funds/fund_page.html b/opentech/public/funds/templates/public_funds/fund_page.html index e09df9879..5487fa051 100644 --- a/opentech/public/funds/templates/public_funds/fund_page.html +++ b/opentech/public/funds/templates/public_funds/fund_page.html @@ -18,6 +18,6 @@ {% include_block page.body %} </section> </div> - {% include "public_funds/includes/fund_apply_cta.html" with page=page apply_page=page.fund_type %} + {% include "public_funds/includes/fund_apply_cta.html" with page=page apply_page=page.application_type %} {% include "includes/relatedcontent.html" with related_pages=page.related_pages.all %} {% endblock %} diff --git a/opentech/templates/includes/relatedcontent_card.html b/opentech/templates/includes/relatedcontent_card.html index 5827b3cfc..b60ecb447 100644 --- a/opentech/templates/includes/relatedcontent_card.html +++ b/opentech/templates/includes/relatedcontent_card.html @@ -1,13 +1,16 @@ {% load wagtailcore_tags wagtailimages_tags %} +{% with page=page.specific %} <a class="card" href="{% pageurl page %}"> - {% if page.deadline %} - <h6 class="card__subheading"> + <h6 class="card__subheading"> + {% if page.deadline %} <svg class="icon icon--calendar apply-bar__icon"><use xlink:href="#calendar"></use></svg> Next deadline: <span>{{ page.deadline|date:"M j, Y" }}</span> - </h6> - {% endif %} + {% else %} + Closed + {% endif %} + </h6> {% if page.listing_image %} {% image page.listing_image fill-450x300 %} {% endif %} @@ -19,3 +22,4 @@ {% endif %} <svg class="icon icon--card-pixels"><use xlink:href="#arrow-head-pixels--transparent"></use></svg> </a> +{% endwith %} -- GitLab