kopie van
https://github.com/ae-utbm/sith.git
synced 2025-07-11 12:29:24 +00:00
Make counter login forms
This commit is contained in:
@ -1,10 +1,39 @@
|
||||
{% 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>
|
||||
|
||||
<div>
|
||||
<h3>Barman: </h3>
|
||||
<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() }}
|
||||
<input type="submit" value="login" />
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
{% if barmen %}
|
||||
<p>Enter client code:</p>
|
||||
{% else %}
|
||||
<p>Please, login</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Verwijs in nieuw issue
Block a user