From 6cc6326f15f0d4ea30441834f5a8b0d1f4eed24a Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Thu, 22 Oct 2020 23:55:05 +0200 Subject: [PATCH 01/16] Not perfect but much better --- machines/templates/machines/aff_machines.html | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index 77b65546..8e738df3 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -32,13 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} - - - - - - - {% trans "DNS name" as tr_dns_name %} @@ -106,17 +99,16 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} From 0bcb6cc6805f0c53a6a7b1ad3742bb350f0c4a19 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 23 Oct 2020 00:15:34 +0200 Subject: [PATCH 02/16] Remove redundant code, reuse aff_ templates --- .../templates/cotisations/aff_profil.html | 86 +----- machines/templates/machines/aff_profil.html | 244 +----------------- 2 files changed, 16 insertions(+), 314 deletions(-) diff --git a/cotisations/templates/cotisations/aff_profil.html b/cotisations/templates/cotisations/aff_profil.html index a6e21624..28da5341 100644 --- a/cotisations/templates/cotisations/aff_profil.html +++ b/cotisations/templates/cotisations/aff_profil.html @@ -52,89 +52,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if facture_list %} -
- {% if facture_list.paginator %} - {% include 'pagination.html' with list=facture_list %} - {% endif %} - -
{% include 'buttons/sort.html' with prefix='machine' col='name' text=tr_dns_name %} -
- {% history_button interface %} - {% can_delete interface %} - {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %} - {% acl_end %} -
+ {% history_button interface %} + {% can_delete interface %} + {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %} + {% acl_end %}
- - - - - - - - - - - - - {% for facture in facture_list %} - - - - - - - - - - - {% endfor %} -
- {% trans "User" as tr_user %} - {% include 'buttons/sort.html' with prefix='cotis' col='user' text=tr_user %} - {% trans "Designation" %}{% trans "Total price" %} - {% trans "Payment method" as tr_payment_method %} - {% include 'buttons/sort.html' with prefix='cotis' col='paiement' text=tr_payment_method %} - - {% trans "Date" as tr_date %} - {% include 'buttons/sort.html' with prefix='cotis' col='date' text=tr_date %} - - {% trans "Invoice ID" as tr_invoice_id %} - {% include 'buttons/sort.html' with prefix='cotis' col='id' text=tr_invoice_id %} -
{{ facture.user }} - - {% for article in facture.name_detailed %} - - - - {% endfor %} -
- {{ article }} -
-
{{ facture.prix_total }}{{ facture.paiement }}{{ facture.date }}{{ facture.id }} - {% 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 %} - - {% if facture.valid %} - - {% trans "PDF" %} - - {% else %} - {% trans "Invalidated invoice" %} - {% endif %} - {% if facture.control and facture.is_subscription %} - - {% trans "Voucher" %} - - {% endif %} -
- - {% if facture_list.paginator %} - {% include 'pagination.html' with list=facture_list %} - {% endif %} - - {% else %} -

{% trans "No invoice" %}

+ {% include 'cotisations/aff_cotisations.html' with facture_list=facture_list %} + {% else %} +

{% trans "No invoice" %}

{% endif %} diff --git a/machines/templates/machines/aff_profil.html b/machines/templates/machines/aff_profil.html index 4b2650ed..e1afb7cc 100644 --- a/machines/templates/machines/aff_profil.html +++ b/machines/templates/machines/aff_profil.html @@ -34,238 +34,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Machines" %} {{ nb_machines }} - -
- -
- {% if machines_list %} -
- {% if machines_list.paginator %} - {% include 'pagination.html' with list=machines_list go_to_id="machines" %} - {% endif %} - - - - - - - - - - - {% trans "DNS name" as tr_dns_name %} - - - - - - - {% for machine in machines_list %} - - - - - {% for interface in machine.interface_set.all %} - - - - - - - - - - - {% if ipv6_enabled and interface.ipv6 != 'None' %} - - - - {% endif %} - {% if interface.domain.related_domain.all %} - - - - {% endif %} - {% endfor %} - - - - {% endfor %} - -
{% include 'buttons/sort.html' with prefix='machine' col='name' text=tr_dns_name %}{% trans "Type" %}{% trans "MAC address" %}{% trans "IP address" %}{% trans "Actions" %}
- {% trans "No name" as tr_no_name %} - {% trans "View the profile" as tr_view_the_profile %} - {% if machine.active %} - - {% else %} - {% trans "Deactivated" %}: - {% endif %} - {{ machine.get_name|default:tr_no_name }} - - {{ machine.user }} - - - {% 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 %} -
- {% if interface.domain.related_domain.all %} - {{ interface.domain }} - - {% else %} - {{ interface.domain }} - {% endif %} - - {{ interface.machine_type }} - - {{ interface.mac_address }} - - - IPv4 {{ interface.ipv4 }} -
- {% if ipv6_enabled and interface.ipv6 != 'None' %} - IPv6 - - {% endif %} -
-
-
- - -
- {% history_button interface %} - {% can_delete interface %} - {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %} - {% acl_end %} -
-
-
-
    -
  • - {{ interface.get_vendor }} -
  • -
