{% endif %}
{% if event.hasAnEventDateOnSale %}
{# Event Dates calendar used on multi date events #}
{% if event.hasTwoOrMoreEventDatesOnSale %}
{% set eventDatesCalendar = [] %}
{% for eventDate in event.eventdates if eventDate.isOnSale %}
{% set eventDatesCalendar = eventDatesCalendar|merge([{"Date": eventDate.startdate|date('Y-m-d'), "Title": eventDate.startdate|date('g:i A'), "Link": eventDate.reference}]) %}
{% endfor %}
{% include "Global/message.html.twig" with { type: 'info', icon: 'fas fa-info-circle', message: "Click on a date to view tickets"|trans } %}
{% if is_granted('ROLE_ATTENDEE') %}
{% endif %}
{% endif %}
{% if not is_granted('IS_AUTHENTICATED_REMEMBERED') or is_granted('ROLE_ATTENDEE') %}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
{% if event.isAddedToFavoritesBy(app.user) %}
{% else %}
{% endif %}
{% else %}
{{ "Add to favorites"|trans }}
{% endif %}
{% endif %}
{% else %}
{% include "Global/message.html.twig" with { type: 'info', icon: 'fas fa-info-circle', message: "No tickets on sale at this moment" } %}
{% endif %}
{% for user in services.getUsers({"hasboughtticketfor": event.slug, "role": "attendee"}).getQuery().getResult() %}
{% include "Global/user-avatar.html.twig" with { user: user, showusernametooltip: true } %}
{% endfor %}
{% for user in services.getUsers({"hasboughtticketfor": event.slug, "limit": 12, "role": "attendee"}).getQuery().getResult() %}
{% include "Global/user-avatar.html.twig" with { user: user, showusernametooltip: true } %}
{% endfor %}
{% if attendeescount > 12 %}
{{ attendeescount - 12 }}
{% endif %}
{% endif %}
{% endif %}
{% if services.getSetting("newsletter_enabled") == "yes" and services.getSetting("mailchimp_api_key") and services.getSetting("mailchimp_list_id") %}
{% include "Global/newsletter-box.html.twig" %}
{% endif %}
{% set othereventsbythisorganizer = services.getEvents({"organizer" : event.organizer.slug, "limit" : 8, "notId": event.id}).getQuery().getResult() %}
{% if othereventsbythisorganizer|length > 0 %}
{{ "Other events by %organizername%"|trans({'%organizername%' : event.organizer.name}) }}
{% for event in othereventsbythisorganizer %}
{% include "Global/event-card.html.twig" with {event: event} %}
{% endfor %}