Skip to content

Commit

Permalink
Merge pull request #8 from sumocoders/update-layout-to-bs4
Browse files Browse the repository at this point in the history
Update layout to bootstrap 4
  • Loading branch information
mathiashelin authored Nov 8, 2017
2 parents 1708c79 + b0c933b commit ff0bbef
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 48 deletions.
15 changes: 15 additions & 0 deletions src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% macro quote(quote) %}
<blockquote>
<div class="row align-items-center">
{% if quote.image %}
<div class="col-2">
<img src="{{ quote.imageDirectoryUrl }}/x150/{{ quote.image }}" alt="{{ quote.name }}" class="img-responsive">
</div>
{% endif %}
<div class="{% if quote.image %} col-10{% else %} col-12{% endif %}">
{{ quote.quote|raw }}
<cite>{{ quote.name }}</cite>
</div>
</div>
</blockquote>
{% endmacro %}
11 changes: 7 additions & 4 deletions src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% for quote in quotes %}
<blockquote>{{ quote.quote|raw }}</blockquote>
<p>{{ quote.name }}</p>
{% endfor %}
{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %}

<section id="quotesAllQuotesWidget" class="quotes quotes-widget">
{% for quote in quotes %}
{{ quotesTemplates.quote(quote) }}
{% endfor %}
</section>
28 changes: 6 additions & 22 deletions src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
{% if quote %}
<blockquote>
<div class="row">
{% if quote.image %}
<div class="col-sm-4">
<img src="{{ quote.imageDirectoryUrl }}/x150/{{ quote.image }}" alt="{{ quote.name }}" class="img-responsive">
</div>
<div class="col-sm-8">
{{ quote.quote|raw }}
-- {{ quote.name }}
</div>
{% endif %}

{% if not quote.image %}
<div class="col-sm-12">
{{ quote.quote|raw }}
-- {{ quote.name }}
</div>
{% endif %}
</div>
</blockquote>
{% endif %}
{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %}

<section id="quotesRandomQuoteWidget" class="quotes quotes-widget">
{% if quote %}
{{ quotesTemplates.quote(quote) }}
{% endif %}
</section>
29 changes: 7 additions & 22 deletions src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
{% if quote %}
<blockquote>
<div class="row">
{% if quote.image %}
<div class="col-sm-4">
<img src="{{ quote.imageDirectoryUrl }}/x150/{{ quote.image }}" alt="{{ quote.name }}" class="img-responsive">
</div>
<div class="col-sm-8">
{{ quote.quote|raw }}
-- {{ quote.name }}
</div>
{% endif %}

{% if not quote.image %}
<div class="col-sm-12">
{{ quote.quote|raw }}
-- {{ quote.name }}
</div>
{% endif %}
</div>
</blockquote>
{% endif %}
{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %}

<section id="quotesSingleQuoteWidget" class="quotes quotes-widget">
{% if quote %}
{{ quotesTemplates.quote(quote) }}
{% endif %}
</section>

0 comments on commit ff0bbef

Please sign in to comment.