-
-
-
-
    - {% for ipv6 in interface.ipv6.all %} -
  • - {{ ipv6 }} -
  • - {% endfor %} -
-
-
-
-
    - {% for al in interface.domain.related_domain.all %} -
  • - - {{ al }} - - -
  • - {% endfor %} -
-
-
- - - - {% if machines_list.paginator %} - {% include 'pagination.html' with list=machines_list go_to_id="machines" %} - {% endif %} -
- {% else %} -

{% trans "No machine" %}

- {% endif %} +
+ +
+ {% if machines_list %} + {% include 'machines/aff_machines.html' with machines_list=machines_list %} + {% else %} +

{%trans "No machines" %}

+ {% endif %}
From a3f4deb14534484054e6ed149b1921c33f5d3ee5 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 23 Oct 2020 10:12:18 +0200 Subject: [PATCH 03/16] Update display of ip_types --- machines/templates/machines/aff_iptype.html | 82 +++++++++++++-------- 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/machines/templates/machines/aff_iptype.html b/machines/templates/machines/aff_iptype.html index 7cf710c2..8aaa37f5 100644 --- a/machines/templates/machines/aff_iptype.html +++ b/machines/templates/machines/aff_iptype.html @@ -28,39 +28,59 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load logs_extra %} {% load i18n %} -
- - - - - - - - - - - - - - - {% for type in iptype_list %} - - - - - - - - - - - - {% endfor %} -
{% trans "IP type" %}{% trans "Extension" %}{% blocktrans %}"infra" right required{% endblocktrans %}{% trans "IPv4 range" %}{% trans "v6 prefix" %}{% trans "DNSSEC reverse v4/v6" %}{% trans "On VLAN(s)" %}{% trans "Default ports opening" %}
{{ type.name }}{{ type.extension }}{{ type.need_infra|tick }}{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}{% if type.ip_network %} on - {{ type.ip_network }}{% endif %}{{ type.prefix_v6 }}/{{ type.prefix_v6_length }}{{ type.reverse_v4|tick }}/{{ type.reverse_v6|tick }}{{ type.vlan }}{{ type.ouverture_ports }} +{% for type in iptype_list %} +
+
+
+
+
+

{{ type.name }}

+
+
+

{{ type.extension }}

+
+
+ {% if type.need_infra %} + {% trans "Infra right required" %} + {% else %} + {% trans "Infra right not required" %} + {% endif %} +
+
{% can_edit type %} {% include 'buttons/edit.html' with href='machines:edit-iptype' id=type.id %} {% acl_end %} {% history_button type %} -
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + +
{% trans "IPv4 range" %}{% trans "v6 prefix" %}{% trans "DNSSEC reverse v4/v6" %}{% trans "On VLAN(s)" %}{% trans "Default ports opening" %}
{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}{% if type.ip_network %} + on + {{ type.ip_network }}{% endif %}{{ type.prefix_v6 }}/{{ type.prefix_v6_length }}{{ type.reverse_v4|tick }}/{{ type.reverse_v6|tick }}{{ type.vlan }}{{ type.ouverture_ports }}
+
+
+{% endfor %} + + + From 4f5bdc1d0b0c630c9ad20841ca63598273c35dce Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 23 Oct 2020 11:41:02 +0200 Subject: [PATCH 04/16] Add listings of articles to aff of all cotisations --- .../templates/cotisations/aff_cotisations.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cotisations/templates/cotisations/aff_cotisations.html b/cotisations/templates/cotisations/aff_cotisations.html index b9a1a810..4d2cd3ee 100644 --- a/cotisations/templates/cotisations/aff_cotisations.html +++ b/cotisations/templates/cotisations/aff_cotisations.html @@ -59,7 +59,17 @@ with this program; if not, write to the Free Software Foundation, Inc., {% for facture in facture_list %} {{ facture.user }} - {{ facture.name }} + + + {% for article in facture.name_detailed %} + + + + {% endfor %} +
+ {{ article }} +
+ {{ facture.prix_total }} {{ facture.paiement }} {{ facture.date }} From 57d22e9aaf149b629e937315ac9b446529f4bb2e Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 23 Oct 2020 12:09:09 +0200 Subject: [PATCH 05/16] fix typo in iptypes and update display of switchs --- machines/templates/machines/aff_iptype.html | 7 +- topologie/templates/topologie/aff_switch.html | 91 +++++++++---------- 2 files changed, 51 insertions(+), 47 deletions(-) diff --git a/machines/templates/machines/aff_iptype.html b/machines/templates/machines/aff_iptype.html index 8aaa37f5..4fe373ab 100644 --- a/machines/templates/machines/aff_iptype.html +++ b/machines/templates/machines/aff_iptype.html @@ -28,10 +28,15 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load logs_extra %} {% load i18n %} +{% if iptype_list.paginator %} +{% include 'pagination.html' with list=iptype_list %} +{% endif %} + + {% for type in iptype_list %}
-
+

