-
Notifications
You must be signed in to change notification settings - Fork 6
/
sponsors-view.njk
57 lines (47 loc) · 1.98 KB
/
sponsors-view.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{#
This file contains component definitions for sponsors related displays
CLIC website software
Please read {@link README.md} in the components folder for guidelines and
documentation about templating and view definitions.
These sponsors components are meant to be re-used and composed in templates
describing website pages and other components
@author Alexandre CHAU
#}
{#
Sponsors logo images
This macro displays a list of logos from all the sponsors
@param sponsorsList The list of sponsors defined as an array of Sponsor
(type Sponsor[] as defined in {@link sponsors.ts})
@example Inserts the list of logos, data in the view model is Sponsor[]
{% import "components/sponsors/sponsors-view.njk" as sponsors %}
{{ sponsors.logoImages(sponsorsList = data) }}
#}
{% macro logoImages(sponsorsList) %}
<div class="sponsors">
{% for sponsor in sponsorsList %}
<a href="{{sponsor.websiteURL}}" target="_blank">
<img src="{{sponsor.imageURL}}" alt="{{sponsor.name}}" style="{{sponsor.imageStyles}}">
</a>
{% endfor %}
</div>
{% endmacro %}
{#
Sponsors logo images grouped by tier
This macro displays a list of logos from all the sponsors, grouped by a
tier title
@param sponsorsByTier The map of sponsors defined as tier-sponsors pairs
(type Map<string, Sponsor[]>) as defined in
{@link sponsors.ts}
#}
{% macro logoImagesByTier(sponsorsByTier) %}
{% for sponsorsTier, sponsorsList in sponsorsByTier %}
<div class="sponsors">
<h3 class="tier">{{ sponsorsTier }}</h3>
{% for sponsor in sponsorsList %}
<a href="{{sponsor.websiteURL}}" target="_blank">
<img src="{{sponsor.imageURL}}" alt="{{sponsor.name}}" style="{{sponsor.imageStyles}}">
</a>
{% endfor %}
</div>
{% endfor %}
{% endmacro %}