8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-07-02 04:04:06 +00:00

Merge branch 'fix_tables_half_width' into 'dev'

Fix tables half width

See merge request re2o/re2o!566
This commit is contained in:
chirac 2020-11-01 14:08:10 +01:00
commit d8bc523827
16 changed files with 709 additions and 766 deletions

View file

@ -59,7 +59,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% for facture in facture_list %} {% for facture in facture_list %}
<tr> <tr>
<td><a href="{% url 'users:profil' userid=facture.user.id %}">{{ facture.user }}</a></td> <td><a href="{% url 'users:profil' userid=facture.user.id %}">{{ facture.user }}</a></td>
<td>{{ facture.name }}</td> <td>
<table class="table-striped">
{% for article in facture.name_detailed %}
<tr>
<td>
{{ article }}
</td>
</tr>
{% endfor %}
</table>
</td>
<td>{{ facture.prix_total }}</td> <td>{{ facture.prix_total }}</td>
<td>{{ facture.paiement }}</td> <td>{{ facture.paiement }}</td>
<td>{{ facture.date }}</td> <td>{{ facture.date }}</td>

View file

@ -52,89 +52,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div> </div>
<div class="panel-body"> <div class="panel-body">
{% if facture_list %} {% if facture_list %}
<div class="table-responsive"> {% include 'cotisations/aff_cotisations.html' with facture_list=facture_list %}
{% if facture_list.paginator %} {% else %}
{% include 'pagination.html' with list=facture_list %} <p>{% trans "No invoice" %}</p>
{% endif %}
<table class="table table-striped">
<thead>
<tr>
<th>
{% trans "User" as tr_user %}
{% include 'buttons/sort.html' with prefix='cotis' col='user' text=tr_user %}
</th>
<th>{% trans "Designation" %}</th>
<th>{% trans "Total price" %}</th>
<th>
{% trans "Payment method" as tr_payment_method %}
{% include 'buttons/sort.html' with prefix='cotis' col='paiement' text=tr_payment_method %}
</th>
<th>
{% trans "Date" as tr_date %}
{% include 'buttons/sort.html' with prefix='cotis' col='date' text=tr_date %}
</th>
<th>
{% trans "Invoice ID" as tr_invoice_id %}
{% include 'buttons/sort.html' with prefix='cotis' col='id' text=tr_invoice_id %}
</th>
<th></th>
<th></th>
</tr>
</thead>
{% for facture in facture_list %}
<tr>
<td><a href="{% url 'users:profil' userid=facture.user.id %}">{{ facture.user }}</a></td>
<td>
<table class="table-striped">
{% for article in facture.name_detailed %}
<tr>
<td>
{{ article }}
</td>
</tr>
{% endfor %}
</table>
</td>
<td>{{ facture.prix_total }}</td>
<td>{{ facture.paiement }}</td>
<td>{{ facture.date }}</td>
<td>{{ facture.id }}</td>
<td>
{% can_edit facture %}
{% include 'buttons/edit.html' with href='cotisations:edit-facture' id=facture.id %}
{% acl_else %}
{% trans "Controlled invoice" %}
{% acl_end %}
{% can_delete facture %}
{% include 'buttons/suppr.html' with href='cotisations:del-facture' id=facture.id %}
{% acl_end %}
{% history_button facture %}
</td>
<td>
{% if facture.valid %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:facture-pdf' facture.id %}">
<i class="fa fa-file-pdf-o"></i> {% trans "PDF" %}
</a>
{% else %}
<i class="text-danger">{% trans "Invalidated invoice" %}</i>
{% endif %}
{% if facture.control and facture.is_subscription %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:voucher-pdf' facture.id %}">
<i class="fa fa-file-pdf-o"></i> {% trans "Voucher" %}
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% if facture_list.paginator %}
{% include 'pagination.html' with list=facture_list %}
{% endif %}
</div>
{% else %}
<p>{% trans "No invoice" %}</p>
{% endif %} {% endif %}
</div> </div>
</div> </div>

View file

@ -28,39 +28,75 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %} {% load logs_extra %}
{% load i18n %} {% load i18n %}
<div class="table-responsive"> {% if iptype_list.paginator %}
<table class="table table-striped"> {% include 'pagination.html' with list=iptype_list %}
<thead> {% endif %}
<tr>
<th>{% trans "IP type" %}</th> {% for type in iptype_list %}
<th>{% trans "Extension" %}</th> <div class="panel panel-default">
<th>{% blocktrans %}"infra" right required{% endblocktrans %}</th> <div class="panel-heading">
<th>{% trans "IPv4 range" %}</th> <div class="container-fluid">
<th>{% trans "v6 prefix" %}</th> <div class="row">
<th>{% trans "DNSSEC reverse v4/v6" %}</th> <div class="col-sm-3">
<th>{% trans "On VLAN(s)" %}</th> <h4>{{ type.name }}</h4>
<th>{% trans "Default ports opening" %}</th> </div>
<th></th> <div class="col-sm-3">
</tr> <h4>{{ type.extension }}</h4>
</thead> </div>
{% for type in iptype_list %} <div class="col-sm-4 text-center">
<tr> {% if type.need_infra %}
<td>{{ type.name }}</td> <span class="label label-success">{% trans "Infra right required" %}
<td>{{ type.extension }}</td> {% else %}
<td>{{ type.need_infra|tick }}</td> <span class="label label-danger">{% trans "Infra right not required" %}
<td>{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}{% if type.ip_network %}<b><u> on </u></b> {% endif %}
{{ type.ip_network }}{% endif %}</td> </div>
<td>{{ type.prefix_v6 }}/{{ type.prefix_v6_length }}</td> <div class="col-sm-2 text-right">
<td>{{ type.reverse_v4|tick }}/{{ type.reverse_v6|tick }}</td>
<td>{{ type.vlan }}</td>
<td>{{ type.ouverture_ports }}</td>
<td class="text-right">
{% can_edit type %} {% can_edit type %}
{% include 'buttons/edit.html' with href='machines:edit-iptype' id=type.id %} {% include 'buttons/edit.html' with href='machines:edit-iptype' id=type.id %}
{% acl_end %} {% acl_end %}
{% history_button type %} {% history_button type %}
</td> </div>
</tr> </div>
{% endfor %} </div>
</table> </div>
<div class="panel-body">
<div class="container-fluid">
<div class="row">
<div class="col-sm-8">
<b>{% trans "IPv4 range" %}</b>
{{ type.domaine_ip_start }} - {{ type.domaine_ip_stop }}
{% if type.ip_network %}
<b><u> on </u></b>
{{ type.ip_network }}{% endif %}
</div>
<div class="col-sm-4">
<b>{% trans "v6 prefix" %}</b>
{{ type.prefix_v6 }} /{{ type.prefix_v6_length }}
</div>
</div>
</br>
<div class="row">
<div class="col-sm-4">
<b>{% trans "DNSSEC reverse v4/v6" %}</b>
</br>
{{ type.reverse_v4|tick }}/{{ type.reverse_v6|tick }}
</div>
<div class="col-sm-4">
<b>{% trans "On VLAN(s)" %}</b>
</br>
{{ type.vlan }}
</div>
<div class="col-sm-4">
<b>{% trans "Default ports opening" %}</b>
</br>
{{ type.ouverture_ports }}
</div>
</div>
</div>
</div>
</div> </div>
{% endfor %}
{% if iptype_list.paginator %}
{% include 'pagination.html' with list=iptype_list %}
{% endif %}

