From 0bcb6cc6805f0c53a6a7b1ad3742bb350f0c4a19 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Fri, 23 Oct 2020 00:15:34 +0200 Subject: [PATCH] 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 %} - - - - - - - - - - - - - - - {% 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 %}