{#
/**
 * @file
 * OpenY Schedules.
 *
 * Available variables:
 * - content: contains all data.
 *
 * @ingroup themeable
 */
#}
<div class="container">
  <div class="row">
    <div class="schedule-sessions-group w-100">
      <h2>{{ title }}</h2>

      {% if content is empty %}
        {{ 'It looks like there are no classes / sessions matching your search criteria.'|t }}
      {% else %}

      {% for time, group in content %}
        <h6 class="group_time d-flex align-items-center p-2">
          <span class="m-auto">{{ time }}</span>
        </h6>

        <ul class="time-wrapper list-unstyled">
        {% for teaser in group %}
          <li>
            <div class="row">

              {# title #}
              <div class="col-md">
                <h4 class="title-class text-uppercase font-weight-bold">
                  <a href="{{ teaser.url }}" target="_blank">
                    {{ teaser.teaser['#node'].title[0].value }}
                  </a>
                </h4>
              </div>

              {# badges #}
              {% if teaser.included_in_membership or teaser.ticket_required %}
              <div class="col-md text-left text-md-right">
                {% if teaser.included_in_membership %}
                  <div class="py-2 px-3 badge badge-pill badge-success mb-2">
                    <i class="far fa-check-square"></i> {{ 'Included in Membership'|t }}
                  </div>
                {% endif %}

                {% if teaser.ticket_required %}
                  <div class="py-2 px-3 badge badge-pill badge-warning ml-sm-2">
                    <i class="fas fa-ticket-alt"></i> {{ 'Ticket Required'|t }}
                  </div>
                {% endif %}
              </div>
              {% endif %}

            </div>

            <p class="mt-4">
              {% set description = teaser.teaser['#node'].field_class_description[0].value|render|striptags %}
              {{ description|length > 140 ? description|slice(0, 140) ~ '...' : description }}
            </p>

          </li>
        {% endfor %}
        </ul>
      {% endfor %}

    {% endif %}
    </div>
  </div>
</div>
