Skip to content

Commit bc5f352

Browse files
authored
Merge pull request #73 from pilot/sponsors-isset-show
if isset sponsor, show category
2 parents ccd63f7 + 224352b commit bc5f352

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Event/EventBundle/Resources/views/Component/_sponsors.html.twig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% macro sponsors(sponsors, type) %}
2-
{% if type == 4 %}
2+
{% if type == 4 and sponsors|length > 0 %}
33
<div class="center">
44
<ul class="list_sponsors">
55
<h2 class="text">General sponsors</h2>
@@ -14,7 +14,7 @@
1414
{% endfor %}
1515
</ul>
1616
</div>
17-
{% elseif type == 2 %}
17+
{% elseif type == 2 and sponsors|length > 0 %}
1818
<div class="center">
1919
<ul class="list_sponsors gold">
2020
<h3 class="text">Gold sponsors</h3>
@@ -29,7 +29,7 @@
2929
{% endfor %}
3030
</ul>
3131
</div>
32-
{% elseif type == 3 %}
32+
{% elseif type == 3 and sponsors|length > 0 %}
3333
<div class="center">
3434
<ul class="list_sponsors middle">
3535
<h4 class="text">Silver sponsors</h4>
@@ -44,7 +44,7 @@
4444
{% endfor %}
4545
</ul>
4646
</div>
47-
{% else %}
47+
{% elseif type == 5 and sponsors|length > 0 %}
4848
<div class="center">
4949
<ul class="list_sponsors middle">
5050
<h4 class="text">Info Partners</h4>
@@ -70,11 +70,13 @@
7070
{% set generalType = constant('Event\\EventBundle\\Entity\\Sponsor::TYPE_GENERAL') %}
7171
{% set goldType = constant('Event\\EventBundle\\Entity\\Sponsor::TYPE_GOLD') %}
7272
{% set silverType = constant('Event\\EventBundle\\Entity\\Sponsor::TYPE_SILVER') %}
73+
{% set infoType = constant('Event\\EventBundle\\Entity\\Sponsor::TYPE_INFO') %}
7374

7475
{% if event.sponsors|length > 0 and event.getSponsorsExclude|length > 0 %}
7576
{{ _self.sponsors(event.getSpecifiedSponsors(generalType), generalType) }}
7677
{{ _self.sponsors(event.getSpecifiedSponsors(goldType), goldType) }}
7778
{{ _self.sponsors(event.getSpecifiedSponsors(silverType), silverType) }}
79+
{{ _self.sponsors(event.getSpecifiedSponsors(infoType), infoType) }}
7880
{% endif %}
7981

8082
{% if event.specifiedSponsors()|length > 0 %}

0 commit comments

Comments
 (0)