{% 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 race.open %}

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 %}{# /race.open #}

Result

{% if race.hasResult %}
Finishing Order
{% set position = 0 %} {% for entry in race.result %} {% set isContinuation = loop.index0 > 0 and entry.deadHeat is defined and entry.deadHeat and race.result[loop.index0 - 1].deadHeat is defined and race.result[loop.index0 - 1].deadHeat %} {% if isContinuation %} = Horse #{{ entry.horseNumber }} {% else %} {% set position = position + 1 %} {{ not loop.first ? ', ' : '' }}{{ position }}. Horse #{{ entry.horseNumber }} {% endif %} {% 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 }}{% if horse.substituteHorse %} (substitute: Horse #{{ horse.substituteHorse.horseNumber }}){% endif %} {% endfor %}
{% endif %} {% if dividendRows is not empty %}
Dividends
{% for row in dividendRows %}
{{ row.label }}{% if row.kind == 'multi' %} (whole combo){% endif %}: {% if row.refund %} Refunded {% elseif row.deadHeatDividendA is not null or row.deadHeatDividendB is not null %} Dead Heat {{ row.deadHeatDividendA }} / {{ row.deadHeatDividendB }} {% else %} {% set winnerNumber = race.result[0].horseNumber ?? null %} {% if row.kind == 'multi' and row.legPrefix is not empty and winnerNumber %} Dividend ({{ row.legPrefix }}{{ winnerNumber }}): {{ row.dividend }} {% else %} {{ row.dividend }} {% endif %} {%- if row.substituteDividend is not null %} (Substitute: {{ row.substituteDividend }}){% endif %} {%- if row.scratchDividends is not null and row.scratchDividends is not empty %} {% for horseId, div in row.scratchDividends %} {% set scratchHorse = horses|filter(h => h.id == horseId)|first %} {% set scratchNumber = scratchHorse ? scratchHorse.horseNumber : ('#' ~ horseId) %} {% if row.legPrefix is not empty %} Scratch ({{ row.legPrefix }}{{ scratchNumber }}): {{ div }} {% else %} Scratch Horse #{{ horseId }}: {{ div }} {% endif %} {% if not loop.last %}, {% endif %} {% endfor %} {% endif %} {% endif %}
{% endfor %}
{% endif %}
{% elseif race.closed %} {% set activeHorses = horses|filter(h => h.active) %}

Scratch after close

Tick any horse that withdrew after betting closed. A substitute can be assigned once scratched here.

{% for horse in horses %} {% if horse.active %}
{% elseif horse.scratchedAfterClose %}
Horse #{{ horse.horseNumber }} ({{ horse.horseName }}) — Scratched
{% else %}
Horse #{{ horse.horseNumber }} ({{ horse.horseName }}) — Scratched (before close)
{% endif %} {% endfor %}

Finishing order

Fill positions starting from 1st, in order. Check "Dead heat with next" to mark two adjacent finishers as tied.

{% for i in 1..activeHorses|length %}
{% if i < activeHorses|length %} {% endif %}
{% endfor %}
{% if dividendRows is not empty %}

Dividends

Fill Dividend normally. If this race's result ends in a qualifying tie for a bet type, fill both Dead Heat amounts instead and leave Dividend blank. Refund voids this bet type on this race instead of paying a dividend. When a scratched horse in this race has a substitute assigned and this race is the combo's last leg, also fill the Substitute Dividend - combos rewritten onto the substitute pay it.

{% for row in dividendRows %}
{% if row.substitutesOnLastLeg %} {% endif %} {% if row.isScratchDividendType %} {% set scratchHorses = horses|filter(h => (h.active and not h.scratched) or h.scratchedAfterClose) %} {% for horse in scratchHorses %} {% endfor %} {% endif %} {% if row.kind == 'single' and not row.isOddEven %} {% endif %}
{% endfor %}
{% endif %}
{% else %}

Close betting to enter the result.

{% endif %} {% endblock %}