From 29f869ea78605a04ea310d86db8af500c7aa3be2 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 8 Jun 2020 22:11:49 +0200 Subject: [PATCH] add various create buttons to the computer detail view --- .../templates/computers/computer_details.html | 88 +++++++------------ .../templates/licenses/license_block.html | 1 + 2 files changed, 31 insertions(+), 58 deletions(-) diff --git a/computers/templates/computers/computer_details.html b/computers/templates/computers/computer_details.html index 13c7ce9..161a4d4 100644 --- a/computers/templates/computers/computer_details.html +++ b/computers/templates/computers/computer_details.html @@ -22,106 +22,79 @@
-{% if device.os or software_relations or backup_relations or license_list or device.host %}
- {% if device.host %}

Host

+ {% if device.host %} + {% else %} +

add

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

Operating System

+ {% if device.os %}
  • {{ device.os }}
+ {% else %} +

add

{% endif %} - {% if software_relations %}

Software

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

add

- {% if license_list %} {% block license %} {% include "licenses/license_block.html" %} {% endblock %} - {% endif %} - {% if backup_relations %}

Backup

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

add

+
- {% endif %} - {% if cpu_relations or gpu_relations or ram_relations or disks_relations or raid_disk_pairs %}

Hardware

- {% if cpu_relations or gpu_relations or ram_relations or disks_relations or device.host %} - - {% if cpu_relations %} - - - - - {% endif %} +

CPUs:

+ {% for cpu in cpu_relations %} + {{ cpu.amount }}x {{ cpu.cpu }}
+ {% endfor %} +

add

- {% if gpu_relations %} - - - - - {% endif %} +

GPUs:

+ {% for gpu in gpu_relations %} + {{ gpu.amount }}x {{ gpu.gpu }}
+ {% endfor %} +

add

- {% if ram_relations %} - - - - - {% endif %} +

RAM Modules:

+ {% for module in ram_relations %} + {{ module.amount }}x {{ module.ram }}
+ {% endfor %} +

add

- {% if disks_relations %} - - - - - {% endif %} -
CPUs: - {% for cpu in cpu_relations %} - {{ cpu.amount }}x {{ cpu.cpu }}
- {% endfor %} -
GPUs: - {% for gpu in gpu_relations %} - {{ gpu.amount }}x {{ gpu.gpu }}
- {% 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 %} +

Disks:

+ {% for disk in disks_relations %} + {{ disk.amount }}x {{ disk.disk }}
+ {% endfor %} +

add

- {% if raid_disk_pairs %}

RAID

{% for raid, disks in raid_disk_pairs.items %} @@ -147,10 +120,9 @@ {% endif %}
{% endfor %} - {% endif %} +

add

-{% endif %} {% endblock %} diff --git a/licenses/templates/licenses/license_block.html b/licenses/templates/licenses/license_block.html index ab286fe..6351a67 100644 --- a/licenses/templates/licenses/license_block.html +++ b/licenses/templates/licenses/license_block.html @@ -7,3 +7,4 @@ {% endfor %} +

add