<commit_before>{% extends 'shop/base-consume.twig' %}

{% block content %}
    <div class="container modal-body">
        {% import 'site/partials/form.twig' as forms %}
        {{ forms.renderForm(form) }}
        {% if noEntity != null %}
            <div class="flashmessage alert alert-danger " id="shop_consume_error" >
                <a class="close" data-dismiss="alert">&times;</a>
                <div class="content">
                    <div style="color:white">Geen broodjes gevonden voor deze persoon!</div>
                </div>
            </div>
        {%  endif %}
        {% if reservations != null %}
            <div class="content">
                Broodje(s) voor {{ reservations[0].getPerson().getFirstName }}
                {{ reservations[0].getPerson().getLastName() }}:
            </div>
            <table class="table table-hover" style="margin-top: 15px;">
                <thead class="thead-light">
                <tr>
                    <th scope="col">Broodje</th>
                    <th scope="col">Aantal</th>
                    <th scope="col">Prijs</th>
                </tr>
                </thead>
                <tbody>
                {% set total = 0 %}
                {% for reservation in reservations %}
                    <tr>
                        <td>{{ reservation.getProduct().getName() }}</td>
                        <td>{{ reservation.getAmount() }}</td>
                        <td>€{{ reservation.getProduct().getSellPrice() }}</td>
                    </tr>
                    {% set total = total + reservation.getProduct().getSellPrice() * reservation.getAmount() %}
                {% endfor %}
                <tr style="background-color: #ebecf0">
                    <td></td>
                    <td><b>Totale prijs:</b></td>
                    <td><b>€ {{ total }}</b></td>
                </tr>
                </tbody>
            </table>
            <div class="content" style="color:darkred">
                {% if total < 3 %}
                    {{ consumed ? 'Dit broodje is al opgehaald.' : '' }}
                {% else %}
                    {{ consumed ? 'Deze broodjes zijn al opgehaald.' : '' }}
                {% endif %}
            </div>
        {%  endif %}
    </div>

{% endblock %}

{% block content_script %}
    <script type="text/javascript">
        $(document).ready(function (){
            document.getElementById('username').focus();
            $('#username').keydown( function(e) {
                if (e.key === 'Enter') {
                    e.preventDefault()
                    document.getElementById('amount').focus();
                }
            });
        });
    </script>
{% endblock %}<commit_msg>Theokot upgrades: enter + clear<commit_after>{% extends 'shop/base-consume.twig' %}

{% block content %}
    <div class="container modal-body">
        {% import 'site/partials/form.twig' as forms %}
        {{ forms.renderForm(form) }}
        {% if noEntity != null %}
            <div class="flashmessage alert alert-danger " id="shop_consume_error" >
                <a class="close" data-dismiss="alert">&times;</a>
                <div class="content">
                    <div style="color:white">Geen broodjes gevonden voor deze persoon!</div>
                </div>
            </div>
        {%  endif %}
        {% if reservations != null %}
            <div class="content">
                Broodje(s) voor {{ reservations[0].getPerson().getFirstName }}
                {{ reservations[0].getPerson().getLastName() }}:
            </div>
            <table class="table table-hover" style="margin-top: 15px;">
                <thead class="thead-light">
                <tr>
                    <th scope="col">Broodje</th>
                    <th scope="col">Aantal</th>
                    <th scope="col">Prijs</th>
                </tr>
                </thead>
                <tbody>
                {% set total = 0 %}
                {% for reservation in reservations %}
                    <tr>
                        <td>{{ reservation.getProduct().getName() }}</td>
                        <td>{{ reservation.getAmount() }}</td>
                        <td>€{{ reservation.getProduct().getSellPrice() }}</td>
                    </tr>
                    {% set total = total + reservation.getProduct().getSellPrice() * reservation.getAmount() %}
                {% endfor %}
                <tr style="background-color: #ebecf0">
                    <td></td>
                    <td><b>Totale prijs:</b></td>
                    <td><b>€ {{ total }}</b></td>
                </tr>
                </tbody>
            </table>
            <div class="content" style="color:darkred">
                {% if total < 3 %}
                    {{ consumed ? 'Dit broodje is al opgehaald.' : '' }}
                {% else %}
                    {{ consumed ? 'Deze broodjes zijn al opgehaald.' : '' }}
                {% endif %}
            </div>
        {%  endif %}
    </div>

{% endblock %}

{% block content_script %}
    <script type="text/javascript">
        $(document).ready(function (){
            const username = document.getElementById('username');
            username.value = '';
            const consume = document.getElementById('shop_consume');
            username.focus();
            $('#username').keydown( function(e) {
                if (e.key === 'Enter') {
                    e.preventDefault()
                    consume.click();
                }
            });
        });
    </script>
{% endblock %}

{'fraction_non_alphanumeric': 0.15914786967418545, 'fraction_numerical': 0.002506265664160401, 'mean_word_length': 1.3337510442773601, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 103, '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': '5759054', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1421, 'n_words': 286}