From 05d1f9698cf9ab25060897115c61c08e1b0e4d45 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 29 Aug 2022 16:36:42 +0200 Subject: [PATCH] add both device in a public page when is a twin device --- .../device/templates/devices/layout.html | 192 ++++++++++++++++-- ereuse_devicehub/resources/device/views.py | 5 +- 2 files changed, 182 insertions(+), 15 deletions(-) diff --git a/ereuse_devicehub/resources/device/templates/devices/layout.html b/ereuse_devicehub/resources/device/templates/devices/layout.html index e4474426..f513d0b9 100644 --- a/ereuse_devicehub/resources/device/templates/devices/layout.html +++ b/ereuse_devicehub/resources/device/templates/devices/layout.html @@ -41,8 +41,8 @@
@@ -52,7 +52,7 @@
    {% for key, value in device.public_properties.items() %} -
  • {{ key }}: {{ value }}
  • +
  • {{ key }}: {{ value or '' }}
  • {% endfor %}
{% if isinstance(device, d.Computer) %} @@ -140,17 +140,6 @@ {% endif %} - {% if device.rate %} - - - Total rate - - - {{ device.rate.rating_range }} - ({{ device.rate.rating }}) - - - {% endif %}
@@ -222,6 +211,181 @@ {% endif %}
+ {% if abstract %} +
+ +
+
+
+
+
+
    + {% for key, value in abstract.public_properties.items() %} +
  • {{ key }}: {{ value or '' }}
  • + {% endfor %} +
+ {% if isinstance(abstract, d.Computer) %} +
+ + + + + + + + + {% if abstract.processor_model %} + + + + + {% endif %} + {% if abstract.ram_size %} + + + + + {% endif %} + {% if abstract.data_storage_size %} + + + + + {% endif %} + {% if abstract.graphic_card_model %} + + + + + {% endif %} + {% if abstract.network_speeds %} + + + + + {% endif %} + +
Range
+ CPU – {{ abstract.processor_model }} + + Processor Rate = {% if abstract.rate %} + {{ abstract.rate.processor_range }} + ({{ abstract.rate.processor }}) + {% endif %} +
+ RAM – {{ abstract.ram_size // 1000 }} GB + {{ macros.component_type(abstract.components, 'RamModule') }} + + RAM Rate = {% if abstract.rate %} + {{ abstract.rate.ram_range }} + ({{ abstract.rate.ram }}) + {% endif %} +
+ Data Storage – {{ abstract.data_storage_size // 1000 }} GB + {{ macros.component_type(abstract.components, 'SolidStateDrive') }} + {{ macros.component_type(abstract.components, 'HardDrive') }} + + Data Storage Rate = {% if abstract.rate %} + {{ abstract.rate.data_storage_range }} + ({{ abstract.rate.data_storage }}) + {% endif %} +
+ Graphics – {{ abstract.graphic_card_model }} + {{ macros.component_type(abstract.components, 'GraphicCard') }} +
+ Network – + {% if abstract.network_speeds[0] %} + Ethernet + {% if abstract.network_speeds[0] != None %} + max. {{ abstract.network_speeds[0] }} Mbps + {% endif %} + {% endif %} + {% if abstract.network_speeds[0] and abstract.network_speeds[1] %} + + + {% endif %} + {% if abstract.network_speeds[1] %} + WiFi + {% if abstract.network_speeds[1] != None %} + max. {{ abstract.network_speeds[1] }} Mbps + {% endif %} + {% endif %} + {{ macros.component_type(abstract.components, 'NetworkAdapter') }} +
+
+

Actual Status

+
    +
  1. + + Lifecycle Status + + — + {% if abstract.status %} + {{ abstract.status.type }} + {% endif %} +
  2. +
  3. + + Allocate Status + + — + {% if abstract.allocated_status %} + {{ abstract.allocated_status.type }} + {% endif %} +
  4. +
  5. + + Physical Status + + — + {% if abstract.physical_status %} + {{ abstract.physical_status.type }} + {% endif %} +
  6. +
+ +

Public traceability log of the abstract

+
+ Latest one. +
+
    + {% for action in abstract.public_actions %} +
  1. + + {{ abstract.is_status(action) }} + {% if not abstract.is_status(action) %} + {{ action.type }} + {% endif %} + + — + {% if abstract.is_status(action) %} + {{ action }} {{ action.type }} + {% else %} + {{ action }} + {% endif %} +
    +
    + + {{ action._date_str }} + +
    + {% if action.certificate %} + See the certificate + {% endif %} +
  2. + {% endfor %} +
+
+ Oldest one. +
+ {% endif %} +
+
+ {% endif %}