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 e1a67fcb97c62e0c0bc9edf7f7de4302bc14e70d..861377a97418fd530a77695576d272f031386c27 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 dd1083c61b3a4bc5e4a78b2fb64f0f9e9e0a6ef5..3faa2671fc9b5b8f7ae235a31a31dcb14ab7b283 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 %}