Completed first-found updates for the users list view.

This commit is contained in:
Matt Scott 2023-02-20 09:14:58 -05:00
parent 0e67366c5f
commit 9ac81363e3

View File

@ -1,27 +1,18 @@
{% extends "base.html" %} {% extends "base.html" %}
{% set active_page = "admin_users" %} {% set active_page = "admin_users" %}
{% block title %}<title>Users - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
User Management - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<div class="content-header"> <div class="content-header">
<div class="container-fluid"> <div class="container-fluid">
<div class="row mb-2"> <div class="row mb-2">
<div class="col-sm-6"> <div class="col-sm-6">
<h1 class="m-0 text-dark"> <h1 class="m-0 text-dark">Users</h1>
User
<small>Manage user privileges</small>
</h1>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<ol class="breadcrumb float-sm-right"> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li> <li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li>
<li class="breadcrumb-item active">User</li> <li class="breadcrumb-item active">Users</li>
</ol> </ol>
</div> </div>
</div> </div>
@ -34,17 +25,22 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card card-outline card-primary shadow">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">User Management</h3> <h3 class="card-title">Users</h3>
<div class="card-tools">
<a href="{{ url_for('admin.edit_user') }}"> <a href="{{ url_for('admin.edit_user') }}">
<button type="button" class="btn btn-primary float-right button_add_user"> <button type="button" class="btn btn-primary button_add_user" title="Create User">
<i class="fa-solid fa-plus"></i>&nbsp;Add User <i class="fa-solid fa-plus"></i>&nbsp;Create User
</button> </button>
</a> </a>
</div> </div>
<div class="card-body"> <!-- /.card-tools -->
<table id="tbl_users" class="table table-bordered table-striped"> </div>
<!-- /.card-header -->
<div class="card-body table-responsive">
<table id="tbl_users"
class="table table-bordered table-striped table-hover table-sm records">
<thead> <thead>
<tr> <tr>
<th>Username</th> <th>Username</th>
@ -74,30 +70,35 @@
{% endfor %} {% endfor %}
</select> </select>
</td> </td>
<td width="6%"> <td>
<button type="button" class="btn btn-warning button_revoke" <button type="button" class="btn btn-warning button_revoke"
title="Revoke Privileges"
id="{{ user.username }}" id="{{ user.username }}"
{% if current_user.role.name=='Operator' and user.role.name=='Administrator' %}disabled{% endif %}> {% if current_user.role.name=='Operator' and user.role.name=='Administrator' %}disabled{% endif %}>
<i class="fa-solid fa-link-slash"></i>&nbsp;Revoke <i class="fa-solid fa-link-slash"></i>
</button> </button>
</td> </td>
<td width="15%"> <td>
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" <button class="btn btn-primary dropdown-toggle" type="button"
id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false"
{% if current_user.role.name=='Operator' and user.role.name=='Administrator' %}disabled{% endif %}> {% if current_user.role.name=='Operator' and user.role.name=='Administrator' %}disabled{% endif %}>
<i class="fa-solid fa-bars"></i>&nbsp;Actions <i class="fa-solid fa-bars"></i>
</button> </button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu"> <div class="dropdown-menu" aria-labelledby="dropdownMenu">
<button type="button" class="dropdown-item btn-warning" onclick="window.location.href='{{ url_for('admin.edit_user', user_username=user.username) }}'"> <button type="button" class="dropdown-item btn-warning"
onclick="window.location.href='{{ url_for('admin.edit_user', user_username=user.username) }}'">
<i class="fa-solid fa-edit"></i>&nbsp;Edit User <i class="fa-solid fa-edit"></i>&nbsp;Edit User
</button> </button>
{% if not user.username==current_user.username or (current_user.role.name=='Operator' and user.role.name=='Administrator') %} {% if not user.username==current_user.username or (current_user.role.name=='Operator' and user.role.name=='Administrator') %}
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<button type="button"class="dropdown-item btn-secondary button_delete" id="{{ user.username }}"> <button type="button"
<font color="red"> class="dropdown-item btn-secondary button_delete"
id="{{ user.username }}">
<span style="color: red;">
<i class="fa-solid fa-trash"></i>&nbsp;Delete User <i class="fa-solid fa-trash"></i>&nbsp;Delete User
</font> </span>
</button> </button>
{% endif %} {% endif %}
</div> </div>
@ -108,10 +109,15 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- /.card-body -->
</div> </div>
<!-- /.card -->
</div> </div>
<!-- /.col -->
</div> </div>
<!-- /.row -->
</div> </div>
<!-- /.container-fluid -->
</section> </section>
{% endblock %} {% endblock %}