View file

@ -26,43 +26,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %} {% load logs_extra %}
{% load i18n %} {% load i18n %}
<div class="table-responsive"> {% if machines_list.paginator %}
{% if machines_list.paginator %} {% include 'pagination.html' with list=machines_list %}
{% include 'pagination.html' with list=machines_list go_to_id="machines" %} {% endif %}
{% endif %}
<table class="table" id="machines_table"> {% for machine in machines_list %}
<colgroup> <div class="panel panel-default">
<col> <div class="panel-heading">
<col> <div class="container-fluid">
<col> <div class="row">
<col width="{% if ipv6_enabled %}300{% else %}150{% endif %}px"> <div class="col-sm-6">
<col width="144px"> {% trans "No name" as tr_no_name %}
</colgroup> <i class="fa fa-user"></i> {{ machine.user }}
<thead> <i class="fa fa-angle-right"></i>
{% trans "DNS name" as tr_dns_name %} <b>{{ machine.get_name|default:tr_no_name }}</b>
<th>{% include 'buttons/sort.html' with prefix='machine' col='name' text=tr_dns_name %}</th> </div>
<th>{% trans "Type" %}</th> <div class="col-sm-6 text-right">
<th>{% trans "MAC address" %}</th>
<th>{% trans "IP address" %}</th>
<th>{% trans "Actions" %}</th>
<tbody>
{% for machine in machines_list %}
<tr class="info">
<td colspan="4">
{% trans "No name" as tr_no_name %}
{% trans "View the profile" as tr_view_the_profile %}
{% if machine.active %}
<span class="text-success">
{% else %}
<span class="text-warning">{% trans "Deactivated" %}:
{% endif %}
<b>{{ machine.get_name|default:tr_no_name }}</b> </span><i class="fa fa-angle-right"></i>
<a href="{% url 'users:profil' userid=machine.user.id %}" title=tr_view_the_profile>
<i class="fa fa-user"></i> {{ machine.user }}
</a>
</td>
<td class="text-right">
{% can_create Interface machine.id %} {% can_create Interface machine.id %}
{% trans "Create an interface" as tr_create_an_interface %} {% trans "Create an interface" as tr_create_an_interface %}
{% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc=tr_create_an_interface %} {% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc=tr_create_an_interface %}
@ -71,156 +50,165 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_delete machine %} {% can_delete machine %}
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %} {% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
{% acl_end %} {% acl_end %}
</td> </div>
</tr> </div>
{% for interface in machine.interface_set.all %} </div>
<tr> </div>
<td> <div class="panel-body">
{% if interface.domain.related_domain.all %} {% for interface in machine.interface_set.all %}
{{ interface.domain }} <div class="conatiner-fluid">
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse" <div class="row">
data-target="#collapseDomain_{{ interface.id }}" aria-expanded="true" <div class="col-sm-3">
aria-controls="collapseDomain_{{ interface.id }}"> <b>{% trans "DNS name"%}:</b>
{% trans "Display the aliases" %} </br>
</button> {% if interface.domain.related_domain.all %}
{% else %} {{ interface.domain }}
{{ interface.domain }} <button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
{% endif %} data-target="#collapseDomain_{{ interface.id }}" aria-expanded="true"
</td> aria-controls="collapseDomain_{{ interface.id }}">
<td> {% trans "Show aliases" %}
{{ interface.machine_type }} </button>
</td> {% else %}
<td> {{ interface.domain }}
{{ interface.mac_address }} {% endif %}
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse" </div>
data-target="#collapseVendor_{{ interface.id }}" aria-expanded="true" <div class="col-sm-2">
aria-controls="collapseVendor_{{ interface.id }}"> <b>{% trans "Type" %}:</b>
{% trans "Display the vendor" %} </br>
</button> {{ interface.machine_type }}
</td> </div>
<td> <div class="col-sm-3">
<b>IPv4</b> {{ interface.ipv4 }} <b>{% trans "MAC address" %}:</b>
<br> </br>
{% if ipv6_enabled and interface.ipv6 != 'None' %} {{ interface.mac_address }}
<b>IPv6</b> <button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse" data-target="#collapseVendor_{{ interface.id }}" aria-expanded="true"
data-target="#collapseIpv6_{{ interface.id }}" aria-expanded="true" aria-controls="collapseVendor_{{ interface.id }}">
aria-controls="collapseIpv6_{{ interface.id }}"> {% trans "Display the vendor" %}
{% trans "Display the IPv6 address" %} </button>
</button> </div>
{% endif %} <div class="col-sm-2">
</td> <b>IPv4</b> {{ interface.ipv4 }}
<td class="text-right"> <br>
<div style="width: 128px;"> {% if interface.ipv6.count > 0 %}
<div class="btn-group" role="group"> <b>IPv6</b>
<button class="btn btn-primary btn-sm dropdown-toggle" type="button" <button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
id="editioninterface" data-toggle="dropdown" aria-haspopup="true" data-target="#collapseIpv6_{{ interface.id }}" aria-expanded="true"
aria-expanded="true"> aria-controls="collapseIpv6_{{ interface.id }}">
<i class="fa fa-edit"></i> <span class="caret"></span> {% trans "Display IPv6" %}
</button> </button>
<ul class="dropdown-menu" aria-labelledby="editioninterface"> {% else %}
{% can_edit interface %} <b>{% trans "No IPv6" %}</b>
<li> {% endif %}
<a href="{% url 'machines:edit-interface' interface.id %}"> </div>
<i class="fa fa-edit"></i> <div class="col-sm-2 text-right">
{% trans "Edit" %} <div class="btn-group" role="group">
</a> <button class="btn btn-primary btn-sm dropdown-toggle" type="button"
</li> id="editioninterface" data-toggle="dropdown" aria-haspopup="true"
{% acl_end %} aria-expanded="true">
{% can_create Domain interface.id %} <i class="fa fa-edit"></i><span class="caret"></span>
<li> </button>
<a href="{% url 'machines:index-alias' interface.id %}"> <ul class="dropdown-menu" aria-labelledby="editioninterface">
<i class="fa fa-edit"></i> {% can_edit interface %}
{% trans "Manage the aliases" %} <li>
</a> <a href="{% url 'machines:edit-interface' interface.id %}">
</li> <i class="fa fa-edit"></i>
{% acl_end %} {% trans "Edit" %}
{% can_create Ipv6List interface.id %} </a>
<li> </li>
<a href="{% url 'machines:index-ipv6' interface.id %}">
<i class="fa fa-edit"></i>
{% trans "Manage the IPv6 addresses" %}
</a>
</li>
{% acl_end %}
{% can_create SshFp interface.machine.id %}
<li>
<a href="{% url 'machines:index-sshfp' interface.machine.id %}">
<i class="fa fa-edit"></i>
{% trans "Manage the SSH fingerprints" %}
</a>
</li>
{% acl_end %}
{% can_create OuverturePortList %}
<li>
<a href="{% url 'machines:port-config' interface.id %}">
<i class="fa fa-edit"></i>
{% trans "Manage the ports configuration" %}
</a>
</li>
{% acl_end %}
</ul>
</div>
{% history_button interface %}
{% can_delete interface %}
{% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
{% acl_end %} {% acl_end %}
</div> {% can_create Domain interface.id %}
</td> <li>
</tr> <a href="{% url 'machines:index-alias' interface.id %}">
<tr> <i class="fa fa-edit"></i>
<td colspan=5 style="border-top: none; padding: 1px;"> {% trans "Manage the aliases" %}
<div class="collapse in" id="collapseVendor_{{ interface.id }}"> </a>
<ul class="list-group" style="margin-bottom: 0;"> </li>
<li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;"> {% acl_end %}
{{ interface.get_vendor }} {% can_create Ipv6List interface.id %}
</li> <li>
</ul> <a href="{% url 'machines:index-ipv6' interface.id %}">
</div> <i class="fa fa-edit"></i>
</td> {% trans "Manage the IPv6 addresses" %}
</tr> </a>
{% if ipv6_enabled and interface.ipv6 != 'None' %} </li>
<tr> {% acl_end %}
<td colspan=5 style="border-top: none; padding: 1px;"> {% can_create SshFp interface.machine.id %}
<div class="collapse in" id="collapseIpv6_{{ interface.id }}"> <li>
<ul class="list-group" style="margin-bottom: 0;"> <a href="{% url 'machines:index-sshfp' interface.machine.id %}">
{% for ipv6 in interface.ipv6.all %} <i class="fa fa-edit"></i>
<li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;"> {% trans "Manage the SSH fingerprints" %}
{{ ipv6 }} </a>
</li> </li>
{% endfor %} {% acl_end %}
</ul> {% can_create OuverturePortList %}
</div> <li>
</td> <a href="{% url 'machines:port-config' interface.id %}">
</tr> <i class="fa fa-edit"></i>
{% endif %} {% trans "Manage the ports configuration" %}
{% if interface.domain.related_domain.all %} </a>
<tr> </li>
<td colspan=5 style="border-top: none; padding: 1px;"> {% acl_end %}
<div class="collapse in" id="collapseDomain_{{ interface.id }}"> </ul>
<ul class="list-group" style="margin-bottom: 0;"> </div>
{% for al in interface.domain.related_domain.all %} {% history_button interface %}
<li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;"> {% can_delete interface %}
<a href="http://{{ al }}"> {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
{{ al }} {% acl_end %}
<i class="fa fa-share"></i> </div>
</a> </div>
</li> </div>
{% endfor %} <div class="row">
</ul> <div class="col-sm-12">
</div> <div class="collapse in" id="collapseVendor_{{ interface.id }}">
</td> <ul class="list-group" style="margin-bottom: 0;">
</tr> <li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;">
{% endif %} {{ interface.get_vendor }}
{% endfor %} </li>
<tr> </ul>
<td colspan="8"></td> </div>
</tr> {% if ipv6_enabled and interface.ipv6 != 'None' %}
<div class="collapse in" id="collapseIpv6_{{ interface.id }}">
<ul class="list-group" style="margin-bottom: 0;">
{% for ipv6 in interface.ipv6.all %}
<li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;">
{{ ipv6 }}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if interface.domain.related_domain.all %}
<div class="collapse in" id="collapseDomain_{{ interface.id }}">
<ul class="list-group" style="margin-bottom: 0;">
{% for al in interface.domain.related_domain.all %}
<li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;">
<a href="http://{{ al }}">
{{ al }}
<i class="fa fa-share"></i>
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
{%if machine.interface_set.count > 1 %}
<hr/>
{% endif %}
{% endfor %} {% endfor %}
</tbody> </div>
</table> </div>
<script> {% endfor %}
{% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list %}
{% endif %}
<script>
$("#machines_table").ready(function () { $("#machines_table").ready(function () {
var alias_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.domain.related_domain.all %}$("#collapseDomain_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}]; var alias_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.domain.related_domain.all %}$("#collapseDomain_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}];
for (var i = 0; i < alias_div.length; i++) { for (var i = 0; i < alias_div.length; i++) {
@ -241,7 +229,3 @@ with this program; if not, write to the Free Software Foundation, Inc.,
}); });
</script> </script>
{% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list go_to_id="machines" %}
{% endif %}
</div>

View file

@ -0,0 +1,106 @@
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Lara Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% load design %}
{% load acl %}
{% load logs_extra %}
{% load i18n %}
{% if port_list.paginator %}
{% include 'pagination.html' with list=port_list %}
{% endif %}
{% for ports in port_list %}
<div class="panel panel-default pt-2">
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-9">
<h4>{{ ports.name }}</h4>
</div>
<div class="col-sm-3 text-right">
{% can_edit ports %}
{% include 'buttons/edit.html' with href='machines:edit-portlist' id=ports.id %}
{% acl_end %}
{% can_delete ports %}
{% include 'buttons/suppr.html' with href='machines:del-portlist' id=ports.id %}
{% acl_end %}
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="container-fluid">
<div class="row">
<div class="col-sm-3">
<b>{% trans "TCP (input)" %}</b>
</br>
{% for p in ports.tcp_ports_in %}{{ p.show_port }}, {% endfor %}
</div>
<div class="col-sm-3">
<b>{% trans "TCP (output)" %}</b>
</br>
{% for p in ports.tcp_ports_out %}{{ p.show_port }}, {% endfor %}
</div>
<div class="col-sm-3">
<b>{% trans "UDP (input)" %}</b>
</br>
{% for p in ports.udp_ports_in %}{{ p.show_port }}, {% endfor %}
</div>
<div class="col-sm-3">
<b>{% trans "UDP (output)" %}</b>
</br>
{% for p in ports.udp_ports_out %}{{ p.show_port }}, {% endfor %}
</div>
</div>
</div>
</div>
<div class="panel-footer">
<div class="container-fluid">
<div class="row">
<div class="col-sm-2">
{% trans "Machines" %}
</div>
<div class="col-sm-10">
{% if ports.interface_set.all %}
{% for interface in ports.interface_set.all %}
<a class="fa fa-desktop" href="{% url 'users:profil' userid=interface.machine.user.id %}">
{{ interface }}
</a>
{% endfor %}
{% else %}
{% trans "None" %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
{% if port_list.paginator %}
{% include 'pagination.html' with list=port_list %}
{% endif %}

View file

@ -34,238 +34,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Machines" %} {% trans "Machines" %}
<span class="badge">{{ nb_machines }}</span> <span class="badge">{{ nb_machines }}</span>
</h3> </h3>
</div>
<div id="machines" class="panel-collapse collapse">
<div class="panel-body">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
<i class="fa fa-desktop"></i>
{% trans "Add a machine" %}
</a>
</div> </div>
<div class="panel-body"> <div id="machines" class="panel-collapse collapse">
{% if machines_list %} <div class="panel-body">
<div class="table-responsive"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
{% if machines_list.paginator %} <i class="fa fa-desktop"></i>
{% include 'pagination.html' with list=machines_list go_to_id="machines" %} {% trans "Add a machine" %}
{% endif %} </a>
</div>
<table class="table" id="machines_table"> <div class="panel-body">
<colgroup> {% if machines_list %}
<col> {% include 'machines/aff_machines.html' with machines_list=machines_list %}
<col> {% else %}
<col> <p>{%trans "No machines" %}</p>
<col width="{% if ipv6_enabled %}300{% else %}150{% endif %}px"> {% endif %}
<col width="144px">
</colgroup>
<thead>
{% trans "DNS name" as tr_dns_name %}
<th>{% include 'buttons/sort.html' with prefix='machine' col='name' text=tr_dns_name %}</th>
<th>{% trans "Type" %}</th>
<th>{% trans "MAC address" %}</th>
<th>{% trans "IP address" %}</th>
<th>{% trans "Actions" %}</th>
<tbody>
{% for machine in machines_list %}
<tr class="info">
<td colspan="4">
{% trans "No name" as tr_no_name %}
{% trans "View the profile" as tr_view_the_profile %}
{% if machine.active %}
<span class="text-success">
{% else %}
<span class="text-warning">{% trans "Deactivated" %}:
{% endif %}
<b>{{ machine.get_name|default:tr_no_name }}</b> </span><i class="fa fa-angle-right"></i>
<a href="{% url 'users:profil' userid=machine.user.id %}" title=tr_view_the_profile>
<i class="fa fa-user"></i> {{ machine.user }}
</a>
</td>
<td class="text-right">
{% can_create Interface machine.id %}
{% trans "Create an interface" as tr_create_an_interface %}
{% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc=tr_create_an_interface %}
{% acl_end %}
{% history_button machine %}
{% can_delete machine %}
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
{% acl_end %}
</td>
</tr>
{% for interface in machine.interface_set.all %}
<tr>
<td>
{% if interface.domain.related_domain.all %}
{{ interface.domain }}
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
data-target="#collapseDomain_{{ interface.id }}" aria-expanded="true"
aria-controls="collapseDomain_{{ interface.id }}">
{% trans "Display the aliases" %}
</button>
{% else %}
{{ interface.domain }}
{% endif %}
</td>
<td>
{{ interface.machine_type }}
</td>
<td>
{{ interface.mac_address }}
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
data-target="#collapseVendor_{{ interface.id }}" aria-expanded="true"
aria-controls="collapseVendor_{{ interface.id }}">
{% trans "Display the vendor" %}
</button>
</td>
<td>
<b>IPv4</b> {{ interface.ipv4 }}
<br>
{% if ipv6_enabled and interface.ipv6 != 'None' %}
<b>IPv6</b>
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
data-target="#collapseIpv6_{{ interface.id }}" aria-expanded="true"
aria-controls="collapseIpv6_{{ interface.id }}">
{% trans "Display the IPv6 address" %}
</button>
{% endif %}
</td>
<td class="text-right">
<div style="width: 128px;">
<div class="btn-group" role="group">
<button class="btn btn-primary btn-sm dropdown-toggle" type="button"
id="editioninterface" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="true">
<i class="fa fa-edit"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="editioninterface">
{% can_edit interface %}
<li>
<a href="{% url 'machines:edit-interface' interface.id %}">
<i class="fa fa-edit"></i>
{% trans "Edit" %}
</a>
</li>
{% acl_end %}
{% can_create Domain interface.id %}
<li>
<a href="{% url 'machines:index-alias' interface.id %}">
<i class="fa fa-edit"></i>
{% trans "Manage the aliases" %}
</a>
</li>
{% acl_end %}
{% can_create Ipv6List interface.id %}
<li>
<a href="{% url 'machines:index-ipv6' interface.id %}">
<i class="fa fa-edit"></i>
{% trans "Manage the IPv6 addresses" %}
</a>
</li>
{% acl_end %}
{% can_create SshFp interface.machine.id %}
<li>
<a href="{% url 'machines:index-sshfp' interface.machine.id %}">
<i class="fa fa-edit"></i>
{% trans "Manage the SSH fingerprints" %}
</a>
</li>
{% acl_end %}
{% can_create OuverturePortList %}
<li>
<a href="{% url 'machines:port-config' interface.id %}">
<i class="fa fa-edit"></i>
{% trans "Manage the ports configuration" %}
</a>
</li>
{% acl_end %}
</ul>
</div>
{% history_button interface %}
{% can_delete interface %}
{% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
{% acl_end %}
</div>
</td>
</tr>
<tr>
<td colspan=5 style="border-top: none; padding: 1px;">
<div class="collapse in" id="collapseVendor_{{ interface.id }}">
<ul class="list-group" style="margin-bottom: 0;">
<li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;">
{{ interface.get_vendor }}
</li>
</ul>
</div>
</td>
</tr>
{% if ipv6_enabled and interface.ipv6 != 'None' %}
<tr>
<td colspan=5 style="border-top: none; padding: 1px;">
<div class="collapse in" id="collapseIpv6_{{ interface.id }}">
<ul class="list-group" style="margin-bottom: 0;">
{% for ipv6 in interface.ipv6.all %}
<li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;">
{{ ipv6 }}
</li>
{% endfor %}
</ul>
</div>
</td>
</tr>
{% endif %}
{% if interface.domain.related_domain.all %}
<tr>
<td colspan=5 style="border-top: none; padding: 1px;">
<div class="collapse in" id="collapseDomain_{{ interface.id }}">
<ul class="list-group" style="margin-bottom: 0;">
{% for al in interface.domain.related_domain.all %}
<li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;">
<a href="http://{{ al }}">
{{ al }}
<i class="fa fa-share"></i>
</a>
</li>
{% endfor %}
</ul>
</div>
</td>
</tr>
{% endif %}
{% endfor %}
<tr>
<td colspan="8"></td>
</tr>
{% endfor %}
</tbody>
</table>
<script>
$("#machines_table").ready(function () {
var alias_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.domain.related_domain.all %}$("#collapseDomain_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}];
for (var i = 0; i < alias_div.length; i++) {
alias_div[i].collapse('hide');
}
});
$("#machines_table").ready(function () {
var ipv6_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.ipv6.all %}$("#collapseIpv6_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}];
for (var i = 0; i < ipv6_div.length; i++) {
ipv6_div[i].collapse('hide');
}
});
$("#machines_table").ready(function () {
var vendor_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.get_vendor %}$("#collapseVendor_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}];
for (var i = 0; i < vendor_div.length; i++) {
vendor_div[i].collapse('hide');
}
});
</script>
{% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list go_to_id="machines" %}
{% endif %}
</div>
{% else %}
<p>{% trans "No machine" %}</p>
{% endif %}
</div> </div>
</div> </div>
</div> </div>

View file

@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}{% trans "Machines" %}{% endblock %} {% block title %}{% trans "Machines" %}{% endblock %}
{% block content %} {% block content %}
<div class="mt-20 md-20">
<h2>{% trans "List of IP types" %}</h2> <h2>{% trans "List of IP types" %}</h2>
{% can_create IpType %} {% can_create IpType %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-iptype' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-iptype' %}">
@ -39,5 +40,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-iptype' %}"> <a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-iptype' %}">
<i class="fa fa-trash"></i> {% trans "Delete one or several IP types" %} <i class="fa fa-trash"></i> {% trans "Delete one or several IP types" %}
</a> </a>
</div>
{% include 'machines/aff_iptype.html' with iptype_list=iptype_list %} {% include 'machines/aff_iptype.html' with iptype_list=iptype_list %}
{% endblock %} {% endblock %}

View file

@ -14,52 +14,7 @@
<i class="fa fa-plus"></i> {% trans "Add a configuration" %} <i class="fa fa-plus"></i> {% trans "Add a configuration" %}
</a> </a>
{% acl_end %} {% acl_end %}
<table class="table table-striped"> <h2></h2>
<thead>
<tr> {% include 'machines/aff_portlist.html' with port_list=port_list %}
<th>{% trans "Name" %}</th>
<th>{% trans "TCP (input)" %}</th>
<th>{% trans "TCP (output)" %}</th>
<th>{% trans "UDP (input)" %}</th>
<th>{% trans "UDP (output)" %}</th>
<th>{% trans "Machines" %}</th>
<th></th>
</tr>
</thead>
{% for pl in port_list %}
<tr>
<td>{{ pl.name }}</td>
<td>{% for p in pl.tcp_ports_in %}{{ p.show_port }}, {% endfor %}</td>
<td>{% for p in pl.tcp_ports_out %}{{ p.show_port }}, {% endfor %}</td>
<td>{% for p in pl.udp_ports_in %}{{ p.show_port }}, {% endfor %}</td>
<td>{% for p in pl.udp_ports_out %}{{ p.show_port }}, {% endfor %}</td>
<td>
{% if pl.interface_set.all %}
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="editioninterface"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="editioninterface">
{% for interface in pl.interface_set.all %}
<li>
<a href="{% url 'users:profil' userid=interface.machine.user.id %}">
{{ interface }}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<td class="text-right">
{% can_edit pl %}
{% include 'buttons/edit.html' with href='machines:edit-portlist' id=pl.id %}
{% acl_end %}
{% can_delete pl %}
{% include 'buttons/suppr.html' with href='machines:del-portlist' id=pl.id %}
{% acl_end %}
</td>
</tr>
{% endfor %}
</table>
{% endblock %} {% endblock %}

View file

@ -1351,11 +1351,13 @@ def aff_profil(request, user):
@can_view_all(IpType) @can_view_all(IpType)
def index_iptype(request): def index_iptype(request):
"""View used to display the list of existing types of IP.""" """View used to display the list of existing types of IP."""
pagination_large_number = GeneralOption.get_cached_value("pagination_large_number")
iptype_list = ( iptype_list = (
IpType.objects.select_related("extension") IpType.objects.select_related("extension")
.select_related("vlan") .select_related("vlan")
.order_by("name") .order_by("name")
) )
iptype_list = re2o_paginator(request, iptype_list, pagination_large_number)
return render(request, "machines/index_iptype.html", {"iptype_list": iptype_list}) return render(request, "machines/index_iptype.html", {"iptype_list": iptype_list})

View file

@ -30,44 +30,79 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include 'pagination.html' with list=room_list %} {% include 'pagination.html' with list=room_list %}
{% endif %} {% endif %}
<table class="table table-striped"> {%for room in room_list %}
<thead> <div class="panel panel-default">
<tr> <div class="panel-heading">
{% trans "Room" as tr_room %} <div class="container-fluid">
{% trans "Building" as tr_building %} <div class="row">
<th>{% include 'buttons/sort.html' with prefix='building' col='name' text=tr_building %}</th> <div class="col-sm-4">
<th>{% include 'buttons/sort.html' with prefix='room' col='name' text=tr_room %}</th> <h4>{{ room.building }} - {{room.name }}</h4>
<th>{% trans "Connnected to" %}</th> </div>
<th>{% trans "User" %}</th> <div class="col-sm-8 text-right">
<th>{% trans "Details" %}</th> {% if room.port_set.all %}
<th>{% trans "End of subscription on" %}</th> <a href="{% url 'multi_op:disconnect-room' room.id %}" class="btn btn-danger btn-sm" role="button"><i class="fa fa-expand"></i></a>
<th>{% trans "Internet access" %}</th> {% endif %}
<th>{% trans "Action" %}</th> </div>
</tr> </div>
</thead> </div>
{% for room in room_list %} </div>
<tr> <div class="panel-body">
<td>{{ room.building }}</td> <div class="table-repsonsive">
<td>{{ room.name }}</td> <table class="table">
<td>{% if room.port_set.all %}<span class="label label-success">{{ asso_name }}{% else %}<span class="label label-danger">{% trans "Other operator" %}{% endif %}</span></td> <thead>
<td>{% if room.adherent %}<a href="{% url 'users:profil' room.adherent.id%}">{{ room.adherent }}</a>{% else %} {% trans "None" %}{% endif %}</td> <tr>
<td>{{ room.details }}</td> <th>{% trans "User"%}</th>
<td>{% if room.adherent.is_adherent %}<i class="text-success">{% else %}<i class="text-danger">{% endif %}{% if room.adherent.end_adhesion %}{{ room.adherent.end_adhesion}}{% else %}{% trans "Non member" %}{% endif %}</i></td> <th>{% trans "Connected to"%}</th>
<td> <th>{% trans "End of subscription on" %}</th>
{% if room.adherent.has_access == True %} <th>{% trans "Internet access" %}</th>
<i class="text-success">{% trans "Active" %}</i> </tr>
{% else %} </thead>
<i class="text-danger">{% trans "Disabled" %}</i> <tr>
{% endif %} <td>
</td> {% if room.adherent %}
<td> <a href="{% url 'users:profil' room.adherent.id%}">{{ room.adherent }}</a>
{% if room.port_set.all %} {% else %}
<a href="{% url 'multi_op:disconnect-room' room.id %}" class="btn btn-danger btn-sm" role="button"><i class="fa fa-expand"></i></a> {% trans "None" %}
{% endif %} {% endif %}
</td> </td>
</tr> <td>
{% endfor %} {% if room.port_set.all %}
</table> <span class="label label-success">{{ asso_name }}</span>
{% else %}
<span class="label label-danger">{% trans "Other operator" %}</span>
{% endif %}
</td>
<td>
{% if room.adherent.is_adherent %}
<i class="text-success">
{% else %}
<i class="text-danger">
{% endif %}
{% if room.adherent.end_adhesion %}
{{ room.adherent.end_adhesion}}
{% else %}
{% trans "Non member" %}
{% endif %}
</i>
</td>
<td>
{% if room.adherent.has_access == True %}
<i class="text-success">{% trans "Active" %}</i>
{% else %}
<i class="text-danger">{% trans "Disabled" %}</i>
{% endif %}
</td>
</tr>
</table>
</div>
</div>
{% if room.details %}
<div class="panel-footer">
<span><b>{% trans "Details: " %}</b>{{ room.details }}</span>
</div>
{% endif %}
</div>
{% endfor %}
{% if room_list.paginator %} {% if room_list.paginator %}
{% include 'pagination.html' with list=room_list %} {% include 'pagination.html' with list=room_list %}

View file

@ -25,32 +25,40 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %} {% load logs_extra %}
{% load i18n %} {% load i18n %}
<table class="table table-striped"> {% for service in service_list %}
<thead> <div class="panel panel-default">
<tr> <div class="panel-heading">
<th>{% trans "Name" %}</th> <div class="container-fluid">
<th>{% trans "URL" %}</th> <div class="row">
<th>{% trans "Description" %}</th> <div class="col-sm-9">
<th>{% trans "Image" %}</th> <h4>{{ service.name }}</h4>
<th></th> </div>
</tr> <div class="col-sm-3 text-right">
</thead> {% can_edit service %}
{% for service in service_list %} {% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
<tr> {% acl_end %}
<td>{{ service.name }}</td> {% can_delete service %}
<td>{{ service.url }}</td> {% include 'buttons/suppr.html' with href='preferences:del-service' id=service.id %}
<td>{{ service.description }}</td> {% acl_end %}
<td>{{ service.image }}</td> {% history_button service %}
<td class="text-right"> </div>
{% can_edit service %} </div>
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %} </div>
{% acl_end %} </div>
{% can_delete service %} <div class="panel-body">
{% include 'buttons/suppr.html' with href='preferences:del-service' id=service.id %} {{ service.description }}
{% acl_end %} </div>
{% history_button service %} <div class="panel-footer">
</td> <div class="container-fluid">
</tr> <div class="row">
{% endfor %} <div class="col-sm-6">
</table> <b>{% trans "URL" %}: </b>{{ service.url }}
</div>
<div class="col-sm-6">
<b>{% trans "Image" %}: </b>{{ service.image }}
</div>
</div>
</div>
</div>
</div>
{% endfor %}

View file

@ -39,13 +39,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% for contact in contacts %} {% for contact in contacts %}
<div class="panel panel-info"> <div class="panel panel-info">
<div class="panel-heading"><h4>{{ contact.get_name }}</h4></div> <div class="panel-heading">
<div class="panel-body"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-9">{{ contact.commentary}}</div> <div class="col-sm-6">
<div class="col-sm-3"><a href="mailto:{{ contact.address }}">{{ contact.address }}</a></div> <h4>{{ contact.get_name }}</h4>
</div> </div>
<div class="col-sm-6 text-right">
<a href="mailto:{{ contact.address }}">{{ contact.address }}</a>
</div>
</div>
</div>
</div> </div>
<div class="panel-body">
{{ contact.commentary}}
</div>
</div> </div>
{% endfor %} {% endfor %}

