<commit_before>{% extends 'base.html.twig' %}

{% set finishedSections = 0 %}
{% for s in race.sections %}
    {% if s.isFinished %}
        {% set finishedSections = finishedSections + 1 %}
    {% endif %}
{% endfor %}

{% block title %}
    {{ race.getEvent.getName }} - Rennen {{ race.numberInEvent }}
{% endblock %}

{% block body %}
    <h1>#{{ race.numberInEvent }}: {{ rr.getOfficialName(race) }}<br>
        {% if race.extraText != "" %}<small>{{ race.extraText }}</small>{% endif %}
    </h1>

    <table>
        <tbody>
            <tr>
                <th>Gender</th>
                <td>{{ race.gender }}</td>
            </tr>
            <tr>
                <th>Age (min.)</th>
                <td>{{ race.ageMin }}</td>
            </tr>
            <tr>
                <th>Age (max.)</th>
                <td>{{ race.ageMax }}</td>
            </tr>
            <tr>
                <th>Level</th>
                <td>{{ race.level }}</td>
            </tr>
            <tr>
                <th>Starter (min.)</th>
                <td>{{ race.starterMin }}</td>
            </tr>
            <tr>
                <th>Starter (max.)</th>
                <td>{{ race.starterMax }}</td>
            </tr>
            <tr>
                <th>max. starter per section</th>
                <td>{{ race.maxStarterPerSection }}</td>
            </tr>
            <tr>
                <th>Price per starter</th>
                <td>{{ race.pricePerStarter }}</td>
            </tr>
            <tr>
                <th>Competitors per team</th>
                <td>{{ race.teamsize }}</td>
            </tr>
        </tbody>
    </table>

    {% if true %}
        {# TODO show this only if the user has the right to modify races #}
        <div class="row">
            <div class="col-md-4 col-md-offset-8">
                <a href="{{ path('race_edit', { 'race': race.id, 'event': race.event.id }) }}" class="btn btn-warning">Rennen ändern</a>
                {{ form_start(delete_form) }}
                <input type="submit" value="Rennen löschen" class="btn btn-danger">
                {{ form_end(delete_form) }}
            </div>
        </div>
        {% if finishedSections != race.sections.count %}
        <div class="row">
            <div class="col-lg-1">
                <form method="post" action="{{ path('race_add_section', {'race': race.id }) }}">
                    <button type="submit" class="btn btn-default">
                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> neue Abteilung erstellen
                    </button>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-1">
                <form method="post" action="{{ path('race_clean_sections', {'race': race.id }) }}">
                    <button type="submit" class="btn btn-default">
                        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> alle leeren Abteilungen entfernen
                    </button>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-1">
                <a href="{{ path('registration_new', { 'event': race.event.id, 'race': race.id }) }}" class="btn btn-default">Team hinzufügen</a>
            </div>
        </div>
        {% endif %}
    {% endif %}

{% if true %}<commit_msg>group buttons in race overview<commit_after>{% extends 'base.html.twig' %}

{% set finishedSections = 0 %}
{% for s in race.sections %}
    {% if s.isFinished %}
        {% set finishedSections = finishedSections + 1 %}
    {% endif %}
{% endfor %}

{% block title %}
    {{ race.getEvent.getName }} - Rennen {{ race.numberInEvent }}
{% endblock %}

{% block body %}
    <h1>#{{ race.numberInEvent }}: {{ rr.getOfficialName(race) }}<br>
        {% if race.extraText != "" %}<small>{{ race.extraText }}</small>{% endif %}
    </h1>

    <table>
        <tbody>
            <tr>
                <th>Gender</th>
                <td>{{ race.gender }}</td>
            </tr>
            <tr>
                <th>Age (min.)</th>
                <td>{{ race.ageMin }}</td>
            </tr>
            <tr>
                <th>Age (max.)</th>
                <td>{{ race.ageMax }}</td>
            </tr>
            <tr>
                <th>Level</th>
                <td>{{ race.level }}</td>
            </tr>
            <tr>
                <th>Starter (min.)</th>
                <td>{{ race.starterMin }}</td>
            </tr>
            <tr>
                <th>Starter (max.)</th>
                <td>{{ race.starterMax }}</td>
            </tr>
            <tr>
                <th>max. starter per section</th>
                <td>{{ race.maxStarterPerSection }}</td>
            </tr>
            <tr>
                <th>Price per starter</th>
                <td>{{ race.pricePerStarter }}</td>
            </tr>
            <tr>
                <th>Competitors per team</th>
                <td>{{ race.teamsize }}</td>
            </tr>
        </tbody>
    </table>

    {% if true %}
        {# TODO show this only if the user has the right to modify races #}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Rennen anpassen</h3>
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-md-4">
                        <a href="{{ path('race_edit', { 'race': race.id, 'event': race.event.id }) }}" class="btn btn-warning">Rennen ändern</a>
                    </div>
                    <div class="col-md-4">
                        {{ form_start(delete_form) }}
                        <input type="submit" value="Rennen löschen" class="btn btn-danger">
                        {{ form_end(delete_form) }}
                    </div>
                </div>
            </div>
        </div>

        {% if race.sections.count == 0 or finishedSections != race.sections.count %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Starter anpassen</h3>
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-md-4">
                        <form method="post" action="{{ path('race_add_section', {'race': race.id }) }}">
                            <button type="submit" class="btn btn-default">
                                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> neue Abteilung erstellen
                            </button>
                        </form>
                    </div>
                    <div class="col-md-4">
                        <form method="post" action="{{ path('race_clean_sections', {'race': race.id }) }}">
                            <button type="submit" class="btn btn-default">
                                <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> alle leeren Abteilungen entfernen
                            </button>
                        </form>
                    </div>
                </div>
                <hr>
                <div class="row">
                    <div class="col-md-4">
                        <a href="{{ path('registration_new', { 'event': race.event.id, 'race': race.id }) }}" class="btn btn-default">Team hinzufügen</a>
                    </div>
                </div>
            </div>
        </div>
        {% endif %}
    {% endif %}

{% if true %}
{'fraction_non_alphanumeric': 0.17029990751750562, 'fraction_numerical': 0.003038710529792575, 'mean_word_length': 1.2821826952065118, 'pattern_counts': {'":': 0, '<': 212, '<?xml version=': 0, '>': 212, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '397005', 'n_tokens_mistral': 2356, 'n_tokens_neox': 2143, 'n_words': 473}