Dates

Dates

{% if include.style contains 'short' %}
  {% assign sorted = include.data | sort:"date" | reverse %}
  <ul class="no-bullet">
  {% for item in sorted %}
    <li class="sans"><code>{{ item.date | split: "." | reverse | join: "." }}</code>&nbsp;&nbsp;&nbsp;<a href="#seminar-{{ item.date | remove: '.' | strip }}">{{ item.title | truncate: 60 }}</a></li>
  {% endfor %}
  </ul>

{% elsif include.style contains 'list' %}

  {% assign dates = include.data | sort:"date" | reverse %}
  {% for item in dates %}
  <article id="item-{{ item.date | remove: '.' | strip }}">
      <p class="subtitle">{% if item.date2 %}{{ item.date | split: "." | reverse | join: "." }} bis {{ item.date2 | split: "." | reverse | join: "." }}{% else %}{{ item.date | split: "." | reverse | join: "." }}{% endif %}</p>
      <h1 class="h5">{{ item.title }}</h1>
      {% if item.description %}<p>{{ item.description }}</p>{% endif %}


      {% if item.url_title_1 %}
          <p>Veranstalter: <a target="_blank" title="Website besuchen" href="{{ item.url_1 }}">{{ item.url_title_1 }}</a></p>
          {% if item.url_title_2 %}
              <p><a class="button warning small radius" target="_blank" href="{{ item.url_2 }}">{{ item.url_title_2 }}</a></p>
          {% endif %}
      {% endif %}
  </div>
  {% endfor %}

  {% else %}

  {% assign sorted = include.data | sort:"date" | reverse %}
  <ul class="no-bullet">
  {% for item in sorted %}
    <li class="sans"><code>{{ item.date | split: "." | reverse | join: "." }}</code>&nbsp;&nbsp;&nbsp;<a href="#item-{{ item.date | remove: '.' | strip }}">{{ item.title | truncate: 60 }}</a></li>
  {% endfor %}
  </ul>

  <hr>

  {% assign dates = include.data | sort:"date" | reverse %}
  {% for item in dates %}
  <article class="bem3" id="item-{{ item.date | remove: '.' | strip }}">
      <p class="subtitle">{% if item.date2 %}{{ item.date | split: "." | reverse | join: "." }} bis {{ item.date2 | split: "." | reverse | join: "." }}{% else %}{{ item.date | split: "." | reverse | join: "." }}{% endif %}</p>
      <h1 class="h5">{{ item.title }}</h1>
      {% if item.description %}<p>{{ item.description }}</p>{% endif %}


      {% if item.url_title_1 %}
          <p>Veranstalter: <a target="_blank" title="Website besuchen" href="{{ item.url_1 }}">{{ item.url_title_1 }}</a></p>
          {% if item.url_title_2 %}
              <p><a class="button warning small radius" target="_blank" href="{{ item.url_2 }}">{{ item.url_title_2 }}</a></p>
          {% endif %}
      {% endif %}
  </article>
  {% endfor %}

{% endif %}