Skip to content
Snippets Groups Projects
event-list.html 4.75 KiB
Newer Older
Erxleben, Fredo's avatar
Erxleben, Fredo committed
{% include top.html %}

<body>

    {% include header.html %}

    <main>
        {% include title_image.html %}

        <section class="events-container">
            {% comment %}
                Events are sorted depending whether they are in the past or in the future.
                Upcoming events are sorted from near future to far future.
                Past events are sorted most recent to least recent.
                In both cases the list is a truncated version of the complete events list,
                where the pivot is the current date.
                If no past events are available a placeholder text will be used instead.

                Example:
                    P0  P1  P2  today  F0  F1    (events)
                    *---*---*-----*----*---*---> (time)

                   will yield the event order (top to bottom): F0, F1, (separator) P2, P1, P0.
            {% endcomment %}

            {% assign sorted_events = site.events | sort: "start.date" %}
            {% assign sorted_events_reversed = site.events | sort: "start.date" | reverse %}
            {% assign today = "now" | date: "%Y-%m-%d" %}

            <h1 id="upcoming_events" class="events-section-heading">Upcoming Events
Erxleben, Fredo's avatar
Erxleben, Fredo committed

            {% assign has_upcoming_events = false %}
            {% for event in sorted_events %}
            {% if event.start.date < today %}
                {% continue %}
            {% endif %}
            {% assign has_upcoming_events = true %}
            <article class="list-entry">
                <div class="preview">
                    <h1>
                        <a href="{{ event.url | relative_url }}">
                            {{ event.title }}
                        </a>
                    </h1>

                {% if event.excerpt_separator != '' %}
                    <div class="excerpt-content">
                        {{ event.excerpt }}
                    </div>
                    {% else %}
                    <div class="no-excerpt-content">
                        {{ event.content }}
                    </div>
                {% endif %}
                    <a href="{{ event.url | relative_url }}" >
                        <span>&nbsp;more…&nbsp;</span>
                    </a>
                </div>

                <div class="digest-container">
                    {% include event_digest.html event=event %}
                </div>

            </article>
            {% endfor %}

            {% if has_upcoming_events == false %}
            <article class="list-entry">
                <p>
                    Check out the <strong>
                    <a href="https://events.hifis.net/category/4/">
                    <i class="fas fa-external-link-alt"></i> HIFIS Events page</a></strong>
                    or the <strong>
                    <a href="https://www.helmholtz-hida.de/course-catalog/en/?search%5Bq%5D=HIFIS">
                    <i class="fas fa-external-link-alt"></i> HIDA course catalog</a></strong>
                    for upcoming HIFIS courses and events.
Erxleben, Fredo's avatar
Erxleben, Fredo committed
                </p>
            </article>
            {% endif %}

            <hr class="horizontal-line across_whole_page" />

            <h1 id="past_events" class="events-section-heading">Past Events</h1>

            {% assign has_past_events = false %}
            {% for event in sorted_events_reversed %}
            {% if event.start.date >= today %}
                {% continue %}
            {% endif %}
            {% assign has_past_events = true %}
            <article class="list-entry">
                <div class="preview">
                    <h1>
                        <a href="{{ event.url | relative_url }}">
                            {{ event.title }}
                        </a>
                    </h1>

                {% if event.excerpt_separator != '' %}
                    <div class="excerpt-content">
                        {{ event.excerpt }}
                    </div>
                    {% else %}
                    <div class="no-excerpt-content">
                        {{ event.content }}
                    </div>
                {% endif %}
                    <a href="{{ event.url | relative_url }}" >
                        <span>&nbsp;more…&nbsp;</span>
                    </a>
                </div>

                <div class="digest-container">
                    {% include event_digest.html event=event %}
                </div>

            </article>
            {% endfor %}

            {% if has_past_events == false %}
            <article class="list-entry">
                <p>
                    There are no past events right now.
                </p>
            </article>
            {% endif %}

        </section>
    </main>

    {% include footer.html %}

</body>

</html>