topics.html 4.41 KB
Newer Older
tron's avatar
tron 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 39 40 41 42 43 44 45 46 47 48 49 50
---
layout: base
---
<h1>{{ page.title }}</h1>
{% if page.topic-status == "open" %}
    <hr/>
    <div id="react-placeholder-topicSelector" status="{{ page.topic-status }}"></div>
    <hr/>
{% endif %}

{% assign topics = site.topics %}

{% if page.topic-status == "open" %}
    {% assign array = site.emptyArray %}
    {% capture now %}{{ 'now' | date: '%s' | plus: 0 }}{% endcapture %}
    {% for topic in topics %}
        {% capture expiration-date %}{{ topic.expiration-date | date: '%s' | plus: 0 }}{% endcapture %}
        {% unless topic.expiration-date and expiration-date < now %}
            {% assign array = array | push: topic %}
        {% endunless %}
    {% endfor %}
    {% assign topics = array %}
{% endif %}

<div class="column-layout">
    {% if page.topic-status == "expired" %}

        {% capture now %}{{ 'now' | date: '%s' | plus: 0 }}{% endcapture %}

        {% for topic in site.topics %}
            {% capture expiration-date %}{{ topic.expiration-date | date: '%s' | plus: 0 }}{% endcapture %}
            {% if topic.expiration-date and expiration-date < now %}
                {% include block image=topic.image title=topic.title teaser=topic.teaser url=topic.url %}
            {% endif %}
        {% endfor %}

    {% else %}

        {% assign topics = topics | where:"status",page.topic-status | sort:"date" | reverse %}
        {% assign topTopics = site.emptyArray %}
        {% assign otherTopics = site.emptyArray %}
        {% for topic in topics %}
            {% if topic.put-on-top-of-the-list == true %}
                {% assign topTopics = topTopics | push: topic %}
            {% else %}
                {% assign otherTopics = otherTopics | push: topic %}
            {% endif %}
        {% endfor %}
        {% assign topics = topTopics | concat: otherTopics %}

Martin Fischbach's avatar
Martin Fischbach committed
51
		{% assign counter = 0 %}
tron's avatar
tron committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
        {% for topic in topics %}
            {% assign typeClasses = "topic " %}
            {% if topic.type-mcs-bachelor-project == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-mcsp" %}
            {% endif %}
            {% if topic.type-mcs-bachelor-thesis == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-mcst" %}
            {% endif %}
            {% if topic.type-hci-master-project == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-hcip" %}
            {% endif %}
            {% if topic.type-hci-master-thesis == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-hcit" %}
            {% endif %}
            {% if topic.type-cs-bachelor-thesis == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-csbt" %}
            {% endif %}
            {% if topic.type-cs-master-project == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-csmp" %}
            {% endif %}
            {% if topic.type-cs-master-thesis == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-csmt" %}
            {% endif %}
            {% if topic.type-ge-bachelor-thesis == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-gebt" %}
            {% endif %}
            {% if topic.type-phd-project == true %}
                {% assign typeClasses = typeClasses | append: " " | append: "type-phd" %}
            {% 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 %}
Martin Fischbach's avatar
Martin Fischbach committed
91 92 93 94 95 96
            <!--{% if counter < 6 %}
            	{% include block class=typeClasses image=topic.image title=title teaser=topic.teaser url=topic.url big=true%}
			{% else %}-->
                {% include block class=typeClasses image=topic.image title=title teaser=topic.teaser url=topic.url %}
            <!--{% endif %}-->	
            {% assign counter = counter | plus: 1 %}
tron's avatar
tron committed
97
        {% endfor %}
Martin Fischbach's avatar
Martin Fischbach committed
98
        {% include placeholderBlocks itemListLength=counter hiddenItems=0 %}
tron's avatar
tron committed
99 100 101

    {% endif %}
</div>