{% extends 'wfbo/_layout.html.twig' %} {% block wfbo_title %}Race Details{% endblock %} {% block wfbo_content %} {% for flash in app.flashes('success') %} {% endfor %} {% for flash in app.flashes('error') %} {% endfor %}
← Back to Event

Race {{ race.raceNumber }}

Arena
{{ race.event.management.name }}
Event Date
{{ race.event.eventDate|date('Y-m-d') }}
Status
{% if race.open %} Open {% elseif race.closed %} Closed {% else %} Settled {% endif %}
{% if race.event.videoUrl %} {% set embedUrl = race.event.videoUrl|replace({'watch?v=': 'embed/', 'youtu.be/': 'youtube.com/embed/'}) %} {% if 'embed/' not in embedUrl %} {% set embedUrl = race.event.videoUrl %} {% endif %}
{% endif %} {% if race.open %}
{% endif %}
{% if not race.settled and not race.hasResult %}

Horses

{% if not race.event.published %} + Add Horse {% endif %}
{% if not race.event.published %}

Scratch becomes available once the event is published.

{% endif %} {# Empty carrier form: checkboxes/Save button below reference it via the HTML5 form="" attribute so they can submit together without nesting
tags around each row's own Delete form. #}
{% if horses is empty %}

No horses added yet.

{% else %} {% for horse in horses %} {% endfor %}
Horse # Name Jockey Trainer Status Scratch Actions
{{ horse.horseNumber }} {{ horse.horseName }} {{ horse.horseJockey }} {{ horse.horseTrainer ?: '—' }} {% if horse.active %} Active {% else %} Scratched {% endif %} {% if horse.active and race.event.published %} {% else %} — {% endif %} {% if not race.event.published %}
Edit
{% else %} — {% endif %}
{% if race.event.published and horses|filter(h => h.active) is not empty %}
{% endif %} {% endif %}
{% endif %}{# /not race.settled and not race.hasResult #}

Result

{% if race.hasResult %}
{% if is_granted('ROLE_SUPER_ADMIN') %} {% endif %} {% if not race.settled %}

Result saved. It can no longer be edited — go to Settlements to settle pending bets.

{% endif %}
Winner{{ race.result|length > 1 ? 's' : '' }}
{% for entry in race.result %} {{ not loop.first ? ', ' : '' }}Horse #{{ entry.horseNumber }} {% else %}—{% endfor %}
Result Set At
{{ race.resultSetAt|date('Y-m-d H:i') }}
{% set scratchedAfterClose = horses|filter(h => h.scratchedAfterClose) %} {% if scratchedAfterClose is not empty %}
Scratched After Close
{% for horse in scratchedAfterClose %} {{ not loop.first ? ', ' : '' }}Horse #{{ horse.horseNumber }} {% endfor %}
{% endif %} {% if dividendRows is not empty %}
Winning combinations
{% for row in dividendRows %}
{{ row.label }}: {% if row.refund %}Refunded{% endif %} {% for c in row.combinations %} {{ not loop.first ? ' · ' : (row.refund ? ' · ' : '') }}{% if c.selection %}{{ c.selection|capitalize }}{% else %}{{ c.numbers|join('-') }}{% endif %} : {{ c.dividend }} {% else %} {% if not row.refund %}—{% endif %} {% endfor %}
{% endfor %}
{% endif %}
{% elseif race.closed %} {% embed 'wfbo/event-races/_result_form.html.twig' with { formAction: path('app_wfbo_event_race_result_save', {id: race.id}), csrfToken: csrf_token('wfbo_event_race_result_' ~ race.id), confirmText: 'Save this result?', } %}{% endembed %} {% else %}

Close betting to enter the result.

{% endif %} {% endblock %}