Skip to content

Commit f2e9df9

Browse files
committed
Improve readability of missions.html.twig
1 parent 4a42b6b commit f2e9df9

File tree

1 file changed

+44
-41
lines changed

1 file changed

+44
-41
lines changed

templates/home/missions/missions.html.twig

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,54 @@
1111
{% block content %}
1212
<div class="mt-3">
1313
<!-- Section - Missions -->
14+
{% if upcomingMissions is null or archivedMissions is null %}
1415
<section id="missions" class="text-center">
15-
{% if upcomingMissions is null or archivedMissions is null %}
16-
<h2>{{ 'Something went wrong while fetching missions list...'|trans }}</h2>
17-
<h3>{{ 'Try again later'|trans }}</h3>
18-
{% else %}
19-
<!-- Heading -->
20-
<h2 class="mb-5 font-weight-bold">{{ 'Upcoming missions'|trans }}</h2>
16+
<h2>{{ 'Something went wrong while fetching missions list...'|trans }}</h2>
17+
<h3>{{ 'Try again later'|trans }}</h3>
18+
</section>
19+
{% else %}
20+
<section id="missions" class="text-center">
21+
<!-- Heading -->
22+
<h2 class="mb-5 font-weight-bold">{{ 'Upcoming missions'|trans }}</h2>
2123

22-
{% for missionsRow in upcomingMissions|reverse|batch(3) %}
23-
<!-- Grid row -->
24-
<div class="row">
25-
{% for mission in missionsRow %}
26-
{# @var mission \App\Service\Mission\Dto\MissionDto #}
27-
<!-- Grid column -->
28-
<div class="col-lg-4 col-md-6 mb-4 mission">
29-
{% include '_partial/_mission_widget.html.twig' with {'mission': mission} %}
30-
</div>
31-
<!--/ Grid column -->
32-
{% endfor %}
33-
</div>
34-
<!--/ Grid row -->
35-
{% endfor %}
36-
</section>
24+
{% for missionsRow in upcomingMissions|reverse|batch(3) %}
25+
<!-- Grid row -->
26+
<div class="row">
27+
{% for mission in missionsRow %}
28+
{# @var mission \App\Service\Mission\Dto\MissionDto #}
29+
<!-- Grid column -->
30+
<div class="col-lg-4 col-md-6 mb-4 mission">
31+
{% include '_partial/_mission_widget.html.twig' with {'mission': mission} %}
32+
</div>
33+
<!--/ Grid column -->
34+
{% endfor %}
35+
</div>
36+
<!--/ Grid row -->
37+
{% endfor %}
38+
</section>
39+
<!--/ Section - Missions -->
3740

38-
<!-- Section - Missions -->
39-
<section id="missions-archive" class="text-center">
40-
<!-- Heading -->
41-
<h2 class="mb-5 font-weight-bold">{{ 'Completed missions'|trans }}</h2>
41+
<!-- Section - Missions Archive -->
42+
<section id="missions-archive" class="text-center">
43+
<!-- Heading -->
44+
<h2 class="mb-5 font-weight-bold">{{ 'Completed missions'|trans }}</h2>
4245

43-
{% for missionsRow in archivedMissions|batch(3) %}
44-
<!-- Grid row -->
45-
<div class="row">
46-
{% for mission in missionsRow %}
47-
{# @var mission \App\Service\Mission\Dto\MissionDto #}
48-
<!-- Grid column -->
49-
<div class="col-lg-4 col-md-6 mb-4 mission">
50-
{% include '_partial/_mission_widget.html.twig' with {'mission': mission, 'lazy': true} %}
51-
</div>
52-
<!--/ Grid column -->
53-
{% endfor %}
54-
</div>
55-
<!--/ Grid row -->
56-
{% endfor %}
57-
{% endif %}
46+
{% for missionsRow in archivedMissions|batch(3) %}
47+
<!-- Grid row -->
48+
<div class="row">
49+
{% for mission in missionsRow %}
50+
{# @var mission \App\Service\Mission\Dto\MissionDto #}
51+
<!-- Grid column -->
52+
<div class="col-lg-4 col-md-6 mb-4 mission">
53+
{% include '_partial/_mission_widget.html.twig' with {'mission': mission, 'lazy': true} %}
54+
</div>
55+
<!--/ Grid column -->
56+
{% endfor %}
57+
</div>
58+
<!--/ Grid row -->
59+
{% endfor %}
5860
</section>
59-
<!--/ Section - Missions -->
61+
<!--/ Section - Missions Archive -->
62+
{% endif %}
6063
</div>
6164
{% endblock %}

0 commit comments

Comments
 (0)