Continue the counter views

This commit is contained in:
Skia
2016-04-15 11:50:31 +02:00
parent c1a151d754
commit 478d1ed876
4 changed files with 69 additions and 19 deletions

View File

@ -0,0 +1,20 @@
{% extends "core/base.jinja" %}
{% 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 content %}
<h3>Counter</h3>
<h4>{{ counter }}</h4>
<p><strong>Club: </strong> {{ counter.club }}</p>
<p><strong>Products: </strong> {{ counter.products.all() }}</p>
{% endblock %}

View File

@ -14,6 +14,19 @@
<p><strong>Club: </strong> {{ counter.club }}</p>
<p><strong>Products: </strong> {{ counter.products.all() }}</p>
<div>
{% if barmen %}
<p>Enter client code:</p>
<form method="post" action="{{ url('counter:click', counter_id=counter.id) }}">
{% csrf_token %}
{{ form.as_p() }}
<input type="submit" value="CLICK" />
</form>
{% else %}
<p>Please, login</p>
{% endif %}
</div>
<div>
<h3>Barman: </h3>
<ul>
@ -27,13 +40,6 @@
<input type="submit" value="login" />
</form>
</div>
<div>
{% if barmen %}
<p>Enter client code:</p>
{% else %}
<p>Please, login</p>
{% endif %}
</div>
{% endblock %}