{{ type.name }}

diff --git a/topologie/templates/topologie/aff_switch.html b/topologie/templates/topologie/aff_switch.html index e2866aba..b1407178 100644 --- a/topologie/templates/topologie/aff_switch.html +++ b/topologie/templates/topologie/aff_switch.html @@ -26,45 +26,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load logs_extra %} {% load i18n %} -
- {% if switch_list.paginator %} - {% include 'pagination.html' with list=switch_list %} - {% endif %} - - - - - {% trans "DNS name" as tr_dns %} - - {% trans "IPv4 address" as tr_ip %} - - {% trans "Switch bay" as tr_bay %} - - {% trans "Ports" as tr_ports %} - - {% trans "Stack" as tr_stack %} - - - - - - - - {% for switch in switch_list %} - - - - - - - - - - - - {% endfor %} -
{% include 'buttons/sort.html' with prefix='switch' col='dns' text=tr_dns %}{% include 'buttons/sort.html' with prefix='switch' col='ip' text=tr_ip %}{% include 'buttons/sort.html' with prefix='switch' col='loc' text=tr_bay %}{% include 'buttons/sort.html' with prefix='switch' col='ports' text=tr_ports %}{% include 'buttons/sort.html' with prefix='switch' col='stack' text=tr_stack %}{% trans "Stack member ID" %}{% trans "Switch model" %}{% trans "Details" %}
- - {{ switch }} +{% for switch in switch_list %} +{{ switch.interface_set.first.ipv4 }}{{ switch.switchbay }}{{ switch.number }}{{ switch.stack.name }}{{ switch.stack_member_id }}{{ switch.model }}{{ switch.interface_set.first.details }} + +
+ {% trans "Switch bay" as tr_bay %} {{switch.switchbay}} +
+
{% can_edit switch %} {% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.id %} {% acl_end %} @@ -75,14 +50,38 @@ 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 %} -
- - {% if switch_list.paginator %} - {% include 'pagination.html' with list=switch_list %} + {% acl_end %} +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + +
{% trans "IPv4 address"%}{% trans "Ports"%}{% trans "Stack"%}{% trans "Stack member ID" %}{% trans "Switch model" %}
{{ switch.interface_set.first.ipv4 }}{{ switch.number }}{{ switch.stack.name }}{{ switch.stack_member_id }}{{ switch.model }}
+
+
+ {% if switch.interface_set.first.details %} + {% endif %}
+{% endfor %} From 685c88d2e5202f2fd05d6e23c805aefa337817e2 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 23 Oct 2020 19:13:02 +0200 Subject: [PATCH 06/16] Fix typo and update display port profils --- .../templates/topologie/aff_port_profile.html | 151 +++++++++++------- topologie/templates/topologie/aff_switch.html | 2 +- 2 files changed, 92 insertions(+), 61 deletions(-) diff --git a/topologie/templates/topologie/aff_port_profile.html b/topologie/templates/topologie/aff_port_profile.html index 009c0b0f..2e5d432d 100644 --- a/topologie/templates/topologie/aff_port_profile.html +++ b/topologie/templates/topologie/aff_port_profile.html @@ -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,95 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load i18n %} {% load logs_extra %} -
- - {% if port_profile_list.paginator %} - {% include 'pagination.html' with list=port_profile_list %} - {% endif %} - - - - - - - - - - - - - - - - {% for port_profile in port_profile_list %} - - - - - - {% endif %} - - - - - - {% endfor %} -
{% trans "Name" %}{% trans "Default for" %}{% trans "VLANs" %}{% trans "RADIUS settings" %}{% trans "Speed limit" %}{% trans "MAC address limit" %}{% trans "Security" %}
{{ port_profile.name }}{{ port_profile.profil_default }} {% if port_profile.profil_default%} - {% if port_profile.on_dormitory %}{% blocktrans with dorm=port_profile.on_dormitory %} on {{ dorm }}{% endblocktrans %}{% else %}{% trans "Everywhere" %}{% endif %}{% endif %} - {% if port_profile.vlan_untagged %} - {% trans "Untagged: " %}{{ port_profile.vlan_untagged }} -
- {% endif %} - {% if port_profile.vlan_tagged.all %} - {% trans "Tagged: " %}{{ port_profile.vlan_tagged.all|join:", " }} - {% endif %} -
- {% trans "RADIUS type: " %}{{ port_profile.radius_type }} - {% if port_profile.radius_type == "MAC-radius" %} -
- {% trans "RADIUS mode: " %}{{ port_profile.radius_mode }}
{{ port_profile.speed }}{{ port_profile.mac_limit }}{{ port_profile.security_parameters_enabled|join:"
" }}
- {% 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 %} -
- - {% if port_profile_list.paginator %} - {% include 'pagination.html' with list=port_profile_list %} - {% endif %} +{% for port_profile in port_profile_list %} +
+
+
+
+
+

{{ port_profile.name }}

+
+
+ {% 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 %} +
+
+
+
+
+
+ + + + + + + + + + + + + + {% endif %} + + + + +
{% trans "Default for" %}{% trans "RADIUS settings" %}{% trans "Speed limit" %}{% trans "MAC address limit" %}{% trans "Security" %}
+ {{ port_profile.profil_default }} + {% if port_profile.profil_default%} + - {% if port_profile.on_dormitory %}{% blocktrans with dorm=port_profile.on_dormitory %} on {{ dorm }}{% endblocktrans %}{% else %}{% trans "Everywhere" %}{% endif %} + {% endif %} + + {% trans "RADIUS type: " %}{{ port_profile.radius_type }} + {% if port_profile.radius_type == "MAC-radius" %} +
+ {% trans "RADIUS mode: " %}{{ port_profile.radius_mode }}
{{ port_profile.speed }}{{ port_profile.mac_limit }}{{ port_profile.security_parameters_enabled|join:"
" }}
+
+
+
- +{% endfor %} diff --git a/topologie/templates/topologie/aff_switch.html b/topologie/templates/topologie/aff_switch.html index b1407178..a3ce33ed 100644 --- a/topologie/templates/topologie/aff_switch.html +++ b/topologie/templates/topologie/aff_switch.html @@ -39,7 +39,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Switch bay" as tr_bay %} {{switch.switchbay}}
-
+
{% can_edit switch %} {% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.id %} {% acl_end %} From dba0da249e5c63259318330e901522f5ea8ff57a Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sat, 24 Oct 2020 00:52:25 +0200 Subject: [PATCH 07/16] Add paginator, updates machines, create aff_machines, and minor changes --- machines/templates/machines/aff_iptype.html | 14 +- machines/templates/machines/aff_machines.html | 175 +++++++++--------- machines/templates/machines/aff_portlist.html | 100 ++++++++++ machines/templates/machines/index_iptype.html | 2 + .../templates/machines/index_portlist.html | 51 +---- machines/views.py | 2 + .../templates/multi_op/aff_room_state.html | 111 +++++++---- topologie/templates/topologie/aff_switch.html | 8 + 8 files changed, 283 insertions(+), 180 deletions(-) create mode 100644 machines/templates/machines/aff_portlist.html diff --git a/machines/templates/machines/aff_iptype.html b/machines/templates/machines/aff_iptype.html index 4fe373ab..c6123f58 100644 --- a/machines/templates/machines/aff_iptype.html +++ b/machines/templates/machines/aff_iptype.html @@ -29,10 +29,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load i18n %} {% if iptype_list.paginator %} -{% include 'pagination.html' with list=iptype_list %} + {% include 'pagination.html' with list=iptype_list %} {% endif %} - {% for type in iptype_list %}
@@ -59,8 +58,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
-
+
+
@@ -83,9 +82,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
+
{% endfor %} - - +{% if iptype_list.paginator %} + {% include 'pagination.html' with list=iptype_list %} +{% endif %} diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index 8e738df3..6d97d1c5 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -26,36 +26,22 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load logs_extra %} {% load i18n %} -
- {% 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 %} - - - {% trans "DNS name" as tr_dns_name %} - - - - - - - {% for machine in machines_list %} - - - - + + + + +
+
+
{% include 'buttons/sort.html' with prefix='machine' col='name' text=tr_dns_name %}{% trans "Type" %}{% trans "MAC address" %}{% trans "IP address" %}{% trans "Actions" %}
- {% trans "No name" as tr_no_name %} - {% trans "View the profile" as tr_view_the_profile %} - {% if machine.active %} - - {% else %} - {% trans "Deactivated" %}: - {% endif %} - {{ machine.get_name|default:tr_no_name }} - - {{ machine.user }} - - +{% for machine in machines_list %} +
+
+
+
+
+ {% trans "No name" as tr_no_name %} + {{ machine.user }} + + {{ machine.get_name|default:tr_no_name }} +
+
{% 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 %} @@ -64,8 +50,22 @@ 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 %} -
+ + + + + + + + + {% for interface in machine.interface_set.all %} - - - - {% if ipv6_enabled and interface.ipv6 != 'None' %} - - - - {% endif %} - {% if interface.domain.related_domain.all %} - - - - {% endif %} - {% endfor %} - - - + + + + {% if ipv6_enabled and interface.ipv6 != 'None' %} + + + + {% endif %} + {% if interface.domain.related_domain.all %} + + + + {% endif %} {% endfor %} - -
{% trans "DNS name"%}{% trans "Type" %}{% trans "MAC address" %}{% trans "IP address" %}{% trans "Actions" %}
@@ -74,7 +74,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% else %} {{ interface.domain }} @@ -159,59 +159,64 @@ with this program; if not, write to the Free Software Foundation, Inc., {% acl_end %}
-
-
    -
  • - {{ interface.get_vendor }} -
  • -
