From 9cbf760ef38f363a7325d71af4fa90ccf30f8eb3 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 25 Feb 2020 21:17:59 +0100 Subject: [PATCH] update device and computer details to bootstrap4 --- .../templates/computers/computer_details.html | 206 +++++++++--------- .../devices/device_details_block.html | 76 ++++--- devices/templates/devices/ip_block.html | 32 +-- devices/templates/devices/warranty_block.html | 55 ++--- .../templates/licenses/license_block.html | 12 +- 5 files changed, 197 insertions(+), 184 deletions(-) diff --git a/computers/templates/computers/computer_details.html b/computers/templates/computers/computer_details.html index b934cf3..9af3fe2 100644 --- a/computers/templates/computers/computer_details.html +++ b/computers/templates/computers/computer_details.html @@ -1,7 +1,7 @@ {% extends "core/base.html" %} {% block section_title %}{{ device }}{% endblock %} {% block content %} -
+
{% block device_details %} {% include "devices/device_details_block.html" %} @@ -19,123 +19,125 @@ {% include "devices/ip_block.html" %} {% endblock %}
-
-
{% if device.os or software_relations or backup_relations or license_list or device.host %}
- {% if device.host %} -

Host

- - {% endif %} +
+
+ {% if device.host %} +

Host

+ + {% endif %} + {% if device.os %} +

Operating System

+
    +
  • {{ device.os }}
  • +
+ {% endif %} - {% if device.os %} -

Operating System

-
    -
  • {{ device.os }}
  • -
- {% endif %} + {% if software_relations %} +

Software

+
    + {% for relation in software_relations %} +
  • {{ relation.software }}
  • + {% endfor %} +
+ {% endif %} - {% if software_relations %} -

Software

-
    - {% for relation in software_relations %} -
  • {{ relation.software }}
  • - {% endfor %} -
- {% endif %} + {% if license_list %} + {% block license %} + {% include "licenses/license_block.html" %} + {% endblock %} + {% endif %} - {% if license_list %} - {% block license %} - {% include "licenses/license_block.html" %} - {% endblock %} - {% endif %} - - {% if backup_relations %} -

Backup

-
    - {% for backup in backup_relations %} -
  • {{ backup }}
  • - {% endfor %} -
- {% endif %} + {% if backup_relations %} +

Backup

+
    + {% for backup in backup_relations %} +
  • {{ backup }}
  • + {% endfor %} +
+ {% endif %} +
+
{% endif %} {% if cpu_relations or ram_relations or disks_relations or raid_disk_pairs %}
- {% if cpu_relations or ram_relations or disks_relations or device.host %} -

Hardware

- +
+

Hardware

+
+ {% if cpu_relations or ram_relations or disks_relations or device.host %} +
+ {% if cpu_relations %} + + + + + {% endif %} - {% if cpu_relations %} - - - - - {% endif %} + {% if ram_relations %} + + + + + {% endif %} - {% if ram_relations %} - - - - - {% endif %} - - {% if disks_relations %} - - - - - {% endif %} -
CPUs: + {% for cpu in cpu_relations %} + {{ cpu.amount }}x {{ cpu.cpu }}
+ {% endfor %} +
CPUs: - {% for cpu in cpu_relations %} - {{ cpu.amount }}x {{ cpu.cpu }}
- {% endfor %} -
RAM Modules: + {% for module in ram_relations %} + {{ module.amount }}x {{ module.ram }}
+ {% endfor %} +
RAM Modules: - {% for module in ram_relations %} - {{ module.amount }}x {{ module.ram }}
- {% endfor %} -
Disks: - {% for disk in disks_relations %} - {{ disk.amount }}x {{ disk.disk }}
- {% endfor %} -
- {% endif %} - - {% if raid_disk_pairs %} -

RAID

- {% for raid, disks in raid_disk_pairs.items %} - - - - - - - - - - {% if disks %} - {% for disk in disks %} - - - - - - - - - {% endfor %} - {% endif %} -
Type:{{ raid.raid_type }}
Usable Space{{ raid.usable_space }}
Disk Type{{ disk.disk }}
Amount{{ disk.disk_amount }}
- {% endfor %} - {% endif %} + {% if disks_relations %} + + Disks: + + {% for disk in disks_relations %} + {{ disk.amount }}x {{ disk.disk }}
+ {% endfor %} + + + {% endif %} + + {% endif %} + {% if raid_disk_pairs %} +

