Sunil Mohan Adapa ad0552adf6
users: Make UI close to rest of the apps
- Provide an app title, description and link to manual page.

- Use AppView and app.html to present most of the elements.

- Remove tabs and turn create user into a button.

Tested by running: py.test-3 --include-functional -k users-groups

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-04 18:03:50 -04:00

81 lines
2.4 KiB
HTML

{% extends "app.html" %}
{% comment %}
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% block page_head %}
<style type="text/css">
.user-edit-label {
display: inline-block;
width: 75%;
}
.list-group-item .btn {
margin: -5px 0;
}
</style>
{% endblock %}
{% block status %}
<a href="{% url 'users:create' %}" class="btn btn-primary"
role="button" title="{% trans 'Create User' %}">
<span class="fa fa-plus" aria-hidden="true"></span>
{% trans 'Create User' %}
</a>
{% endblock %}
{% block configuration %}
<h3>{% trans "Users" %}</h3>
<div class="row">
<div class="col-sm-6">
<div class="list-group">
{% for user in object_list %}
<div class="list-group-item clearfix">
{% if user.username != last_admin_user %}
<a href="{% url 'users:delete' user.username %}"
class="btn btn-default btn-sm pull-right"
role="button"
title="{% blocktrans with username=user.username %}Delete user {{ username }}{% endblocktrans %}">
<span class="fa fa-trash-o"
aria-hidden="true"></span>
</a>
{% endif %}
<a class='user-edit-label'
href="{% url 'users:edit' user.username %}"
title="{% blocktrans with username=user.username %}Edit user {{ username }}{% endblocktrans %}">
{{ user.username }}
</a>
{% if not user.is_active %}
<span class="fa fa-ban"
aria-hidden="true"></span>
{% endif %}
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}