mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: logout | testes permissoes | redirecionamento com base no gupo do usuario
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load custom_filter_tag %}
|
||||
|
||||
|
||||
|
||||
{% block 'title' %}
|
||||
@@ -41,12 +43,13 @@ Detalhes {{comanda.name}}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<button class="button" id="imprimirFichas"
|
||||
{% if comanda.status != 'OPEN'%}
|
||||
<button class="button" id="imprimirFichas"
|
||||
style="display: none;"
|
||||
{% endif %}
|
||||
onclick="imprimirFichas()">Fichas</button>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if user|groupUser:"Gerente" %}
|
||||
<button class="button" id="imprimirFichas" hx-get="{% url 'reopenComanda' comanda.id %} " hx-trigger="click" hx-swap="none" onclick="reloadPage()"
|
||||
{% if comanda.status == 'OPEN'%}
|
||||
style="display: none;"
|
||||
@@ -55,6 +58,8 @@ Detalhes {{comanda.name}}
|
||||
{% endif %}
|
||||
>Reabrir</button>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Binary file not shown.
@@ -12,4 +12,9 @@ def filter_total(value):
|
||||
total = 0
|
||||
for produto in consumo:
|
||||
total += produto.product.price
|
||||
return f'R$ {total}'
|
||||
return f'R$ {total}'
|
||||
|
||||
|
||||
@register.filter(name='groupUser')
|
||||
def has_group(user, group_name):
|
||||
return user.groups.filter(name=group_name).exists()
|
||||
Reference in New Issue
Block a user