From 64a690e54167b68d97a0944860ad7c45990025dd Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 10 Aug 2015 22:53:00 +0100 Subject: [PATCH] Started refactoring --- source/_partials/availability.html.twig | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/source/_partials/availability.html.twig b/source/_partials/availability.html.twig index 6be23259..4e27cdd3 100644 --- a/source/_partials/availability.html.twig +++ b/source/_partials/availability.html.twig @@ -1,12 +1,21 @@

Availability

+
- {% set now = "now"|date('U') %} + {% set output, now = '', "now"|date('U') %} - {% set day_available = site.availability.day.available %} - {% set day_start = site.availability.day.start %} - {% set day_end = site.availability.day.end %} + {% for type, data in site.availability %} + {% set text, status, start, end = '', site.availability[type].availability, site.availability[type].start, + site.availability[type].end %} + {% if type == 'day' %} + + {% elseif type == 'evenings' %} + + {% endif %} + {% endfor %} + + {# {% if (day_available == 'no') %} {% set day_status = 'Not available for day contract work' %} {% else %} @@ -52,5 +61,6 @@ {% endif %}

{{ evening_status }}.

+ #}