-
-
-
-
    - {% for ipv6 in interface.ipv6.all %} -
  • - {{ ipv6 }} -
  • - {% endfor %} -
-
-
-
-
    - {% for al in interface.domain.related_domain.all %} -
  • - - {{ al }} - - -
  • - {% endfor %} -
-
-
+
+
    +
  • + {{ interface.get_vendor }} +
  • +
+
+
+
+
    + {% for ipv6 in interface.ipv6.all %} +
  • + {{ ipv6 }} +
  • + {% endfor %} +
+
+
+
+
    + {% for al in interface.domain.related_domain.all %} +
  • + + {{ al }} + + +
  • + {% endfor %} +
+
+
+ +
+
+ +{% endfor %} - - {% if machines_list.paginator %} - {% include 'pagination.html' with list=machines_list go_to_id="machines" %} - {% endif %} - diff --git a/machines/templates/machines/aff_portlist.html b/machines/templates/machines/aff_portlist.html new file mode 100644 index 00000000..814e0b55 --- /dev/null +++ b/machines/templates/machines/aff_portlist.html @@ -0,0 +1,100 @@ +{% 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 %} +
+
+
+
+
+

{{ ports.name }}

+
+
+ {% 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 %} +
+
+
+
+
+
+ + + + + + + + + + + + + + + +
{% trans "TCP (input)" %}{% trans "TCP (output)" %}{% trans "UDP (input)" %}{% trans "UDP (output)" %}
{% for p in ports.tcp_ports_in %}{{ p.show_port }}, {% endfor %}{% for p in ports.tcp_ports_out %}{{ p.show_port }}, {% endfor %}{% for p in ports.udp_ports_in %}{{ p.show_port }}, {% endfor %}{% for p in ports.udp_ports_out %}{{ p.show_port }}, {% endfor %}
+
+
+ +
+{% endfor %} + +{% if port_list.paginator %} + {% include 'pagination.html' with list=port_list %} +{% endif %} + diff --git a/machines/templates/machines/index_iptype.html b/machines/templates/machines/index_iptype.html index 65f78f74..38a3a8ad 100644 --- a/machines/templates/machines/index_iptype.html +++ b/machines/templates/machines/index_iptype.html @@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "Machines" %}{% endblock %} {% block content %} + {% include 'machines/aff_iptype.html' with iptype_list=iptype_list %} {% endblock %} diff --git a/machines/templates/machines/index_portlist.html b/machines/templates/machines/index_portlist.html index 671f8e74..867e51d0 100644 --- a/machines/templates/machines/index_portlist.html +++ b/machines/templates/machines/index_portlist.html @@ -14,52 +14,7 @@ {% trans "Add a configuration" %} {% acl_end %} - - - - - - - - - - - - - {% for pl in port_list %} - - - - - - - - - {% endfor %} -
{% trans "Name" %}{% trans "TCP (input)" %}{% trans "TCP (output)" %}{% trans "UDP (input)" %}{% trans "UDP (output)" %}{% trans "Machines" %}
{{ pl.name }}{% for p in pl.tcp_ports_in %}{{ p.show_port }}, {% endfor %}{% for p in pl.tcp_ports_out %}{{ p.show_port }}, {% endfor %}{% for p in pl.udp_ports_in %}{{ p.show_port }}, {% endfor %}{% for p in pl.udp_ports_out %}{{ p.show_port }}, {% endfor %} - {% if pl.interface_set.all %} - - {% endif %} - - {% 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 %} -
+

