Refactored availability text

This commit is contained in:
Oliver Davies 2015-08-20 22:39:18 +01:00
parent 795a6455fe
commit c2fb13a1f5
2 changed files with 19 additions and 24 deletions

View file

@ -86,11 +86,20 @@ default_date_format: jS F, Y
title_separator: "|"
availability:
day:
available: no
start: ~
end: ~
evenings:
available: limited
start: 2015-08-10
end: ~
status:
day:
available: no
start: ~
end: ~
evenings:
available: limited
start: 2015-08-10
end: ~
text:
day:
yes: Available for day contract work
no: Not available for day contract work
evenings:
yes: Available for weekend/evening freelance work
no: Not availabile for weekend/evening freelance work
limited: Limited availability for weekend/evening freelance work

View file

@ -4,22 +4,8 @@
<div class="content">
{% set now = "now"|date('U') %}
{% for type, data in site.availability %}
{% if type == 'day' %}
{% if data.available == 'yes' %}
{% set text = 'Available for day contract work' %}
{% elseif data.available == 'no' %}
{% set text = 'Not available for day contract work' %}
{% endif %}
{% elseif type == 'evenings' %}
{% if data.available == 'yes' %}
{% set text = 'Available for weekend/evening freelance work' %}
{% elseif data.available == 'limited' %}
{% set text = 'Limited availability for weekend/evening freelance work' %}
{% elseif data.available == 'no' %}
{% set text = 'Not available for weekend/evening freelance work' %}
{% endif %}
{% endif %}
{% for type, data in site.availability.status %}
{% set text = site.availability.text[type][data.available] %}
{% if data.start %}
{% if data.start|date('U') > now %}