View file

@ -217,7 +217,46 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel-heading"> <div class="panel-heading">
<h4>{{ request_user.name }} {{ request_user.surname }}</h4> <h4>{{ request_user.name }} {{ request_user.surname }}</h4>
</div> </div>
<table class="table"> <table class="table visible-sm visible-md">
<tr>
<td>
<b>{% trans "Username" %}</b>
<br>
{{ request_user.pseudo }}
</td>
</tr>
<tr>
<td>
<b>{% trans "Room" %}</b>
<br>
{{ request_user.room }}
</td>
</tr>
<tr>
<td>
<b>{% trans "Internet access" %}</b>
<br>
{% if request_user.has_access %}
<i class="text-success">{% blocktrans with end_access_date=request.user.end_access|date:"d b Y" %}Until {{ end_access_date }}{% endblocktrans %}</i>
{% else %}
<i class="text-danger">{% trans "Disabled" %}</i>
{% endif %}
</td>
</tr>
<tr>
<td>
<b>{% trans "Membership" %}</b>
<br>
{% if request_user.is_adherent %}
<i class="text-success">{% blocktrans with end_adhesion_date=request_user.end_adhesion|date:"d b Y" %}Until {{ end_adhesion_date }}{% endblocktrans %}</i>
{% else %}
<i class="text-danger">{% trans "Non member" %}</i>
{% endif %}
</td>
</tr>
</table>
<table class="table visible-xs visible-lg">
<tr> <tr>
<th scope="row">{% trans "Username" %}</th> <th scope="row">{% trans "Username" %}</th>
<td class="text-right">{{ request_user.pseudo }}</td> <td class="text-right">{{ request_user.pseudo }}</td>
@ -266,7 +305,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div> </div>
<ul class="list-group"> <ul class="list-group">
{% for interface in interfaces|slice:":5" %} {% for interface in interfaces|slice:":5" %}
<div class="list-group-item">{{ interface }}</div> <div class="list-group-item" style="word-break: break-all">{{ interface }}</div>
{% endfor %} {% endfor %}
{% if interfaces|length > 5 %} {% if interfaces|length > 5 %}
<a class="list-group-item list-group-item-info" role="button" href="{% url 'users:mon-profil' %}"> <a class="list-group-item list-group-item-info" role="button" href="{% url 'users:mon-profil' %}">

