From c5e5ae90d561d415c624929453045875bd6f2a28 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 29 Sep 2016 12:42:14 +0100 Subject: [PATCH] Split availability into partials --- source/_partials/availability.html.twig | 23 ++++--------------- .../_partials/availability/limited.html.twig | 7 ++++++ source/_partials/availability/no.html.twig | 7 ++++++ source/_partials/availability/yes.html.twig | 7 ++++++ 4 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 source/_partials/availability/limited.html.twig create mode 100644 source/_partials/availability/no.html.twig create mode 100644 source/_partials/availability/yes.html.twig diff --git a/source/_partials/availability.html.twig b/source/_partials/availability.html.twig index 5373aa98..bd839f18 100644 --- a/source/_partials/availability.html.twig +++ b/source/_partials/availability.html.twig @@ -1,26 +1,11 @@
-
Availability
+
+ Availability +
{% for key, availability in site.availability %} -

- {% if availability == 'yes' %} - - - {{ key == 'full' ? 'Currently have available full-time capacity' }} - {{ key == 'part' ? 'Currently have available part-time capacity' }} - {% elseif availability == 'limited' %} - - - {{ key == 'full' ? 'Currently have limited full-time capacity' }} - {{ key == 'part' ? 'Currently have limited part-time capacity' }} - {% else %} - - - {{ key == 'full' ? 'Currently no spare full-time capacity.' }} - {{ key == 'part' ? 'Currently no spare part-time capacity.' }} - {% endif %} -

+ {% include 'availability/' ~ availability with { value: key } %} {% endfor %}
diff --git a/source/_partials/availability/limited.html.twig b/source/_partials/availability/limited.html.twig new file mode 100644 index 00000000..9fbaaab1 --- /dev/null +++ b/source/_partials/availability/limited.html.twig @@ -0,0 +1,7 @@ +

+ + + {{ value == 'full' ? 'Currently have limited full-time capacity' }} + + {{ value == 'part' ? 'Currently have limited part-time capacity' }} +

diff --git a/source/_partials/availability/no.html.twig b/source/_partials/availability/no.html.twig new file mode 100644 index 00000000..bf56968b --- /dev/null +++ b/source/_partials/availability/no.html.twig @@ -0,0 +1,7 @@ +

+ + + {{ value == 'full' ? 'Currently no spare full-time capacity.' }} + + {{ value == 'part' ? 'Currently no spare part-time capacity.' }} +

diff --git a/source/_partials/availability/yes.html.twig b/source/_partials/availability/yes.html.twig new file mode 100644 index 00000000..3191624d --- /dev/null +++ b/source/_partials/availability/yes.html.twig @@ -0,0 +1,7 @@ +

+ + + {{ value == 'full' ? 'Currently have available full-time capacity' }} + + {{ value == 'part' ? 'Currently have available part-time capacity' }} +