From b94f49d5a0f2e7145d8c8a86ad0bd66667f9e11b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 10 Aug 2015 09:04:38 +0100 Subject: [PATCH] Show start and end dates --- source/_partials/availability.html.twig | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/_partials/availability.html.twig b/source/_partials/availability.html.twig index 0de9de79..970557f9 100644 --- a/source/_partials/availability.html.twig +++ b/source/_partials/availability.html.twig @@ -2,14 +2,30 @@

Availability

{% set day_available = site.availability.day.available %} + {% set day_start = site.availability.day.start %} + {% set day_end = site.availability.day.end %} + {% if (day_available == 'no') %} {% set day_status = 'Not available for day contract work' %} {% else %} {% set day_status = 'Available for day contract work' %} {% endif %} + + {% if day_start %} + {% set day_status = day_status ~ ' starting ' ~ day_start|date('F Y') %} + {% if evenings_end %} + {% set day_status = day_status ~ ', until ' ~ day_end|date('F Y') %} + {% endif %} + {% elseif day_end %} + {% set day_status = day_status ~ ', until ' ~ day_end|date('F Y') %} + {% endif %} +

{{ day_status }}.

{% set evenings_available = site.availability.evenings.available %} + {% set evenings_start = site.availability.evenings.start %} + {% set evenings_end = site.availability.evenings.end %} + {% if (evenings_available == 'yes') %} {% set evening_status = 'Available for weekend/evening freelance work' %} {% elseif (evenings_available == 'limited') %} @@ -17,6 +33,16 @@ {% else %} {% set evening_status = 'Not available for weekend/evening freelance work' %} {% endif %} + + {% if evenings_start %} + {% set evening_status = evening_status ~ ' starting ' ~ evenings_start|date('F Y') %} + {% if evenings_end %} + {% set evening_status = evening_status ~ ', until ' ~ evenings_end|date('F Y') %} + {% endif %} + {% elseif evenings_end %} + {% set evening_status = evening_status ~ ', until ' ~ evenings_end|date('F Y') %} + {% endif %} +

{{ evening_status }}.