From 497b306b817d6d54a67e19e02787dd2c64409e56 Mon Sep 17 00:00:00 2001 From: Katrien Vanhaute Date: Tue, 7 Nov 2017 09:22:24 +0100 Subject: [PATCH 1/2] Update layout to bootstrap 4 --- .../Quotes/Layout/Templates/Quote.html.twig | 15 ++++++++++ .../Quotes/Layout/Widgets/AllQuotes.html.twig | 11 ++++--- .../Layout/Widgets/RandomQuote.html.twig | 28 ++++-------------- .../Layout/Widgets/SingleQuote.html.twig | 29 +++++-------------- 4 files changed, 35 insertions(+), 48 deletions(-) create mode 100644 src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig diff --git a/src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig b/src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig new file mode 100644 index 0000000..f457a13 --- /dev/null +++ b/src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig @@ -0,0 +1,15 @@ +{% macro quote(quote) %} +
+
+ {% if quote.image %} +
+ {{ quote.name }} +
+ {% endif %} +
+ {{ quote.quote|raw }} + {{ quote.name }} +
+
+
+{% endmacro %} diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig index 203f88c..76ed9d6 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig @@ -1,4 +1,7 @@ -{% for quote in quotes %} -
{{ quote.quote|raw }}
-

{{ quote.name }}

-{% endfor %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as macro %} + +
+ {% for quote in quotes %} + {{ macro.quote(quote) }} + {% endfor %} +
diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig index 4e98f4f..665a89c 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig @@ -1,23 +1,7 @@ -{% if quote %} -
-
- {% if quote.image %} -
- {{ quote.name }} -
-
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} - - {% if not quote.image %} -
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} -
-
-{% endif %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as macro %} +
+ {% if quote %} + {{ macro.quote(quote) }} + {% endif %} +
diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig index 9435343..e9a218d 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig @@ -1,22 +1,7 @@ -{% if quote %} -
-
- {% if quote.image %} -
- {{ quote.name }} -
-
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} - - {% if not quote.image %} -
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} -
-
-{% endif %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as macro %} + +
+ {% if quote %} + {{ macro.quote(quote) }} + {% endif %} +
From b0c933b788746dd43528f97575e937c8340c461c Mon Sep 17 00:00:00 2001 From: Katrien Vanhaute Date: Wed, 8 Nov 2017 10:50:45 +0100 Subject: [PATCH 2/2] Use better names for the quote macros --- .../Modules/Quotes/Layout/Widgets/AllQuotes.html.twig | 4 ++-- .../Modules/Quotes/Layout/Widgets/RandomQuote.html.twig | 4 ++-- .../Modules/Quotes/Layout/Widgets/SingleQuote.html.twig | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig index 76ed9d6..a10bc24 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig @@ -1,7 +1,7 @@ -{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as macro %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %}
{% for quote in quotes %} - {{ macro.quote(quote) }} + {{ quotesTemplates.quote(quote) }} {% endfor %}
diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig index 665a89c..fc97f75 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig @@ -1,7 +1,7 @@ -{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as macro %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %}
{% if quote %} - {{ macro.quote(quote) }} + {{ quotesTemplates.quote(quote) }} {% endif %}
diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig index e9a218d..d703ce8 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig @@ -1,7 +1,7 @@ -{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as macro %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %}
{% if quote %} - {{ macro.quote(quote) }} + {{ quotesTemplates.quote(quote) }} {% endif %}