+ + {% include 'machines/aff_portlist.html' with port_list=port_list %} {% endblock %} diff --git a/machines/views.py b/machines/views.py index 76d12eca..811bf2a0 100644 --- a/machines/views.py +++ b/machines/views.py @@ -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}) diff --git a/multi_op/templates/multi_op/aff_room_state.html b/multi_op/templates/multi_op/aff_room_state.html index bdfdd98b..f58e8148 100644 --- a/multi_op/templates/multi_op/aff_room_state.html +++ b/multi_op/templates/multi_op/aff_room_state.html @@ -30,44 +30,79 @@ with this program; if not, write to the Free Software Foundation, Inc., {% include 'pagination.html' with list=room_list %} {% endif %} - - - - {% trans "Room" as tr_room %} - {% trans "Building" as tr_building %} - - - - - - - - - - - {% for room in room_list %} - - - - - - - - - - - {% endfor %} -
{% include 'buttons/sort.html' with prefix='building' col='name' text=tr_building %}{% include 'buttons/sort.html' with prefix='room' col='name' text=tr_room %}{% trans "Connnected to" %}{% trans "User" %}{% trans "Details" %}{% trans "End of subscription on" %}{% trans "Internet access" %}{% trans "Action" %}
{{ room.building }}{{ room.name }}{% if room.port_set.all %}{{ asso_name }}{% else %}{% trans "Other operator" %}{% endif %}{% if room.adherent %}{{ room.adherent }}{% else %} {% trans "None" %}{% endif %}{{ room.details }}{% if room.adherent.is_adherent %}{% else %}{% endif %}{% if room.adherent.end_adhesion %}{{ room.adherent.end_adhesion}}{% else %}{% trans "Non member" %}{% endif %} - {% if room.adherent.has_access == True %} - {% trans "Active" %} - {% else %} - {% trans "Disabled" %} - {% endif %} - - {% if room.port_set.all %} - - {% endif %} -
+{%for room in room_list %} +
+
+
+
+
+

