Sith/counter/templates/counter/counter_main.jinja

59 lines
2.0 KiB
Plaintext
Raw Normal View History

2016-03-28 12:54:35 +00:00
{% extends "core/base.jinja" %}
2016-04-12 08:00:47 +00:00
{% 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 %}
{% block title %}
{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}
{% endblock %}
2016-03-28 12:54:35 +00:00
{% block content %}
2016-07-22 11:34:34 +00:00
<h3>{% trans counter_name=counter %}{{ counter_name }} counter{% endtrans %}</h3>
2016-04-15 09:50:31 +00:00
<div>
2016-07-19 17:03:16 +00:00
<h3>{% trans %}Sellings{% endtrans %}</h3>
{% if last_basket %}
2016-07-19 17:03:16 +00:00
<h4>{% trans %}Last selling: {% endtrans %}</h4>
<p>{% trans %}Client: {% endtrans %}{{ last_customer }} - {% trans %}New amount: {% endtrans %}{{ new_customer_amount }} €.</p>
<ul>
{% for s in last_basket %}
<li>{{ s }}</li>
{% endfor %}
</ul>
2016-07-19 17:03:16 +00:00
<p><strong>{% trans %}Total: {% endtrans %}{{ last_total }} €</strong></p>
{% endif %}
2016-04-15 09:50:31 +00:00
{% if barmen %}
2016-07-19 17:03:16 +00:00
<p>{% trans %}Enter client code:{% endtrans %}</p>
<form method="post" action="">
2016-04-15 09:50:31 +00:00
{% csrf_token %}
<input type="hidden" name="counter_token" value="{{ counter.token }}" />
2016-04-15 09:50:31 +00:00
{{ form.as_p() }}
2016-07-19 17:03:16 +00:00
<p><input type="submit" value="{% trans %}validate{% endtrans %}" /></p>
2016-04-15 09:50:31 +00:00
</form>
{% else %}
2016-07-19 17:03:16 +00:00
<p>{% trans %}Please, login{% endtrans %}</p>
2016-04-15 09:50:31 +00:00
{% endif %}
</div>
2016-07-21 18:03:31 +00:00
{% if counter.type == 'BAR' %}
2016-04-12 08:00:47 +00:00
<div>
2016-07-19 17:03:16 +00:00
<h3>{% trans %}Barman: {% endtrans %}</h3>
2016-04-12 08:00:47 +00:00
{% for b in barmen %}
2016-08-26 18:57:04 +00:00
<p>{{ barman_logout_link(b) }}</p>
2016-04-12 08:00:47 +00:00
{% endfor %}
<form method="post" action="{{ url('counter:login', counter_id=counter.id) }}">
{% csrf_token %}
{{ login_form.as_p() }}
2016-07-19 17:03:16 +00:00
<p><input type="submit" value="{% trans %}login{% endtrans %}" /></p>
2016-04-12 08:00:47 +00:00
</form>
</div>
2016-07-21 18:03:31 +00:00
{% endif %}
2016-03-28 12:54:35 +00:00
{% endblock %}