counter_main.jinja 1.94 KB
Newer Older
Skia's avatar
Skia committed
1 2
{% extends "core/base.jinja" %}

Skia's avatar
Skia committed
3 4 5 6 7 8 9 10
{% macro barman_logout_link(user) %}
<form method="post" action="{{ url('counter:logout', counter_id=counter.id) }}" class="inline">
    {% csrf_token %}
    <input type="hidden" name="user_id" value="{{ user.id }}">
    <button type="submit" name="submit_param" value="submit_value" class="link-button">{{ user.get_display_name() }}</button>
</form>
{% endmacro %}

Skia's avatar
Skia committed
11
{% block content %}
Skia's avatar
Skia committed
12
<h3>{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}</h3>
Skia's avatar
Skia committed
13 14

    <div>
Skia's avatar
Skia committed
15
        <h3>{% trans %}Sellings{% endtrans %}</h3>
16
        {% if last_basket %}
Skia's avatar
Skia committed
17 18
        <h4>{% trans %}Last selling: {% endtrans %}</h4>
        <p>{% trans %}Client: {% endtrans %}{{ last_customer }} - {% trans %}New amount: {% endtrans %}{{ new_customer_amount }} €.</p>
19 20 21 22 23
            <ul>
            {% for s in last_basket %}
                <li>{{ s }}</li>
            {% endfor %}
            </ul>
Skia's avatar
Skia committed
24
            <p><strong>{% trans %}Total: {% endtrans %}{{ last_total }}</strong></p>
25
        {% endif %}
Skia's avatar
Skia committed
26
        {% if barmen %}
Skia's avatar
Skia committed
27
        <p>{% trans %}Enter client code:{% endtrans %}</p>
28
        <form method="post" action="{{ url('counter:details', counter_id=counter.id) }}">
Skia's avatar
Skia committed
29 30
            {% csrf_token %}
            {{ form.as_p() }}
Skia's avatar
Skia committed
31
            <p><input type="submit" value="{% trans %}validate{% endtrans %}" /></p>
Skia's avatar
Skia committed
32 33
        </form>
        {% else %}
Skia's avatar
Skia committed
34
        <p>{% trans %}Please, login{% endtrans %}</p>
Skia's avatar
Skia committed
35 36
        {% endif %}
    </div>
Skia's avatar
Skia committed
37
    {% if counter.type == 'BAR' %}
Skia's avatar
Skia committed
38
    <div>
Skia's avatar
Skia committed
39
        <h3>{% trans %}Barman: {% endtrans %}</h3>
Skia's avatar
Skia committed
40 41 42 43 44 45 46 47
        <ul>
        {% for b in barmen %}
            <li>{{ barman_logout_link(b) }}</li>
        {% endfor %}
        </ul>
        <form method="post" action="{{ url('counter:login', counter_id=counter.id) }}">
            {% csrf_token %}
            {{ login_form.as_p() }}
Skia's avatar
Skia committed
48
            <p><input type="submit" value="{% trans %}login{% endtrans %}" /></p>
Skia's avatar
Skia committed
49 50
        </form>
    </div>
Skia's avatar
Skia committed
51
    {% endif %}
Skia's avatar
Skia committed
52 53 54 55
{% endblock %}