{% if is_granted('ROLE_ACEIFY') %}
<a style="color: red; background-color: yellow" target="_blank"
href="{{ path('tennis_venues_edit', {id:tennis_venue.id}) }}">
{{ tennis_venue.venue }} </a>
{% else %}
<span style="color: black; background-color: whitesmoke"> {{ tennis_venue.venue }}</span>
{% endif %}
{% if tennis_venue.mapLink is not null %}
<a target="_blank"
title="{{ tennis_venue.address }}, {{ tennis_venue.addressCity }} {{ tennis_venue.addressPostcode }}"
href={{ path('venue_address', {id: tennis_venue.id}) }}>
<i style="font-size: 15px; color: red" class="fas fa-map-marker"></i>
</a>
{% endif %}
{% if tennis_venue.numberOfCourts!=0 %}
<span style="color: blue" title="Number of courts"> (#{{ tennis_venue.numberOfCourts }})</span>
{% endif %}
<div class="desktop">
{% if app.user %}
{% include 'tennis_court_availability/parts/favoured_venues.html.twig' %}
{% endif %}
{% set url = "Check Booking Engine allocation" %}
{% if tennis_venue.bookingEngine == "ClubSpark" %}
{% set url = "https://clubspark.lta.org.uk/"~tennis_venue.bookingUrl~"/Booking/BookByDate#?date="~date|date('Y-m-d')~"&role=guest" %}
{% endif %}
{% if tennis_venue.bookingEngine == "ParkSports" %}
{% set url = "https://"~tennis_venue.bookingUrl~ ".parksports.co.uk/Booking/BookByDate#?date="~date|date('Y-m-d')~"&role=guest" %}
{% endif %}
{% if is_granted('ROLE_ACEIFY') %}
{% if tennis_venue.bookingUrl is not null %}
<a target="_blank"
title="{{ url }}" href={{ url }}> <i style="font-size: 20px; color: red" class="fas fa-link"></i>
</a>
{% endif %}
{% if CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date) is null %}
{% set LastScrapeTime = "Not scraped" %}
{% set displayLastScrapeTime='0' %}
{% else %}
{% set LastScrapeTime = CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date) %}
{% set displayLastScrapeTime='1' %}
{% endif %}
{% if displayLastScrapeTime ==1 %}
<i title="Last updated: {{ LastScrapeTime|date('d-M-y H:i') }}"
style="color: grey " class="fa fa-clock-o"></i>
{% if CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date) is not null %}
{{ CourtLastScrapeTime.timeDifference('now'|date('Y-m-d H:i'),CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date)) }}
{% endif %}
{% endif %}
{% endif %}
{% if app.user %}
{% include 'tennis_court_availability/parts/distance_to_venue_by_player_home.html.twig' %}
{% include 'tennis_court_availability/parts/distance_to_venue_by_player_work.html.twig' %}
{% endif %}
<a title="Expand view and show availability by court at this club on this day" target="_blank" href={{ path('tennis_court_availability_daily_detail', {venue: tennis_venue.id, date: date|date('Y-m-d')} ) }}>
<i style="color: red; background-color: yellow" class="fa fa-expand-arrows-alt"></i></a>
{% if is_granted('ROLE_ACEIFY') %}
<a href={{ path('tennis_court_availability_scrape', {venue: tennis_venue.id, date: date|date('Y-m-d')}) }}>
<i style="font-size: 15px; color: red; background-color: yellow" class="fas fa-download"></i></a>
{{ UnreleasedCourtsByVenueByDate.UnreleasedCourts(tennis_venue, date) }}
{% endif %}
</div>