{% assign current_date = "now" | date: "%Y-%m-%d" %}
{% assign due_date = "August 17, 2023" | date: "%Y-%m-%d" %}

{% if current_date < due_date %}
  {% if training_event.sessions.first.id == 'ef7e1fd4-f079-4812-818b-639d871b9ce3' or training_event.sessions.first.id == '1d0507b5-1acf-44db-91bf-f75433a4daef' or training_event.sessions.first.id == '2f208441-c668-42dd-beae-704ad9066d8f' %}

    <div class="np-card">
      <div class="np-card-container">
        <div class="np-card-content-training-event">
          <h3 class="np-card-content-title">
            {{ training_event.title }}
          </h3>
          <div class="np-card-content-subtitle">
            {% t shared.event_types, key: training_event.event_type %}
          </div>
          <div class="np-card-training-session">
            <span class="np-card-content-label">
              {% t .next_session %}
            </span>
            <div class="np-card-training-session-date">
              <div class="np-button-background-color np-card-training-session-date-bar"></div>
              <div class="np-card-training-session-date-day">
                17
              </div>
              <div>
                <div class="np-card-training-session-date-month">
                  August
                </div>
                <div class="np-card-training-session-date-year">
                  {{ training_event.sessions.first.year }}
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="np-card-content np-card-content-vertical np-card-padding">
          <div class="np-card-training-sessions">
            <i class="np-card-training-sessions-icon far fa-calendar-star"></i>
            <span class="np-card-training-sessions-label">
              {% if training_event.sessions.first.id == 'ef7e1fd4-f079-4812-818b-639d871b9ce3' %}
                {{ training_event.sessions.size | minus: 3 }} Sessions
              {% elsif training_event.sessions.first.id == '1d0507b5-1acf-44db-91bf-f75433a4daef'%}
                {{ training_event.sessions.size | minus: 2 }} Sessions
              {% elsif training_event.sessions.first.id == '2f208441-c668-42dd-beae-704ad9066d8f' %}
                {{ training_event.sessions.size | minus: 1 }} Sessions
              {% else %}
                {% t .sessions, count: training_event.sessions.size %}  
              {% endif %}
            </span>
            <a
              class="np-button np-button-wide"
              href="{% route training_session, id: training_event.sessions.first.id %}"
            >
              {% t shared.view %}
            </a>
          </div>
        </div>
      </div>
    </div>

  {% else %}
    <div class="np-card">
      <div class="np-card-container">
        <div class="np-card-content-training-event">
          <h3 class="np-card-content-title">
            {{ training_event.title }}
          </h3>
          <div class="np-card-content-subtitle">
            {% t shared.event_types, key: training_event.event_type %}
          </div>
          <div class="np-card-training-session">
            <span class="np-card-content-label">
              {% t .next_session %}
            </span>
            <div class="np-card-training-session-date">
              <div class="np-button-background-color np-card-training-session-date-bar"></div>
              <div class="np-card-training-session-date-day">
                {{ training_event.sessions.first.day }}
              </div>
              <div>
                <div class="np-card-training-session-date-month">
                  {{ training_event.sessions.first.month }}
                </div>
                <div class="np-card-training-session-date-year">
                  {{ training_event.sessions.first.year }}
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="np-card-content np-card-content-vertical np-card-padding">
          <div class="np-card-training-sessions">
            <i class="np-card-training-sessions-icon far fa-calendar-star"></i>
            <span class="np-card-training-sessions-label">
              {% t .sessions, count: training_event.sessions.size %}
            </span>
            <a
              class="np-button np-button-wide"
              href="{% route training_session, id: training_event.sessions.first.id %}"
            >
              {% t shared.view %}
            </a>
          </div>
        </div>
      </div>
    </div>
  {% endif %}
{% else %}
  <div class="np-card">
    <div class="np-card-container">
      <div class="np-card-content-training-event">
        <h3 class="np-card-content-title">
          {{ training_event.title }}
        </h3>
        <div class="np-card-content-subtitle">
          {% t shared.event_types, key: training_event.event_type %}
        </div>
        <div class="np-card-training-session">
          <span class="np-card-content-label">
            {% t .next_session %}
          </span>
          <div class="np-card-training-session-date">
            <div class="np-button-background-color np-card-training-session-date-bar"></div>
            <div class="np-card-training-session-date-day">
              {{ training_event.sessions.first.day }}
            </div>
            <div>
              <div class="np-card-training-session-date-month">
                {{ training_event.sessions.first.month }}
              </div>
              <div class="np-card-training-session-date-year">
                {{ training_event.sessions.first.year }}
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="np-card-content np-card-content-vertical np-card-padding">
        <div class="np-card-training-sessions">
          <i class="np-card-training-sessions-icon far fa-calendar-star"></i>
          <span class="np-card-training-sessions-label">
            {% t .sessions, count: training_event.sessions.size %}
          </span>
          <a
            class="np-button np-button-wide"
            href="{% route training_session, id: training_event.sessions.first.id %}"
          >
            {% t shared.view %}
          </a>
        </div>
      </div>
    </div>
  </div>
{% endif %}