Persano/databasesupabase
0
1{% extends "layout.html" %}2 3{% block content %}4<h2>Administração de Usuários</h2>5 6<table class="table table-bordered">7 <thead>8 <tr>9 <th>ID</th>10 <th>Email</th>11 <th>Status</th>12 <th>Ações</th>13 </tr>14 </thead>15 <tbody>16 {% for u in users %}17 <tr>18 <td>{{ u.id }}</td>19 <td>{{ u.email }}</td>20 <td>21 {% if u.banned %}22 <span class="text-danger">Bloqueado</span>23 {% else %}24 <span class="text-success">Ativo</span>25 {% endif %}26 </td>27 <td>28 {% if not u.banned %}29 <form method="POST" action="{{ url_for('block_user') }}" style="display:inline;">30 <input type="hidden" name="user_id" value="{{ u.id }}">31 <button type="submit" class="btn btn-warning btn-sm">Bloquear</button>32 </form>33 {% else %}34 <form method="POST" action="{{ url_for('unblock_user') }}" style="display:inline;">35 <input type="hidden" name="user_id" value="{{ u.id }}">36 <button type="submit" class="btn btn-success btn-sm">Desbloquear</button>37 </form>38 {% endif %}39 40 <form method="POST" action="{{ url_for('delete_user') }}" style="display:inline;">41 <input type="hidden" name="user_id" value="{{ u.id }}">42 <button type="submit" class="btn btn-danger btn-sm">Excluir</button>43 </form>44 </td>45 </tr>46 {% endfor %}47 </tbody>48</table>49 50<a href="{{ url_for('index') }}" class="btn btn-secondary">Voltar</a>51{% endblock %}52 