{{ room.building }} - {{room.name }}

+
+
+ {% if room.port_set.all %} + + {% endif %} +
+
+
+
+
+
+ + + + + + + + + + + + + + + +
{% trans "User"%}{% trans "Connected to"%}{% trans "End of subscription on" %}{% trans "Internet access" %}
+ {% if room.adherent %} + {{ room.adherent }} + {% else %} + {% trans "None" %} + {% endif %} + + {% if room.port_set.all %} + {{ asso_name }} + {% else %} + {% trans "Other operator" %} + {% endif %} + + {% if room.adherent.is_adherent %} + + {% else %} + + {% endif %} + {% if room.adherent.end_adhesion %} + {{ room.adherent.end_adhesion}} + {% else %} + {% trans "Non member" %} + {% endif %} + + + {% if room.adherent.has_access == True %} + {% trans "Active" %} + {% else %} + {% trans "Disabled" %} + {% endif %} +
+
+
+ {% if room.details %} + + {% endif %} +
+{% endfor %} {% if room_list.paginator %} {% include 'pagination.html' with list=room_list %} diff --git a/topologie/templates/topologie/aff_switch.html b/topologie/templates/topologie/aff_switch.html index a3ce33ed..86c899ba 100644 --- a/topologie/templates/topologie/aff_switch.html +++ b/topologie/templates/topologie/aff_switch.html @@ -26,6 +26,10 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load logs_extra %} {% load i18n %} +{% if switch_list.paginator %} + {% include 'pagination.html' with list=switch_list %} +{% endif %} + {% for switch in switch_list %}
@@ -85,3 +89,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endfor %} +{% if switch_list.paginator %} + {% include 'pagination.html' with list=switch_list %} +{% endif %} + From 8a67b0ca0ead338de38ee55bb4bb2f6d7d5f4011 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sun, 25 Oct 2020 23:47:59 +0100 Subject: [PATCH 08/16] Turn tables into grids --- machines/templates/machines/aff_machines.html | 288 +++++++++--------- 1 file changed, 140 insertions(+), 148 deletions(-) diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index 6d97d1c5..75eb47c6 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -55,162 +55,154 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
- - - - - - - - - - - {% for interface in machine.interface_set.all %} - - - - - - - - - - + {% for interface in machine.interface_set.all %} +
+
+
+ {% trans "DNS name"%}: +
+ {% if interface.domain.related_domain.all %} + {{ interface.domain }} + + {% else %} + {{ interface.domain }} + {% endif %} +
+
+ {% trans "Type" %}: +
+ {{ interface.machine_type }} +
+
+ {% trans "MAC address" %}: +
+ {{ interface.mac_address }} + +
+
+ IPv4 {{ interface.ipv4 }} +
+ {% if interface.ipv6.count > 0 %} + IPv6 + + {% else %} + {% trans "No IPv6" %} + {% endif %} +
+
+
+ + +
+ {% history_button interface %} + {% can_delete interface %} + {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %} + {% acl_end %} +
+
+
+
+
+
+
    +
  • + {{ interface.get_vendor }} +
  • +
