71 lines
3.2 KiB
HTML
71 lines
3.2 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% import 'layouts/_pagination.html' as pager %}
|
|
{% block title %}{{ _('Manage Users') }} - UdeS team manager{% endblock %}
|
|
{% block page_title %}{{ _('Manage Users') }}{% endblock %}
|
|
{% block breadcrumb %}<span class="breadcrumb">Home / Users</span>{% endblock %}
|
|
|
|
{% block header_actions %}
|
|
<a href="{{ url_for('users.create_user') }}" class="btn btn-primary">
|
|
<i class="fas fa-user-plus"></i> {{ _('Add User') }}
|
|
</a>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="table-container">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ _('Name') }}</th>
|
|
<th>{{ _('Username') }}</th>
|
|
<th>{{ _('Email') }}</th>
|
|
<th>{{ _('Role') }}</th>
|
|
<th>{{ _('Status') }}</th>
|
|
<th>{{ _('Joined') }}</th>
|
|
<th>{{ _('Actions') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for u in users %}
|
|
<tr>
|
|
<td>
|
|
<div class="user-mini">
|
|
<div class="avatar-sm">{{ u.username[:2] | upper }}</div>
|
|
<a href="{{ url_for('users.view_user', user_id=u.id) }}">{{ u.username }}</a>
|
|
</div>
|
|
</td>
|
|
<td>{{ u.username }}</td>
|
|
<td>{{ u.email }}</td>
|
|
<td><span class="badge badge-{{ u.role }}">{{ u.role | capitalize }}</span></td>
|
|
<td>
|
|
{% if u.is_active_account %}
|
|
<span class="badge badge-success">Active</span>
|
|
{% else %}
|
|
<span class="badge badge-danger">Inactive</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ u.created_at.strftime('%m/%d/%Y') }}</td>
|
|
<td>
|
|
<a href="{{ url_for('users.edit_user', user_id=u.id) }}" class="btn btn-sm btn-outline">
|
|
<i class="fas fa-edit"></i> {{ _('Edit') }}
|
|
</a>
|
|
{% if u.id != current_user.id %}
|
|
<form method="POST" action="{{ url_for('users.delete_user', user_id=u.id) }}" class="inline-form" data-confirm="{{ _('Delete %(name)s? This cannot be undone.', name=u.username) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
<button type="submit" class="btn btn-sm btn-danger">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{ pager.controls(pagination) }}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|