diff --git a/opentech/public/funds/models.py b/opentech/public/funds/models.py index 89806c9f1b9ef34301a2f205e7b430a554ac757d..1f0da502a4b3ba2493dc98a498b33645f011116a 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 e09df98797c2829fc81c193a7abf5ac16386e547..5487fa051274e628b655fa7d6edcd686bf9ecb67 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 5827b3cfc0e8acae81c7f6c793957e441318e0a7..b60ecb4473e722b5ff0759748fdcf6d58dffc3ba 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 %}