From 0c9f3c0e1dcaf2cb00a639e0a8c9c14b918cd0dd Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Thu, 23 Aug 2018 09:27:21 +0100 Subject: [PATCH] Rely on the apply page, not the public for deadline --- .../templates/apply_home/apply_home_page.html | 2 +- .../apply_home/includes/apply_listing.html | 35 ++++++------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/opentech/apply/home/templates/apply_home/apply_home_page.html b/opentech/apply/home/templates/apply_home/apply_home_page.html index e1a67fcb9..861377a97 100644 --- a/opentech/apply/home/templates/apply_home/apply_home_page.html +++ b/opentech/apply/home/templates/apply_home/apply_home_page.html @@ -17,7 +17,7 @@ <div class="wrapper wrapper--listings"> {% for child_page in page.get_children.public.live %} - {% include "apply_home/includes/apply_listing.html" with page=child_page %} + {% include "apply_home/includes/apply_listing.html" with page=child_page.specific %} {% endfor %} </div> diff --git a/opentech/apply/home/templates/apply_home/includes/apply_listing.html b/opentech/apply/home/templates/apply_home/includes/apply_listing.html index dd1083c61..3faa2671f 100644 --- a/opentech/apply/home/templates/apply_home/includes/apply_listing.html +++ b/opentech/apply/home/templates/apply_home/includes/apply_listing.html @@ -1,37 +1,24 @@ {% load wagtailcore_tags %} -{% with details=page.specific.detail.specific %} -{% if page.specific.open_round %} +{% with details=page.detail.specific %} +{% if page.open_round %} <div class="listing listing--not-a-link"> <div> <h4 class="listing__title listing__title--link"> - {% if details.deadline %} + {% if page.next_deadline %} <p class="listing__deadline"> <svg class="icon icon--calendar icon--small"><use xlink:href="#calendar"></use></svg> - <span>Next deadline: {{ details.deadline|date:"M j, Y" }}</span> + <span>Next deadline: {{ page.next_deadline|date:"M j, Y" }}</span> </p> {% endif %} - {# details may be None, so be more verbose in the handling of the title #} - {% if page.title %} - {% if details %} - <a href="{% pageurl details %}"> - {% endif %} - - {{ page.title }} - - {% if details %} - </a> - {% endif %} - {% else %} - {% if details %} - <a href="{% pageurl details %}"> - {% endif %} + {% if details %} + <a href="{% pageurl details %}"> + {% endif %} - {{ details.listing_title|default:details.title }} + {{ page.title }} - {% if details %} - </a> - {% endif %} + {% if details %} + </a> {% endif %} </h4> @@ -40,6 +27,6 @@ {% endif %} </div> <a class="listing__button" href="{% pageurl page %}">Apply</a> - </div> + </div> {% endif %} {% endwith %} -- GitLab