diff --git a/app/config/sculpin_site.yml b/app/config/sculpin_site.yml index 91dae760..315cc98b 100644 --- a/app/config/sculpin_site.yml +++ b/app/config/sculpin_site.yml @@ -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 diff --git a/source/_partials/availability.html.twig b/source/_partials/availability.html.twig index 0e39a1a3..9b5864e1 100644 --- a/source/_partials/availability.html.twig +++ b/source/_partials/availability.html.twig @@ -4,22 +4,8 @@
{% 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 %}