View file

@ -1,13 +1,19 @@
{% load i18n %} {% load i18n %}
<div class="panel panel-info"> <div class="panel panel-info">
<div class="panel-heading"><h4>{% trans "Tickets" %}</h4></div> <div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h4>{% trans "Tickets" %}</h4>
</div>
<div class="col-sm-6 text-right">
<a class="btn btn-primary" href="{% url 'tickets:new-ticket' %}"><i class="fa fa-ticket"></i> {% trans "Open a ticket" %}</a>
</div>
</div>
</div>
</div>
<div class="panel-body"> <div class="panel-body">
<div class="row">
<div class="col-sm-9">
{% blocktrans %}If you are experiencing issues with the services offered by {{asso_name}}, you can open a ticket that will be taken care of. If you want to contact us on any other topic, please choose one address below.{% endblocktrans %} {% blocktrans %}If you are experiencing issues with the services offered by {{asso_name}}, you can open a ticket that will be taken care of. If you want to contact us on any other topic, please choose one address below.{% endblocktrans %}
</div>
<div class="col-sm-3"><a class="btn btn-primary" href="{% url 'tickets:new-ticket' %}"><i class="fa fa-ticket"></i> {% trans "Open a ticket" %}</a></div>
</div>
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@ Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en se veut agnostique au réseau considéré, de manière à être installable en
quelques clics. quelques clics.
Copyright © 2018 Gabriel Détraz Copyleft © 2018 Gabriel Détraz
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -24,64 +24,98 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %} {% load i18n %}
{% load logs_extra %} {% load logs_extra %}
<div class="table-responsive">
{% if port_profile_list.paginator %} {% for port_profile in port_profile_list %}
{% include 'pagination.html' with list=port_profile_list %} <div class="panel panel-default">
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-3">
<h4>{{ port_profile.name }}</h4>
</div>
<div class="col-sm-9 text-right">
{% can_edit port_profile %}
{% include 'buttons/edit.html' with href='topologie:edit-port-profile' id=port_profile.id %}
{% acl_end %}
{% history_button port_profile %}
{% can_delete port_profile %}
{% include 'buttons/suppr.html' with href='topologie:del-port-profile' id=port_profile.id %}
{% acl_end %}
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="table-repsonsive">
<table class="table">
<thead>
<tr>
<th>{% trans "Default for" %}</th>
<th>{% trans "RADIUS settings" %}</th>
<th>{% trans "Speed limit" %}</th>
<th>{% trans "MAC address limit" %}</th>
</tr>
</thead>
<tr>
<td>
{{ port_profile.profil_default }}
{% if port_profile.profil_default%}
{% if port_profile.on_dormitory %}{% blocktrans with dorm=port_profile.on_dormitory %}<b> on</b> {{ dorm }}{% endblocktrans %}{% else %}{% trans "Everywhere" %}{% endif %}
{% endif %}
</td>
<td>
<b>{% trans "RADIUS type: " %}</b>{{ port_profile.radius_type }}
{% if port_profile.radius_type == "MAC-radius" %}
<br>
<b>{% trans "RADIUS mode: " %}</b>{{ port_profile.radius_mode }}</td>
{% endif %}
<td>{{ port_profile.speed }}</td>
<td>{{ port_profile.mac_limit }}</td>
</tr>
</table>
</div>
</div>
{% if port_profile.security_parameters_enabled %}
<div class="panel-footer">
<p class="text-warning"><b>{% trans "Security" %}: </b>{{ port_profile.security_parameters_enabled|join:", " }}
</div>
{% endif %} {% endif %}
<div class="panel-footer">
<div class="container-fluid">
<table class="table table-striped"> <div class="row">
<thead> <div class="col-sm-2">
<tr> <h4>{% trans "VLANs" %}</h4>
<th>{% trans "Name" %}</th> </div>
<th>{% trans "Default for" %}</th> <div class="col-sm-10">
<th>{% trans "VLANs" %}</th> <div class="container-fluid">
<th>{% trans "RADIUS settings" %}</th> <div class="row">
<th>{% trans "Speed limit" %}</th> <div class="col-sm-3 text-left">
<th>{% trans "MAC address limit" %}</th> <b>{% trans "Untagged: " %}</b>
<th>{% trans "Security" %}</th> </div>
<th></th> <div class="col-sm-9 text-rit">
</tr> {%if port_profile.vlan_untagged %}
</thead> {{ port_profile.vlan_untagged }}
{% for port_profile in port_profile_list %} {% else %}
<tr> {% trans "None" %}
<td>{{ port_profile.name }}</td> {% endif %}
<td>{{ port_profile.profil_default }} {% if port_profile.profil_default%}<b> - {% if port_profile.on_dormitory %}{% blocktrans with dorm=port_profile.on_dormitory %} on {{ dorm }}{% endblocktrans %}{% else %}{% trans "Everywhere" %}{% endif %}</b>{% endif %}</td> </div>
<td> </div>
{% if port_profile.vlan_untagged %} <div class="row">
<b>{% trans "Untagged: " %}</b>{{ port_profile.vlan_untagged }} <div class="col-sm-3 text-left">
<br> <b>{% trans "Tagged: " %}</b>
{% endif %} </div>
{% if port_profile.vlan_tagged.all %} <div class="col-sm-9 text-left">
<b>{% trans "Tagged: " %}</b>{{ port_profile.vlan_tagged.all|join:", " }} {%if port_profile.vlan_tagged.all %}
{% endif %} {{ port_profile.vlan_tagged.all|join:", " }}
</td> {% else %}
<td> {% trans "None" %}
<b>{% trans "RADIUS type: " %}</b>{{ port_profile.radius_type }} {% endif %}
{% if port_profile.radius_type == "MAC-radius" %} </div>
<br> </div>
<b>{% trans "RADIUS mode: " %}</b>{{ port_profile.radius_mode }}</td> </div>
{% endif %} </div>
<td>{{ port_profile.speed }}</td> </div>
<td>{{ port_profile.mac_limit }}</td> </div>
<td>{{ port_profile.security_parameters_enabled|join:"<br>" }}</td> </div>
<td class="text-right">
{% can_edit port_profile %}
{% include 'buttons/edit.html' with href='topologie:edit-port-profile' id=port_profile.id %}
{% acl_end %}
{% history_button port_profile %}
{% can_delete port_profile %}
{% include 'buttons/suppr.html' with href='topologie:del-port-profile' id=port_profile.id %}
{% acl_end %}
</td>
</tr>
{% endfor %}
</table>
{% if port_profile_list.paginator %}
{% include 'pagination.html' with list=port_profile_list %}
{% endif %}
</div> </div>
{% endfor %}

