counter_main.jinja 1.99 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 %}

11 12 13 14
{% block title %}
{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}
{% endblock %}

Skia's avatar
Skia committed
15
{% block content %}
Skia's avatar
Skia committed
16
<h3>{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}</h3>
Skia's avatar
Skia committed
17 18

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