8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-06-30 11:04:38 +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 %}
<tr>
<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.paiement }}</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 class="panel-body">
{% if facture_list %}
<div class="table-responsive">
{% if facture_list.paginator %}
{% include 'pagination.html' with list=facture_list %}
{% 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>
{% include 'cotisations/aff_cotisations.html' with facture_list=facture_list %}
{% else %}
<p>{% trans "No invoice" %}</p>
{% endif %}
</div>
</div>

View file

@ -28,39 +28,75 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %}
{% load i18n %}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "IP type" %}</th>
<th>{% trans "Extension" %}</th>
<th>{% blocktrans %}"infra" right required{% endblocktrans %}</th>
<th>{% trans "IPv4 range" %}</th>
<th>{% trans "v6 prefix" %}</th>
<th>{% trans "DNSSEC reverse v4/v6" %}</th>
<th>{% trans "On VLAN(s)" %}</th>
<th>{% trans "Default ports opening" %}</th>
<th></th>
</tr>
</thead>
{% for type in iptype_list %}
<tr>
<td>{{ type.name }}</td>
<td>{{ type.extension }}</td>
<td>{{ type.need_infra|tick }}</td>
<td>{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}{% if type.ip_network %}<b><u> on </u></b>
{{ type.ip_network }}{% endif %}</td>
<td>{{ type.prefix_v6 }}/{{ type.prefix_v6_length }}</td>
<td>{{ type.reverse_v4|tick }}/{{ type.reverse_v6|tick }}</td>
<td>{{ type.vlan }}</td>
<td>{{ type.ouverture_ports }}</td>
<td class="text-right">
{% if iptype_list.paginator %}
{% include 'pagination.html' with list=iptype_list %}
{% endif %}
{% for type in iptype_list %}
<div class="panel panel-default">
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-3">
<h4>{{ type.name }}</h4>
</div>
<div class="col-sm-3">
<h4>{{ type.extension }}</h4>
</div>
<div class="col-sm-4 text-center">
{% if type.need_infra %}
<span class="label label-success">{% trans "Infra right required" %}
{% else %}
<span class="label label-danger">{% trans "Infra right not required" %}
{% endif %}
</div>
<div class="col-sm-2 text-right">
{% can_edit type %}
{% include 'buttons/edit.html' with href='machines:edit-iptype' id=type.id %}
{% acl_end %}
{% history_button type %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
</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>
{% 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 i18n %}
<div class="table-responsive">
{% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list go_to_id="machines" %}
{% endif %}
{% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list %}
{% endif %}
<table class="table" id="machines_table">
<colgroup>
<col>
<col>
<col>
<col width="{% if ipv6_enabled %}300{% else %}150{% endif %}px">
<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">
{% for machine in machines_list %}
<div class="panel panel-default">
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
{% trans "No name" as tr_no_name %}
<i class="fa fa-user"></i> {{ machine.user }}
<i class="fa fa-angle-right"></i>
<b>{{ machine.get_name|default:tr_no_name }}</b>
</div>
<div class="col-sm-6 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 %}
@ -71,156 +50,165 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% 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 %}
</div>
</div>
</div>
</div>
<div class="panel-body">
{% for interface in machine.interface_set.all %}
<div class="conatiner-fluid">
<div class="row">
<div class="col-sm-3">
<b>{% trans "DNS name"%}:</b>
</br>
{% 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 "Show aliases" %}
</button>
{% else %}
{{ interface.domain }}
{% endif %}
</div>
<div class="col-sm-2">
<b>{% trans "Type" %}:</b>
</br>
{{ interface.machine_type }}
</div>
<div class="col-sm-3">
<b>{% trans "MAC address" %}:</b>
</br>
{{ 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>
</div>
<div class="col-sm-2">
<b>IPv4</b> {{ interface.ipv4 }}
<br>
{% if interface.ipv6.count > 0 %}
<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 IPv6" %}
</button>
{% else %}
<b>{% trans "No IPv6" %}</b>
{% endif %}
</div>
<div class="col-sm-2 text-right">
<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 %}
</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>
{% 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>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<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>
{% 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 %}
</tbody>
</table>
</div>
</div>
<script>
{% endfor %}
{% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list %}
{% endif %}
<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++) {
@ -241,7 +229,3 @@ with this program; if not, write to the Free Software Foundation, Inc.,
});
</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" %}
<span class="badge">{{ nb_machines }}</span>
</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 class="panel-body">
{% if machines_list %}
<div class="table-responsive">
{% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list go_to_id="machines" %}
{% endif %}
<table class="table" id="machines_table">
<colgroup>
<col>
<col>
<col>
<col width="{% if ipv6_enabled %}300{% else %}150{% endif %}px">
<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 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 class="panel-body">
{% if machines_list %}
{% include 'machines/aff_machines.html' with machines_list=machines_list %}
{% else %}
<p>{%trans "No machines" %}</p>
{% endif %}
</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 content %}
<div class="mt-20 md-20">
<h2>{% trans "List of IP types" %}</h2>
{% can_create 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' %}">
<i class="fa fa-trash"></i> {% trans "Delete one or several IP types" %}
</a>
</div>
{% include 'machines/aff_iptype.html' with iptype_list=iptype_list %}
{% endblock %}

View file

@ -14,52 +14,7 @@
<i class="fa fa-plus"></i> {% trans "Add a configuration" %}
</a>
{% acl_end %}
<table class="table table-striped">
<thead>
<tr>
<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>
<h2></h2>
{% include 'machines/aff_portlist.html' with port_list=port_list %}
{% endblock %}

View file

@ -1351,11 +1351,13 @@ def aff_profil(request, user):
@can_view_all(IpType)
def index_iptype(request):
"""View used to display the list of existing types of IP."""
pagination_large_number = GeneralOption.get_cached_value("pagination_large_number")
iptype_list = (
IpType.objects.select_related("extension")
.select_related("vlan")
.order_by("name")
)
iptype_list = re2o_paginator(request, iptype_list, pagination_large_number)
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 %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "Room" as tr_room %}
{% trans "Building" as tr_building %}
<th>{% include 'buttons/sort.html' with prefix='building' col='name' text=tr_building %}</th>
<th>{% include 'buttons/sort.html' with prefix='room' col='name' text=tr_room %}</th>
<th>{% trans "Connnected to" %}</th>
<th>{% trans "User" %}</th>
<th>{% trans "Details" %}</th>
<th>{% trans "End of subscription on" %}</th>
<th>{% trans "Internet access" %}</th>
<th>{% trans "Action" %}</th>
</tr>
</thead>
{% for room in room_list %}
<tr>
<td>{{ room.building }}</td>
<td>{{ room.name }}</td>
<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>
<td>{% if room.adherent %}<a href="{% url 'users:profil' room.adherent.id%}">{{ room.adherent }}</a>{% else %} {% trans "None" %}{% endif %}</td>
<td>{{ room.details }}</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>
<td>
{% if room.port_set.all %}
<a href="{% url 'multi_op:disconnect-room' room.id %}" class="btn btn-danger btn-sm" role="button"><i class="fa fa-expand"></i></a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{%for room in room_list %}
<div class="panel panel-default">
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-4">
<h4>{{ room.building }} - {{room.name }}</h4>
</div>
<div class="col-sm-8 text-right">
{% if room.port_set.all %}
<a href="{% url 'multi_op:disconnect-room' room.id %}" class="btn btn-danger btn-sm" role="button"><i class="fa fa-expand"></i></a>
{% endif %}
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="table-repsonsive">
<table class="table">
<thead>
<tr>
<th>{% trans "User"%}</th>
<th>{% trans "Connected to"%}</th>
<th>{% trans "End of subscription on" %}</th>
<th>{% trans "Internet access" %}</th>
</tr>
</thead>
<tr>
<td>
{% if room.adherent %}
<a href="{% url 'users:profil' room.adherent.id%}">{{ room.adherent }}</a>
{% else %}
{% trans "None" %}
{% endif %}
</td>
<td>
{% if room.port_set.all %}
<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 %}
{% 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 i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "URL" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Image" %}</th>
<th></th>
</tr>
</thead>
{% for service in service_list %}
<tr>
<td>{{ service.name }}</td>
<td>{{ service.url }}</td>
<td>{{ service.description }}</td>
<td>{{ service.image }}</td>
<td class="text-right">
{% can_edit service %}
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
{% acl_end %}
{% can_delete service %}
{% include 'buttons/suppr.html' with href='preferences:del-service' id=service.id %}
{% acl_end %}
{% history_button service %}
</td>
</tr>
{% endfor %}
</table>
{% for service in service_list %}
<div class="panel panel-default">
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-9">
<h4>{{ service.name }}</h4>
</div>
<div class="col-sm-3 text-right">
{% can_edit service %}
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
{% acl_end %}
{% can_delete service %}
{% include 'buttons/suppr.html' with href='preferences:del-service' id=service.id %}
{% acl_end %}
{% history_button service %}
</div>
</div>
</div>
</div>
<div class="panel-body">
{{ service.description }}
</div>
<div class="panel-footer">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<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 %}
<div class="panel panel-info">
<div class="panel-heading"><h4>{{ contact.get_name }}</h4></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-9">{{ contact.commentary}}</div>
<div class="col-sm-3"><a href="mailto:{{ contact.address }}">{{ contact.address }}</a></div>
</div>
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h4>{{ contact.get_name }}</h4>
</div>
<div class="col-sm-6 text-right">
<a href="mailto:{{ contact.address }}">{{ contact.address }}</a>
</div>
</div>
</div>
</div>
<div class="panel-body">
{{ contact.commentary}}
</div>
</div>
{% endfor %}

