feature/90-implement-public-website-for-device #17

Merged
cayop merged 32 commits from feature/90-implement-public-website-for-device into main 2024-10-30 15:02:18 +00:00
1 changed files with 173 additions and 153 deletions
Showing only changes of commit 2636e80ece - Show all commits

View File

@ -1,14 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ title }} - {{ object.type }}</title> <title>{{ title }} - {{ object.type }}</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
<style> <style>
body { body {
font-size: .875rem; font-size: 0.875rem;
background-color: #f8f9fa; background-color: #f8f9fa;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -85,8 +85,8 @@
margin-top: 20px; margin-top: 20px;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container custom-container"> <div class="container custom-container">
<h1 class="text-center mb-4" style="color: #545f71;">{{ title }} - {{ object.type }}</h1> <h1 class="text-center mb-4" style="color: #545f71;">{{ title }} - {{ object.type }}</h1>
@ -139,17 +139,35 @@
<h2 class="section-title mt-5">Components</h2> <h2 class="section-title mt-5">Components</h2>
<div class="row"> <div class="row">
{% for c in object.last_evidence.doc.components %} {% comment %}Iterates over legacy snapshot components{% endcomment %}
{% for component in object.last_evidence.doc.components %}
<div class="col-md-6 mb-3"> <div class="col-md-6 mb-3">
<div class="card component-card"> <div class="card component-card">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">{{ c.type }}</h5> <h5 class="card-title">{{ component.type }}</h5>
<p class="card-text"> <p class="card-text">
<strong>Manufacturer:</strong> {{ c.manufacturer }}<br> <strong>Manufacturer:</strong> {{ component.manufacturer }}<br />
<strong>Model:</strong> {{ c.model }}<br> <strong>Model:</strong> {{ component.model }}<br />
<strong>Serial Number:</strong> {{ c.serialNumber }} <strong>Serial Number:</strong> {{ component.serialNumber }}
</p>
<small class="text-muted">{{ component.created }}</small>
</div>
</div>
</div>
{% endfor %}
{% comment %}Iterates over new snapshot components{% endcomment %}
{% for component in object.components %}
<div class="col-md-6 mb-3">
<div class="card component-card">
<div class="card-body">
<h5 class="card-title">{{ component.type }}</h5>
<p class="card-text">
{% for component_key, component_value in component.items %}
{% if component_key not in 'actions,type' %}
<strong>{{ component_key }}:</strong> {{ component_value }}<br />
{% endif %}
{% endfor %}
</p> </p>
<small class="text-muted">{{ evidence.created }}</small>
</div> </div>
</div> </div>
</div> </div>
@ -165,9 +183,11 @@
</div> </div>
<footer> <footer>
<p>&copy; {% now "Y" %} eReuse. All rights reserved.</p> <p>
&copy;{% now 'Y' %}eReuse. All rights reserved.
</p>
</footer> </footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
</body> </body>
</html> </html>