+
{% if ipv6_enabled and interface.ipv6 != 'None' %} -
- - +
+
    + {% for ipv6 in interface.ipv6.all %} +
  • + {{ ipv6 }} +
  • + {% endfor %} +
+
{% endif %} {% if interface.domain.related_domain.all %} - - - +
+
    + {% for al in interface.domain.related_domain.all %} +
  • + + {{ al }} + + +
  • + {% endfor %} +
+
{% endif %} + + + {%if machine.interface_set.count > 1 %} +
+ {% endif %} {% endfor %} -
{% trans "DNS name"%}{% trans "Type" %}{% trans "MAC address" %}{% trans "IP address" %}{% trans "Actions" %}
- {% if interface.domain.related_domain.all %} - {{ interface.domain }} - - {% else %} - {{ interface.domain }} - {% endif %} - - {{ interface.machine_type }} - - {{ interface.mac_address }} - - - IPv4 {{ interface.ipv4 }} -
- {% if ipv6_enabled and interface.ipv6 != 'None' %} - IPv6 - - {% endif %} -
-
- - -
- {% history_button interface %} - {% can_delete interface %} - {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %} - {% acl_end %} -
-
-
    -
  • - {{ interface.get_vendor }} -
  • -
-
-
-
-
    - {% for ipv6 in interface.ipv6.all %} -
  • - {{ ipv6 }} -
  • - {% endfor %} -
-
-
-
-
    - {% for al in interface.domain.related_domain.all %} -
  • - - {{ al }} - - -
  • - {% endfor %} -
-
-
- + {% endfor %} - - + {% if machines_list.paginator %} {% include 'pagination.html' with list=machines_list %} {% endif %} From 718e761d2a70d44499ac842d59f8a56324808d8e Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Mon, 26 Oct 2020 19:15:51 +0100 Subject: [PATCH 09/16] Affichage sans chevauchement sur toute la gamme de largeurs --- machines/templates/machines/aff_iptype.html | 57 ++++++++++++--------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/machines/templates/machines/aff_iptype.html b/machines/templates/machines/aff_iptype.html index c6123f58..ce436c6b 100644 --- a/machines/templates/machines/aff_iptype.html +++ b/machines/templates/machines/aff_iptype.html @@ -45,9 +45,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if type.need_infra %} - {% trans "Infra right required" %} + {% trans "Infra right required" %} {% else %} - {% trans "Infra right not required" %} + {% trans "Infra right not required" %} {% endif %}
@@ -60,27 +60,38 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
- - - - - - - - - - - - - - - - - -
{% trans "IPv4 range" %}{% trans "v6 prefix" %}{% trans "DNSSEC reverse v4/v6" %}{% trans "On VLAN(s)" %}{% trans "Default ports opening" %}
{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}{% if type.ip_network %} - on - {{ type.ip_network }}{% endif %}{{ type.prefix_v6 }}/{{ type.prefix_v6_length }}{{ type.reverse_v4|tick }}/{{ type.reverse_v6|tick }}{{ type.vlan }}{{ type.ouverture_ports }}
+
+
+
+ {% trans "IPv4 range" %} + {{ type.domaine_ip_start }} - {{ type.domaine_ip_stop }} + {% if type.ip_network %} + on + {{ type.ip_network }}{% endif %} +
+
+ {% trans "v6 prefix" %} + {{ type.prefix_v6 }} /{{ type.prefix_v6_length }} +
+
+
+
+
+ {% trans "DNSSEC reverse v4/v6" %} +
+ {{ type.reverse_v4|tick }}/{{ type.reverse_v6|tick }} +
+
+ {% trans "On VLAN(s)" %} +
+ {{ type.vlan }} +
+
+ {% trans "Default ports opening" %} +
+ {{ type.ouverture_ports }} +
+
From 0a2c48da6bb37e2a340166c9a386b2820820bc88 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Mon, 26 Oct 2020 19:23:41 +0100 Subject: [PATCH 10/16] Affichage sans chevauchement sur toute la gamme de largeur --- machines/templates/machines/aff_portlist.html | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/machines/templates/machines/aff_portlist.html b/machines/templates/machines/aff_portlist.html index 814e0b55..b01f407c 100644 --- a/machines/templates/machines/aff_portlist.html +++ b/machines/templates/machines/aff_portlist.html @@ -37,10 +37,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
+

