Simplified availability

This commit is contained in:
Oliver Davies 2015-12-29 00:09:24 +00:00
parent 853c2edf25
commit bc180e8792
2 changed files with 6 additions and 33 deletions

View file

@ -65,19 +65,6 @@ fuzzy_date_format: F Y
title_separator: "|"
html_lang: en-GB
availability:
status:
day: { available: no, start: ~, end: ~ }
evenings: { available: limited, start: 2015-08-10, end: ~ }
text:
day:
yes: <i class="fa fa-thumbs-o-up text-success"></i> Available for day contract work
no: <i class="fa fa-thumbs-o-down text-danger"></i> Not available for day contract work
evenings:
yes: <i class="fa fa-thumbs-o-up text-success"></i> Available for weekend/evening freelance work
limited: <i class="fa fa-thumbs-o-up text-warning"></i> Limited availability for weekend/evening freelance work
no: <i class="fa fa-thumbs-o-down text-danger"></i> Not availabile for weekend/evening freelance work
companies:
horse_country:
title: 'Horse & Country TV'

View file

@ -2,26 +2,12 @@
<div class="panel-heading">Availability</div>
<div class="panel-body">
{% set now = "now"|date('U') %}
<p>
<i class="fa fa-thumbs-o-down text-danger"></i> Not available for day contract work.
</p>
{% for type, data in site.availability.status %}
{% set text = site.availability.text[type][data.available] %}
{% if data.start %}
{% if data.start|date('U') > now %}
{% set text = text ~ ' starting ' ~ data.start|date('F Y') %}
{% if data.end %}
{% set text = text ~ ',' %}
{% endif %}
{% endif %}
{% endif %}
{% if data.end %}
{% set text = text ~ ' until ' ~ data.end|date('F Y') %}
{% endif %}
<p>{{ text|raw }}.</p>
{% endfor %}
<p style="margin-bottom: 0">
<i class="fa fa-thumbs-o-up text-warning"></i> Limited availability for weekend/evening freelance work.
</p>
</div>
</div>