View file

@ -217,7 +217,46 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel-heading">
<h4>{{ request_user.name }} {{ request_user.surname }}</h4>
</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>
<th scope="row">{% trans "Username" %}</th>
<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>
<ul class="list-group">
{% 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 %}
{% if interfaces|length > 5 %}
<a class="list-group-item list-group-item-info" role="button" href="{% url 'users:mon-profil' %}">

View file

@ -1,13 +1,19 @@
{% load i18n %}
<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="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 %}
</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>

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
quelques clics.
Copyright © 2018 Gabriel Détraz
Copyleft © 2018 Gabriel Détraz
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
@ -24,64 +24,98 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% load logs_extra %}
<div class="table-responsive">
{% if port_profile_list.paginator %}
{% include 'pagination.html' with list=port_profile_list %}
{% for port_profile in 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 %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Default for" %}</th>
<th>{% trans "VLANs" %}</th>
<th>{% trans "RADIUS settings" %}</th>
<th>{% trans "Speed limit" %}</th>
<th>{% trans "MAC address limit" %}</th>
<th>{% trans "Security" %}</th>
<th></th>
</tr>
</thead>
{% for port_profile in port_profile_list %}
<tr>
<td>{{ port_profile.name }}</td>
<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>
<td>
{% if port_profile.vlan_untagged %}
<b>{% trans "Untagged: " %}</b>{{ port_profile.vlan_untagged }}
<br>
{% endif %}
{% if port_profile.vlan_tagged.all %}
<b>{% trans "Tagged: " %}</b>{{ port_profile.vlan_tagged.all|join:", " }}
{% 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>
<td>{{ port_profile.security_parameters_enabled|join:"<br>" }}</td>
<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 class="panel-footer">
<div class="container-fluid">
<div class="row">
<div class="col-sm-2">
<h4>{% trans "VLANs" %}</h4>
</div>
<div class="col-sm-10">
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 text-left">
<b>{% trans "Untagged: " %}</b>
</div>
<div class="col-sm-9 text-rit">
{%if port_profile.vlan_untagged %}
{{ port_profile.vlan_untagged }}
{% else %}
{% trans "None" %}
{% endif %}
</div>
</div>
<div class="row">
<div class="col-sm-3 text-left">
<b>{% trans "Tagged: " %}</b>
</div>
<div class="col-sm-9 text-left">
{%if port_profile.vlan_tagged.all %}
{{ port_profile.vlan_tagged.all|join:", " }}
{% else %}
{% trans "None" %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</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 i18n %}
<div class="table-responsive">
{% if switch_list.paginator %}
{% include 'pagination.html' with list=switch_list %}
{% endif %}
{% if switch_list.paginator %}
{% include 'pagination.html' with list=switch_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "DNS name" as tr_dns %}
<th>{% include 'buttons/sort.html' with prefix='switch' col='dns' text=tr_dns %}</th>
{% trans "IPv4 address" as tr_ip %}
<th>{% include 'buttons/sort.html' with prefix='switch' col='ip' text=tr_ip %}</th>
{% trans "Switch bay" as tr_bay %}
<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 }}
{% for switch in switch_list %}
<div class="panel panel-default">
<div class="panel-heading">
<div class="container-fluid">
<div class="row">
<div class="col-sm-3">
<a href="{%url 'topologie:index-port' switch.id %}">
{{ switch }}
</a>
</td>
<td>{{ switch.interface_set.first.ipv4 }}</td>
<td>{{ switch.switchbay }}</td>
<td>{{ switch.number }}</td>
<td>{{ switch.stack.name }}</td>
<td>{{ switch.stack_member_id }}</td>
<td>{{ switch.model }}</td>
<td>{{ switch.interface_set.first.details }}</td>
<td class="text-right">
</div>
<div class="col-sm-3">
{% trans "Switch bay" as tr_bay %} {{switch.switchbay}}
</div>
<div class="col-sm-6 text-right">
{% can_edit switch %}
{% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.id %}
{% acl_end %}
@ -75,14 +54,51 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create Port %}
{% trans "Creation of ports" as tr_creation %}
{% include 'buttons/add.html' with href='topologie:create-ports' id=switch.id desc=tr_creation %}
{% acl_end %}
</td>
</tr>
{% endfor %}
</table>
{% if switch_list.paginator %}
{% include 'pagination.html' with list=switch_list %}
{% acl_end %}
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="container-fluid">
<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 %}
</div>
{% endfor %}
{% if switch_list.paginator %}
{% include 'pagination.html' with list=switch_list %}
{% endif %}