45 lines
1.6 KiB
Twig
45 lines
1.6 KiB
Twig
<div class="availability">
|
|
<h2>Availability</h2>
|
|
|
|
<div class="content">
|
|
{% set output, now = '', "now"|date('U') %}
|
|
|
|
{% for type, data in site.availability %}
|
|
{% set text, status, start, end = '', site.availability[type].available, site.availability[type].start,
|
|
site.availability[type].end %}
|
|
|
|
{% if type == 'day' %}
|
|
{% if status == 'yes' %}
|
|
{% set text = 'Available for day contract work' %}
|
|
{% elseif status == 'no' %}
|
|
{% set text = 'Not available for day contract work' %}
|
|
{% endif %}
|
|
{% elseif type == 'evenings' %}
|
|
{% if status == 'yes' %}
|
|
{% set text = 'Available for weekend/evening freelance work' %}
|
|
{% elseif status == 'limited' %}
|
|
{% set text = 'Limited availability for weekend/evening freelance work' %}
|
|
{% elseif status == 'no' %}
|
|
{% set text = 'Not available for weekend/evening freelance work' %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if start %}
|
|
{% if start|date('U') > now %}
|
|
{% set text = text ~ ' starting ' ~ start|date('F Y') %}
|
|
|
|
{% if end %}
|
|
{% set text = text ~ ',' %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if end %}
|
|
{% set text = text ~ ' until ' ~ end|date('F Y') %}
|
|
{% endif %}
|
|
|
|
<p class="availability__{{ status }}">{{ text }}.</p>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|