RAID

+ {% for raid, disks in raid_disk_pairs.items %} + + + + + + + + + + {% if disks %} + {% for disk in disks %} + + + + + + + + + {% endfor %} + {% endif %} +
Type:{{ raid.raid_type }}
Usable Space{{ raid.usable_space }}
Disk Type{{ disk.disk }}
Amount{{ disk.disk_amount }}
+ {% endfor %} + {% endif %} +
+
{% endif %}
- {% endblock %} diff --git a/devices/templates/devices/device_details_block.html b/devices/templates/devices/device_details_block.html index 2e2317e..3046273 100644 --- a/devices/templates/devices/device_details_block.html +++ b/devices/templates/devices/device_details_block.html @@ -1,37 +1,41 @@ -

Description

-

{{ device.description }}

- - - - - - - - - - - - - - - - - - - - - - - - - +
+
+

Description

+

{{ device.description }}

+
Serial Number:{{ device.serialnumber }}
Category:{{ device.category }}
Owner:{{ device.owner }}
Customer:{{ device.customer }}
Manufacturer:{{ device.manufacturer }}
Model:{{ device.model }}
+ + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - -
Serial Number:{{ device.serialnumber }}
Category:{{ device.category }}
Owner:{{ device.owner }}
Customer:{{ device.customer }}
Manufacturer:{{ device.manufacturer }}
Model:{{ device.model }}
Location:{{ device.location }}
Installation Date:{{ device.installation_date }}
+ + Location: + {{ device.location }} + + + Installation Date: + {{ device.installation_date }} + + + + diff --git a/devices/templates/devices/ip_block.html b/devices/templates/devices/ip_block.html index 8826c98..ecc62f3 100644 --- a/devices/templates/devices/ip_block.html +++ b/devices/templates/devices/ip_block.html @@ -1,19 +1,21 @@ {% if device.nets %} -
-

IPs

- - {% regroup device.nets by name as nets_list %} - {% for net in nets_list %} - - - - - {% endfor %} -
{{ net.grouper }} - {% for ip in net.list %} - {{ ip.ip }}
- {% endfor %} -
+
+

IPs

+
+ + {% regroup device.nets by name as nets_list %} + {% for net in nets_list %} + + + + + {% endfor %} +
{{ net.grouper }} + {% for ip in net.list %} + {{ ip.ip }}
+ {% endfor %} +
+
{% endif %} diff --git a/devices/templates/devices/warranty_block.html b/devices/templates/devices/warranty_block.html index 01e1801..bccd3c0 100644 --- a/devices/templates/devices/warranty_block.html +++ b/devices/templates/devices/warranty_block.html @@ -1,30 +1,35 @@ - {% if warranty_relations %} -
-

Warranty

+{% if warranty_relations %} +
+

Warranty

+
{% for warranty in warranty_relations %} - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
Valid From: - {{ warranty.valid_from }}
-
Valid Until: - {{ warranty.valid_until }}
-
Duration: - {{ warranty.duration_in_years }}
-
Type: - {{ warranty.warranty_type }}
-
Valid From: + {{ warranty.valid_from }}
+
Valid Until: + {{ warranty.valid_until }}
+
Duration: + {{ warranty.duration_in_years }}
+
Type: + {{ warranty.warranty_type }}
+
{% endfor %}
- {% endif %} +
+{% endif %} diff --git a/licenses/templates/licenses/license_block.html b/licenses/templates/licenses/license_block.html index fbb8f22..ab286fe 100644 --- a/licenses/templates/licenses/license_block.html +++ b/licenses/templates/licenses/license_block.html @@ -1,9 +1,9 @@

Licenses

-{% for license in license_list %} - - - - -{% endfor %} + {% for license in license_list %} + + + + + {% endfor %}
{{ license.license.software }}{{ license.license.key }}
{{ license.license.software }}{{ license.license.key }}