{{ ports.name }}

-
+
{% can_edit ports %} {% include 'buttons/edit.html' with href='machines:edit-portlist' id=ports.id %} {% acl_end %} @@ -52,23 +52,29 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
- - - - - - - - - - - - - - - -
{% trans "TCP (input)" %}{% trans "TCP (output)" %}{% trans "UDP (input)" %}{% trans "UDP (output)" %}
{% for p in ports.tcp_ports_in %}{{ p.show_port }}, {% endfor %}{% for p in ports.tcp_ports_out %}{{ p.show_port }}, {% endfor %}{% for p in ports.udp_ports_in %}{{ p.show_port }}, {% endfor %}{% for p in ports.udp_ports_out %}{{ p.show_port }}, {% endfor %}
+
+
+
+ {% trans "TCP (input)" %} +
+ {% for p in ports.tcp_ports_in %}{{ p.show_port }}, {% endfor %} +
+
+ {% trans "TCP (output)" %} +
+ {% for p in ports.tcp_ports_out %}{{ p.show_port }}, {% endfor %} +
+
+ {% trans "UDP (input)" %} +
+ {% for p in ports.udp_ports_in %}{{ p.show_port }}, {% endfor %} +
+
+ {% trans "UDP (output)" %} +
+ {% for p in ports.udp_ports_out %}{{ p.show_port }}, {% endfor %} +
+
-
- - - - - - - - - - - - - - - - - -
{% trans "IPv4 address"%}{% trans "Ports"%}{% trans "Stack"%}{% trans "Stack member ID" %}{% trans "Switch model" %}
{{ switch.interface_set.first.ipv4 }}{{ switch.number }}{{ switch.stack.name }}{{ switch.stack_member_id }}{{ switch.model }}
+
+
+
+ {% trans "IPv4 address"%} +
+ {{ switch.interface_set.first.ipv4 }} +
+
+ {% trans "Ports"%} +
+ {{ switch.number }} +
+
+ {% trans "Stack"%} +
+ {{ switch.stack.name }} +
+
+ {% trans "Stack member ID" %} +
+ {{ switch.stack_member_id }} +
+
+ {% trans "Switch model" %} +
+ {{ switch.model }} +
+
{% if switch.interface_set.first.details %} From 7bedf0c9dc9ed1e4aa4e6ea70b8268a6799c33af Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Tue, 27 Oct 2020 11:41:46 +0100 Subject: [PATCH 12/16] =?UTF-8?q?Affichage=20am=C3=A9liorer=20avec=202=20f?= =?UTF-8?q?ooters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- topologie/templates/topologie/aff_port_profile.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/topologie/templates/topologie/aff_port_profile.html b/topologie/templates/topologie/aff_port_profile.html index 2e5d432d..2e3f5fed 100644 --- a/topologie/templates/topologie/aff_port_profile.html +++ b/topologie/templates/topologie/aff_port_profile.html @@ -54,14 +54,13 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "RADIUS settings" %} {% trans "Speed limit" %} {% trans "MAC address limit" %} - {% trans "Security" %} {{ port_profile.profil_default }} {% if port_profile.profil_default%} - - {% if port_profile.on_dormitory %}{% blocktrans with dorm=port_profile.on_dormitory %} on {{ dorm }}{% endblocktrans %}{% else %}{% trans "Everywhere" %}{% endif %} + {% if port_profile.on_dormitory %}{% blocktrans with dorm=port_profile.on_dormitory %} on {{ dorm }}{% endblocktrans %}{% else %}{% trans "Everywhere" %}{% endif %} {% endif %} @@ -72,11 +71,15 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} {{ port_profile.speed }} {{ port_profile.mac_limit }} - {{ port_profile.security_parameters_enabled|join:"
" }}
+ {% if port_profile.security_parameters_enabled %} + + {% endif %}