From dc5671c97f47bbe3630ed5f305963e99d5eceb85 Mon Sep 17 00:00:00 2001 From: sergio_gimenez Date: Tue, 22 Oct 2024 08:10:37 +0200 Subject: [PATCH] Make public web work for both legacy and new snapshot --- device/templates/device_web.html | 326 ++++++++++++++++--------------- 1 file changed, 173 insertions(+), 153 deletions(-) diff --git a/device/templates/device_web.html b/device/templates/device_web.html index 919dec7..539c2f9 100644 --- a/device/templates/device_web.html +++ b/device/templates/device_web.html @@ -1,173 +1,193 @@ - - - + + + {{ title }} - {{ object.type }} - - + + - - + +
-

{{ title }} - {{ object.type }}

+

{{ title }} - {{ object.type }}

-
-
-

Details

-
-
Phid
-
-
{{ object.id }}
-
-
-
-
Type
-
{{ object.type }}
-
- - {% if object.is_websnapshot %} - {% for k, v in object.last_user_evidence %} -
-
{{ k }}
-
{{ v|default:'' }}
-
- {% endfor %} - {% else %} -
-
Manufacturer
-
{{ object.manufacturer|default:'' }}
-
-
-
Model
-
{{ object.model|default:'' }}
-
-
-
Serial Number
-
{{ object.last_evidence.doc.device.serialNumber|default:'' }}
-
- {% endif %} +
+
+

Details

+
+
Phid
+
+
{{ object.id }}
+
+
+
Type
+
{{ object.type }}
+
-
-

Identifiers

- {% for chid in object.hids %} -
-
{{ chid|default:'' }}
-
- {% endfor %} -
-
- -

Components

-
- {% for c in object.last_evidence.doc.components %} -
-
-
-
{{ c.type }}
-

- Manufacturer: {{ c.manufacturer }}
- Model: {{ c.model }}
- Serial Number: {{ c.serialNumber }} -

- {{ evidence.created }} -
-
-
+ {% if object.is_websnapshot %} + {% for k, v in object.last_user_evidence %} +
+
{{ k }}
+
{{ v|default:'' }}
+
{% endfor %} + {% else %} +
+
Manufacturer
+
{{ object.manufacturer|default:'' }}
+
+
+
Model
+
{{ object.model|default:'' }}
+
+
+
Serial Number
+
{{ object.last_evidence.doc.device.serialNumber|default:'' }}
+
+ {% endif %}
-

Last Evidence Snapshot

-
-
-

{{ snapshot }}

+
+

Identifiers

+ {% for chid in object.hids %} +
+
{{ chid|default:'' }}
+ {% endfor %}
+
+ +

Components

+
+ {% comment %}Iterates over legacy snapshot components{% endcomment %} + {% for component in object.last_evidence.doc.components %} +
+
+
+
{{ component.type }}
+

+ Manufacturer: {{ component.manufacturer }}
+ Model: {{ component.model }}
+ Serial Number: {{ component.serialNumber }} +

+ {{ component.created }} +
+
+
+ {% endfor %} + {% comment %}Iterates over new snapshot components{% endcomment %} + {% for component in object.components %} +
+
+
+
{{ component.type }}
+

+ {% for component_key, component_value in component.items %} + {% if component_key not in 'actions,type' %} + {{ component_key }}: {{ component_value }}
+ {% endif %} + {% endfor %} +

+
+
+
+ {% endfor %} +
+ +

Last Evidence Snapshot

+
+
+

{{ snapshot }}

+
+
-

© {% now "Y" %} eReuse. All rights reserved.

+

+ ©{% now 'Y' %}eReuse. All rights reserved. +

- - \ No newline at end of file + +