Simplified availability

This commit is contained in:
Oliver Davies 2016-03-31 00:23:57 +01:00
parent 0f83aba1a4
commit 7ec30ec3d3
2 changed files with 7 additions and 36 deletions

View file

@ -2,26 +2,6 @@
<div class="panel-heading">Availability</div>
<div class="panel-body">
{% set now = "now"|date('U') %}
{% 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 %}
{{ site.availability|raw }}
</div>
</div>