Commit 8029f39c authored by tron's avatar tron
Browse files

adds uniform lists for news, jobs and topics

parent 52ac2dee
Pipeline #20974 passed with stage
in 13 minutes and 40 seconds
......@@ -41,6 +41,37 @@ menu:
- title: "Other"
href: "/other"
```
### Lists
- News
- logo="path/image.png"
- tags = "tagA, TagB, ..." | tags = "tagA"
- maxItems = Int
- noHeadline="true"
- noToggle="true"
```yaml
{% include news logo="path/image.png" tags = "tagA, TagB, ..." maxItems = 6 %}
{% include news logo="path/image.png" tags = "tagA, TagB, ..." maxItems = 6 noHeadline="true" noToggle="true" %}
```
- Jobs
- tags = "tagA, TagB, ..." | tags = "tagA"
- maxItems = Int
- noHeadline="true"
- noToggle="true"
```yaml
{% include jobs tags = "tagA, TagB, ..." maxItems = 6 %}
{% include jobs tags = "tagA, TagB, ..." maxItems = 6 noHeadline="true" noToggle="true" %}
```
- Topics
- tags = "tagA, TagB, ..." | tags = "tagA"
- status = "open" | "closed" | "assigned"
- headline="string, md, html"
```yaml
## Theses and projects
{% include topics tags="tagA, TagB, ..." status = "open" %}
{% include topics tags="tagA, TagB, ..." status = "assigned" %}
{% include topics tags="tagA, TagB, ..." status = "closed" %}
```
### Image Carousel
The teaser images at the top can be selected for each page individually with a default in the `_config.yml` as:
......@@ -60,4 +91,4 @@ widths:
- 844
- 640
- 320
```
\ No newline at end of file
```
<!-- Filter active jobs. Further filter tags when used. -->
{% if include.tags %}
{% assign taged = include.tags | remove: " " | split: "," %}
{% assign itemlist = '' | split: ',' %}
{% for tag in taged %}
{% assign temp = site.jobs | where: "active",true | where: "tags", tag %}
{% assign itemlist = itemlist | concat: temp | sort: 'date' | reverse %}
{% endfor %}
{% else %}
{% assign itemlist = site.jobs | where: "active",true | sort: 'date' | reverse %}
{% endif %}
<!-- Display data -->
{% if itemlist.size > 0 %}
{% unless include.noHeadline %}
## Open Positions
{% endunless %}
{% assign counter = 1 %}
{% assign hiddenItems = 0 %}
<div class="column-layout">
{% for i in itemlist %}
{% assign visibility = "" %}
{% if counter > include.maxItems %}
{% assign visibility = "toggle-visibility hide" %}
{% assign hiddenItems = hiddenItems | plus: 1 %}
{% endif %}
{% assign date = i.date | date_to_string %}
{% include block class=visibility image=i.image title=i.title teaser=i.teaser external_url=i.external_url url=i.url meta=date%}
{% assign counter = counter | plus: 1 %}
{% endfor %}
{% include placeholderBlocks maxItems= include.maxItems itemListLength=itemlist.size hiddenItems=hiddenItems%}
</div>
<!--{% unless include.noToggle %}
<div id="react-placeholder-toggleVisibility"></div>
{% endunless %}-->
{% endif %}
\ No newline at end of file
<!-- Filter active posts. Further filter tags when used. -->
{% if include.tags %}
{% assign taged = include.tags | remove: " " | split: "," %}
{% assign itemlist = '' | split: ',' %}
{% for tag in taged %}
{% assign temp = site.posts | where: active,true | where: "tags", tag %}
{% assign itemlist = itemlist | concat: temp | sort: 'date' | reverse %}
{% endfor %}
{% else %}
{% assign itemlist = site.posts | where: active,true | sort: 'date' | reverse %}
{% endif %}
<!-- Display data -->
{% if itemlist.size > 0 %}
{% unless include.noHeadline %}
## News
{% endunless %}
{% assign counter = 1 %}
{% assign hiddenItems = 0 %}
<div class="column-layout">
{% if include.logo %}
{% assign counter = counter | plus: 1 %}
<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>
{% endif %}
{% for i in itemlist %}
{% assign visibility = "" %}
{% if counter > include.maxItems %}
{% assign visibility = "toggle-visibility hide" %}
{% assign hiddenItems = hiddenItems | plus: 1 %}
{% endif %}
{% assign date = i.date | date_to_string %}
{% include block class=visibility image=i.image title=i.title teaser=i.teaser external_url=i.external_url url=i.url meta=date%}
{% assign counter = counter | plus: 1 %}
{% endfor %}
{% include placeholderBlocks maxItems= include.maxItems itemListLength=itemlist.size hiddenItems=hiddenItems%}
</div>
{% unless include.noToggle %}
<div id="react-placeholder-toggleVisibility"></div>
{% endunless %}
{% endif %}
<!--Dummy Visible -->
{% assign dummyblocksMod = 0 %}
{% if include.maxItems%}
{% if include.itemListLength < include.maxItems%}
{% assign dummyblocksMod = include.itemListLength | modulo: 3 %}
{% else %}
{% assign dummyblocksMod = include.maxItems | modulo: 3 %}
{% endif %}
{% else %}
{% assign dummyblocksMod = include.itemListLength | modulo: 3 %}
{% endif %}
{% if dummyblocksMod == 1%}
<div class="block placeholder"></div>
<div class="block placeholder"></div>
{% elsif dummyblocksMod == 2 %}
<div class="block placeholder"></div>
{% else %}
{% endif %}
<!--Dummy Hidden -->
{% assign invisMod = include.hiddenItems | modulo: 3 %}
{% if invisMod == 1%}
<div class="block placeholder toggle-visibility hide"></div>
<div class="block placeholder toggle-visibility hide"></div>
{% elsif invisMod == 2 %}
<div class="block placeholder toggle-visibility hide"></div>
{% else %}
{% endif %}
<!-- Filter active topics. Further filter tags when used. -->
{% if include.tags %}
{% assign taged = include.tags | remove: " " | split: "," %}
{% assign itemlist = '' | split: ',' %}
{% for tag in taged %}
{% assign temp = site.topics | where: "tags", tag | where: "status",include.status %}
{% assign itemlist = itemlist | concat: temp | sort: 'date' | reverse | sort:"put-on-top-of-the-list" | reverse%}
{% endfor %}
{% else %}
{% assign itemlist = site.topics | where: "status",include.status | sort: 'date' | reverse | sort:"put-on-top-of-the-list" | reverse%}
{% endif %}
<!-- Display data -->
{% if itemlist.size > 0 %}
{% if include.headline %}
{{include.headline}}
{% else %}
### {{ include.status | capitalize }}
{% endif %}
{% assign counter = 1 %}
{% assign hiddenItems = 0 %}
<div class="column-layout">
{% for topic in itemlist %}
{% assign typeClasses = "topic " %}
{% assign typeDescription = "unknown format" %}
{% if topic.type-mcs-bachelor-project == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-mcsp" %}
{% assign typeDescription = "Bachelor Project" %}
{% endif %}
{% if topic.type-mcs-bachelor-thesis == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-mcst" %}
{% assign typeDescription = "Bachelor Thesis" %}
{% endif %}
{% if topic.type-hci-master-project == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-hcip" %}
{% assign typeDescription = "Master Project" %}
{% endif %}
{% if topic.type-hci-master-thesis == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-hcit" %}
{% assign typeDescription = "Master Thesis" %}
{% endif %}
{% if topic.type-cs-bachelor-thesis == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-csbt" %}
{% assign typeDescription = "Bachelor Thesis" %}
{% endif %}
{% if topic.type-cs-master-project == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-csmp" %}
{% assign typeDescription = "Master Project" %}
{% endif %}
{% if topic.type-cs-master-thesis == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-csmt" %}
{% assign typeDescription = "Master Thesis" %}
{% endif %}
{% if topic.type-ge-bachelor-thesis == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-gebt" %}
{% assign typeDescription = "Bachelor Thesis" %}
{% endif %}
{% if topic.type-phd-project == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-phd" %}
{% assign typeDescription = "Phd Project" %}
{% endif %}
{% if topic.type-industry == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-ind" %}
{% endif %}
{% if topic.type-industry-coop == true %}
{% assign typeClasses = typeClasses | append: " " | append: "type-indcoop" %}
{% endif %}
{% assign title = topic.title %}
{% if topic.put-on-top-of-the-list == true %}
{% assign title = title | append: " &#9733;" %}
{% endif %}
{% include detailed-topic class=typeClasses image=topic.image title=title teaser=topic.teaser url=topic.url assigned-to=topic.assigned-to type=typeDescription%}
{% endfor %}
{% include placeholderBlocks maxItems= include.maxItems itemListLength=itemlist.size hiddenItems=hiddenItems%}
</div>
<!--{% unless include.noToggle %}
<div id="react-placeholder-toggleVisibility"></div>
{% endunless %}-->
{% endif %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment