list-blocks 2.69 KB
Newer Older
Marvin Thäns's avatar
Marvin Thäns committed
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

{% assign maxItems = include.maxItems %}
{% if include.hardMax %}
{% assign items = include.items | slice: 0, maxItems %}
{% else %}
{% assign items = include.items %}
{% endif %}
{% assign counter = 1 %}
{% assign hiddenItems = 0 %}
{% assign listSize = items.size %}
<div class="column-layout">
    {% if include.logo %}
        <div class="block">
            {% include image src=include.logo sizes="(min-width: 1180px) 320px, (min-width: 980px) 260px, (min-width: 740px) 50vw, 100vw" class=include.imageclass style="width: 75%; margin: auto" %}
        </div>
        {% assign counter = counter | plus: 1 %}
        {% assign listSize = listSize | plus: 1 %}
    {% endif %}
    {% for i in items %}
            {% assign visibility = "" %}
            {% if counter > maxItems %}
                {% assign visibility = "toggle-visibility hide" %}
                {% assign hiddenItems = hiddenItems | plus: 1 %}
            {% endif %}
            {% assign date = i.date | date_to_string %}

            <!--- Person Block --->
            {% if i.firstNames %}
                {% if stuwo==yes%}
                    {% capture title %}{{i.titlePrefix}} {{i.firstNames}} {{i.lastName}}{{i.titleSuffix}}{% endcapture %}
                    {% include block image=i.image imagedimension="portrait" imageclass="u-width-50" title=title teaser=i.function url="none"%}
                {% else %}
                    {% capture title %}{{i.titlePrefix}} {{i.firstNames}} {{i.lastName}}{{i.titleSuffix}}{% endcapture %}
                    {% include block image=i.image imagedimension="portrait" imageclass="u-width-50" title=title teaser=i.function url=i.url %}
                {% endif %}
            {% else %}
            
            <!-- Change Meta -->
tron's avatar
tron committed
39
            {% if i.enddate  %}
Marvin Thäns's avatar
Marvin Thäns committed
40
                {% capture meta %}{{ i.startdate | date:"%Y" }} &ndash; {{ i.enddate | date:"%Y" }}{% endcapture %}
tron's avatar
tron committed
41
42
43
            {% elsif i.eventdate %}
                 {% assign date_t = i.date | date_to_string %}
                 {% capture meta %}{{ date_t }}{% endcapture %}
Marvin Thäns's avatar
Marvin Thäns committed
44
45
46
47
48
49
50
51
52
53
54
55
56
            {% else %}  
                {% capture meta %}Since {{ i.startdate | date:"%Y" }}{% endcapture %}
            {% endif %}

            <!--- Normal Block --->
            {% include block class=visibility image=i.image title=i.title teaser=i.teaser external_url=i.external_url url=i.url meta=meta%}

            {% endif %}
            {% assign counter = counter | plus: 1 %}
    {% endfor %}
    {% include placeholderBlocks maxItems=maxItems itemListLength=listSize hiddenItems=hiddenItems %}
</div>
{% unless include.noToggle %}
tron's avatar
tron committed
57
58
59
    {% if include.maxItems < listSize %}
        <div id="react-placeholder-toggleVisibility"></div>
    {% endif %}
Marvin Thäns's avatar
Marvin Thäns committed
60
{% endunless %}