FreedomBox/plinth/modules/networks/templates/connections_list.html
Sunil Mohan Adapa 0748d951b3
networks: Move actions button into connection section
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 16:52:25 -05:00

125 lines
3.6 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">
.connection-status-label {
display: inline-block;
width: 5.5em;
padding: 5px 0px;
text-align: center;
margin-right: 10px;
}
.connection-show-label {
display: inline-block;
width: 40%;
}
.connection-type-label {
display: inline-block;
}
.list-group-item .btn {
margin: -2px 0;
}
.form.pull-right {
margin-right: 20px;
}
.form button {
width: 7em;
}
</style>
{% endblock %}
{% block configuration %}
<h3>{% trans "Connections" %}</h3>
<div class="btn-toolbar">
<a href="{% url 'networks:scan' %}" class="btn btn-default"
role="button" title="{% trans 'Nearby Wi-Fi Networks' %}">
<span class="fa fa-wifi" aria-hidden="true"></span>
{% trans "Nearby Wi-Fi Networks" %}
</a>
<a href="{% url 'networks:add' %}" class="btn btn-default"
role="button" title="{% trans 'Add Connection' %}">
<span class="fa fa-plus" aria-hidden="true"></span>
{% trans "Add Connection" %}
</a>
</div>
<div class="list-group">
{% for connection in connections %}
<div class="list-group-item clearfix">
<a href="{% url 'networks:delete' connection.uuid %}"
class="btn btn-default btn-sm pull-right"
role="button"
title="{% blocktrans with name=connection.name %}Delete connection {{ name }}{% endblocktrans %}">
<span class="fa fa-trash-o"
aria-hidden="true"></span>
</a>
{% if connection.is_active %}
<form class="form pull-right" method="post"
action="{% url 'networks:deactivate' connection.uuid %}">
{% csrf_token %}
<button type="submit" class="btn btn-default btn-sm">
{% trans "Deactivate" %}</button>
</form>
{% else %}
<form class="form pull-right" method="post"
action="{% url 'networks:activate' connection.uuid %}">
{% csrf_token %}
<button type="submit" class="btn btn-default btn-sm">
{% trans "Activate" %}</button>
</form>
{% endif %}
{% if connection.is_active %}
<span class="label label-success connection-status-label">
{% trans "Active" %}</span>
{% else %}
<span class="label label-warning connection-status-label">
{% trans "Inactive" %}</span>
{% endif %}
<a class="connection-show-label"
href="{% url 'networks:show' connection.uuid %}"
title="Show connection {{ connection.name }}">
{{ connection.name }}
</a>
<span class="connection-type-label">{{ connection.type_name }}</span>
</div>
{% endfor %}
</div>
{% include "connections_diagram.html" %}
{% endblock %}