templates/tennis_court_availability/parts/venue_header.html.twig line 1

Open in your IDE?
  1. {% if is_granted('ROLE_ACEIFY') %}
  2.     <a style="color: red; background-color: yellow" target="_blank"
  3.        href="{{ path('tennis_venues_edit', {id:tennis_venue.id}) }}">
  4.         {{ tennis_venue.venue }} </a>
  5. {% else %}
  6.     <span style="color: black; background-color: whitesmoke"> {{ tennis_venue.venue }}</span>
  7. {% endif %}
  8. {% if tennis_venue.mapLink is not null %}
  9.     <a target="_blank"
  10.        title="{{ tennis_venue.address }}, {{ tennis_venue.addressCity }} {{ tennis_venue.addressPostcode }}"
  11.        href={{ path('venue_address', {id: tennis_venue.id}) }}>
  12.         <i style="font-size: 15px; color: red" class="fas fa-map-marker"></i>
  13.     </a>
  14. {% endif %}
  15. {% if tennis_venue.numberOfCourts!=0 %}
  16.     <span style="color: blue" title="Number of courts"> (#{{ tennis_venue.numberOfCourts }})</span>
  17. {% endif %}
  18. <div class="desktop">
  19.     {% if app.user %}
  20.         {% include 'tennis_court_availability/parts/favoured_venues.html.twig' %}
  21.     {% endif %}
  22.     {% set url =  "Check Booking Engine allocation" %}
  23.     {% if tennis_venue.bookingEngine == "ClubSpark" %}
  24.         {% set url = "https://clubspark.lta.org.uk/"~tennis_venue.bookingUrl~"/Booking/BookByDate#?date="~date|date('Y-m-d')~"&role=guest" %}
  25.     {% endif %}
  26.     {% if tennis_venue.bookingEngine == "ParkSports" %}
  27.         {% set url = "https://"~tennis_venue.bookingUrl~ ".parksports.co.uk/Booking/BookByDate#?date="~date|date('Y-m-d')~"&role=guest" %}
  28.     {% endif %}
  29.     {% if is_granted('ROLE_ACEIFY') %}
  30.         {% if tennis_venue.bookingUrl is not null %}
  31.             <a target="_blank"
  32.                title="{{ url }}" href={{ url }}> <i style="font-size: 20px; color: red" class="fas fa-link"></i>
  33.             </a>
  34.         {% endif %}
  35.         {% if CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date) is null %}
  36.             {% set LastScrapeTime = "Not scraped" %}
  37.             {% set displayLastScrapeTime='0' %}
  38.         {% else %}
  39.             {% set LastScrapeTime = CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date) %}
  40.             {% set displayLastScrapeTime='1' %}
  41.         {% endif %}
  42.         {% if displayLastScrapeTime ==1 %}
  43.             <i title="Last updated: {{ LastScrapeTime|date('d-M-y H:i') }}"
  44.                style="color: grey   " class="fa fa-clock-o"></i>
  45.             {% if  CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date)  is not null %}
  46.                 {{ CourtLastScrapeTime.timeDifference('now'|date('Y-m-d H:i'),CourtLastScrapeTime.returnCourtScrapeTime(12, tennis_venue, date)) }}
  47.             {% endif %}
  48.         {% endif %}
  49.     {% endif %}
  50.     {% if app.user %}
  51.         {% include 'tennis_court_availability/parts/distance_to_venue_by_player_home.html.twig' %}
  52.         {% include 'tennis_court_availability/parts/distance_to_venue_by_player_work.html.twig' %}
  53.     {% endif %}
  54.     <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')} ) }}>
  55.         <i style="color: red; background-color: yellow" class="fa fa-expand-arrows-alt"></i></a>
  56.     {% if is_granted('ROLE_ACEIFY') %}
  57.         <a href={{ path('tennis_court_availability_scrape', {venue: tennis_venue.id, date: date|date('Y-m-d')}) }}>
  58.             <i style="font-size: 15px; color: red; background-color: yellow" class="fas fa-download"></i></a>
  59.                 {{ UnreleasedCourtsByVenueByDate.UnreleasedCourts(tennis_venue, date) }}
  60.     {% endif %}
  61. </div>