View file

@ -26,45 +26,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %} {% load logs_extra %}
{% load i18n %} {% load i18n %}
<div class="table-responsive"> {% if switch_list.paginator %}
{% if switch_list.paginator %} {% include 'pagination.html' with list=switch_list %}
{% include 'pagination.html' with list=switch_list %} {% endif %}
{% endif %}
<table class="table table-striped"> {% for switch in switch_list %}
<thead> <div class="panel panel-default">
<tr> <div class="panel-heading">
{% trans "DNS name" as tr_dns %} <div class="container-fluid">
<th>{% include 'buttons/sort.html' with prefix='switch' col='dns' text=tr_dns %}</th> <div class="row">
{% trans "IPv4 address" as tr_ip %} <div class="col-sm-3">
<th>{% include 'buttons/sort.html' with prefix='switch' col='ip' text=tr_ip %}</th> <a href="{%url 'topologie:index-port' switch.id %}">
{% trans "Switch bay" as tr_bay %} {{ switch }}
<th>{% include 'buttons/sort.html' with prefix='switch' col='loc' text=tr_bay %}</th>
{% trans "Ports" as tr_ports %}
<th>{% include 'buttons/sort.html' with prefix='switch' col='ports' text=tr_ports %}</th>
{% trans "Stack" as tr_stack %}
<th>{% include 'buttons/sort.html' with prefix='switch' col='stack' text=tr_stack %}</th>
<th>{% trans "Stack member ID" %}</th>
<th>{% trans "Switch model" %}</th>
<th>{% trans "Details" %}</th>
<th></th>
</tr>
</thead>
{% for switch in switch_list %}
<tr>
<td>
<a href="{% url 'topologie:index-port' switch.id %}">
{{ switch }}
</a> </a>
</td> </div>
<td>{{ switch.interface_set.first.ipv4 }}</td> <div class="col-sm-3">
<td>{{ switch.switchbay }}</td> {% trans "Switch bay" as tr_bay %} {{switch.switchbay}}
<td>{{ switch.number }}</td> </div>
<td>{{ switch.stack.name }}</td> <div class="col-sm-6 text-right">
<td>{{ switch.stack_member_id }}</td>
<td>{{ switch.model }}</td>
<td>{{ switch.interface_set.first.details }}</td>
<td class="text-right">
{% can_edit switch %} {% can_edit switch %}
{% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.id %} {% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.id %}
{% acl_end %} {% acl_end %}
@ -75,14 +54,51 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create Port %} {% can_create Port %}
{% trans "Creation of ports" as tr_creation %} {% trans "Creation of ports" as tr_creation %}
{% include 'buttons/add.html' with href='topologie:create-ports' id=switch.id desc=tr_creation %} {% include 'buttons/add.html' with href='topologie:create-ports' id=switch.id desc=tr_creation %}
{% acl_end %} {% acl_end %}
</td> </div>
</tr> </div>
{% endfor %} </div>
</table> </div>
<div class="panel-body">
{% if switch_list.paginator %} <div class="container-fluid">
{% include 'pagination.html' with list=switch_list %} <div class="row">
<div class="col-sm-3">
<b>{% trans "IPv4 address"%}</b>
</br>
{{ switch.interface_set.first.ipv4 }}
</div>
<div class="col-sm-2">
<b>{% trans "Ports"%}</b>
</br>
{{ switch.number }}
</div>
<div class="col-sm-2">
<b>{% trans "Stack"%}</b>
</br>
{{ switch.stack.name }}
</div>
<div class="col-sm-2">
<b>{% trans "Stack member ID" %}</b>
</br>
{{ switch.stack_member_id }}
</div>
<div class="col-sm-3">
<b>{% trans "Switch model" %}</b>
</br>
{{ switch.model }}
</div>
</div>
</div>
</div>
{% if switch.interface_set.first.details %}
<div class="panel-footer">
<span><b>{% trans "Details: " %}</b>{{ switch.interface_set.first.details }}</span>
</div>
{% endif %} {% endif %}
</div> </div>
{% endfor %}
{% if switch_list.paginator %}
{% include 'pagination.html' with list=switch_list %}
{% endif %}