This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
oliverdavies.uk-old-sculpin/source/_partials/availability.html.twig

43 lines
1.6 KiB
Twig
Raw Normal View History

2015-08-10 01:13:56 +00:00
<div class="availability">
<h2>Availability</h2>
2015-08-10 21:53:00 +00:00
2015-08-10 01:13:56 +00:00
<div class="content">
2015-08-10 21:53:00 +00:00
{% set output, now = '', "now"|date('U') %}
{% for type, data in site.availability %}
2015-08-10 22:13:20 +00:00
{% set text, status, start, end = '', site.availability[type].available, site.availability[type].start,
2015-08-10 21:53:00 +00:00
site.availability[type].end %}
{% if type == 'day' %}
2015-08-10 22:13:20 +00:00
{% if status == 'yes' %}
{% set text = 'Available for day contract work' %}
{% elseif status == 'no' %}
{% set text = 'Not available for day contract work' %}
{% endif %}
2015-08-10 21:53:00 +00:00
{% elseif type == 'evenings' %}
2015-08-10 22:13:20 +00:00
{% 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 %}
2015-08-10 21:53:00 +00:00
{% endif %}
2015-08-10 08:04:38 +00:00
2015-08-10 22:13:20 +00:00
{% if start %}
{% if start|date('U') > now %}
{% set text = text ~ ' starting ' ~ start|date('F Y') %}
{% endif %}
2015-08-10 08:04:38 +00:00
2015-08-10 22:13:20 +00:00
{% if end %}
{% set text = text ~ ', until ' ~ end|date('F Y') %}
{% endif %}
{% elseif end %}
{% set text = text ~ ', until ' ~ end|date('F Y') %}
{% endif %}
2015-08-10 08:10:50 +00:00
2015-08-10 22:13:20 +00:00
<p>{{ text }}.</p>
{% endfor %}
2015-08-10 01:13:56 +00:00
</div>
</div>