Added the user list in the Mia core application.

This commit is contained in:
2020-08-09 20:22:37 +08:00
parent 062e3f5c93
commit 2a6d3ff4cb
6 changed files with 195 additions and 33 deletions

View File

@ -0,0 +1,79 @@
{% extends "base.html" %}
{% comment %}
The Mia Core Application
user_list.html: The template for the user list
Copyright (c) 2020 imacat.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2020/8/9
{% endcomment %}
{% load static %}
{% load i18n %}
{% load mia_core %}
{% block settings %}
{% setvar "title" _("Account Management") %}
{% endblock %}
{% block content %}
<div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% url "mia_core:users.create" %}">
<i class="fas fa-user-plus"></i>
{{ _("New")|force_escape }}
</a>
</div>
{% if user_list %}
<table id="users" class="table table-striped table-hover">
<thead>
<tr>
<th scope="col">{{ _("Login ID")|force_escape }}</th>
<th scope="col">{{ _("Name")|force_escape }}</th>
<th class="actions" scope="col">{{ _("View")|force_escape }}</th>
</tr>
</thead>
<tbody>
{% for user in user_list %}
<tr>
<td>{{ user.login_id }}</td>
<td>
{{ user.name }}
{% if user.is_disabled %}
<span class="badge badge-pill badge-secondary">{{ _("Disabled")|force_escape }}</span>
{% endif %}
{% if user.is_deleted %}
<span class="badge badge-pill badge-dark">{{ _("Deleted")|force_escape }}</span>
{% endif %}
{% if not user.is_in_use %}
<span class="badge badge-pill badge-info">{{ _("Not In Use")|force_escape }}</span>
{% endif %}
</td>
<td class="actions">
<a href="{% url "mia_core:users.detail" user %}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i>
<span class="d-none d-sm-inline">{{ _("View")|force_escape }}</span>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{{ _("There is currently no data.")|force_escape }}</p>
{% endif %}
{% endblock %}