fix dpp template in new version

This commit is contained in:
Cayo Puigdefabregas 2023-03-03 12:11:11 +01:00
parent c8fb5db63c
commit 2da17d06c0
2 changed files with 138 additions and 81 deletions

View File

@ -1,83 +1,140 @@
<!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 content="width=device-width, initial-scale=1.0" name="viewport">
<link href="https://stackpath.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-+ENW/yibaokMnme+vBLnHMphUYxHs34h9lpdbSLuAwGkOKFRl4C34WkjazBtb7eT"
crossorigin="anonymous">
<script src="https://use.fontawesome.com/7553aecc27.js"></script>
<title>Devicehub | Stamp create and Stamp verify</title>
<style>
/*Sticky footer*/
html {
position: relative;
min-height: 100%;
}
body { <title>Device {{ result.result.data.hardware.device.dhid }} - Usody</title>
margin-bottom: 60px; /* Margin bottom by footer height */ <meta content="" name="description">
} <meta content="" name="keywords">
.footer { <!-- Favicons -->
position: absolute; <link href="{{ url_for('static', filename='img/favicon.png') }}" rel="icon">
bottom: 0; <link href="{{ url_for('static', filename='img/apple-touch-icon.png') }}" rel="apple-touch-icon">
width: 100%;
height: 6em; <!-- Google Fonts -->
} <link href="https://fonts.gstatic.com" rel="preconnect">
</style> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- JS Files -->
<script src="{{ url_for('static', filename='js/jquery-3.6.0.min.js') }}"></script>
<!-- Vendor CSS Files -->
<link href="{{ url_for('static', filename='vendor/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='vendor/bootstrap-icons/bootstrap-icons.css') }}" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/devicehub.css') }}" rel="stylesheet">
<!-- =======================================================
* Template Name: NiceAdmin - v2.2.0
* Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
======================================================== -->
</head> </head>
<body> <body>
<nav class="navbar navbar-default" style="background-color: gainsboro; margin: 0 !important">
<div class="container-fluid"> <main>
<a href="https://www.usody.com/" target="_blank">
<h1 align="center">Usody</h1> <section class="container mt-3">
</a> <div class="row">
</div>
</nav> <div class="col">
<div class="container-fluid"> <div class="col-xl-12">
<div class="row">
<div class="page-header col-md-6 col-md-offset-3"> <div class="card">
This is the info for Digital Passport: {{result.dpp}} <div class="card-body">
</div> <h3 class="nav-link mt-5" style="color: #993365">
<div class="col-md-6 col-md-offset-3"> {{ result.result.data.hardware.device.type }} -
<h5>Hardware</h5> {{ result.result.data.hardware.device.manufacturer }}
<ul> {{ result.result.data.hardware.device.model }}
<li>Device</li> </h3>
<ul> <div class="row">
<li>Chassis: {{ result.result.data.hardware.device.chassis }}</li> <div class="col-12">
<li>Manufacturer: {{ result.result.data.hardware.device.manufacturer }}</li> This is the info for Digital Passport:<br />
<li>Model: {{ result.result.data.hardware.device.model }}</li> {{ result.result.data.dpp }}
<li>SerialNumber: {{ result.result.data.hardware.device.serialNumber }}</li> </div>
<li>Sku: {{ result.result.data.hardware.device.sku }}</li> </div>
<li>Type: {{ result.result.data.hardware.device.type }}</li> <div class="row">
<li>Version: {{ result.result.data.hardware.device.version }}</li> <div class="col-12">
</ul> <h5 class="card-title">Device</h5>
<li>Components</li> {% for key, value in result.result.data.hardware.device.items() %}
<ul> <div class="row">
{% for component in result.result.data.hardware.components %} <div class="col">
<li>{{ component }}</li> {{ key }}
</div>
<div class="col">
{{ value or '' }}
</div>
</div>
{% endfor %}
</div>
</div>
<div class="row">
<div class="col-12">
<h5 class="card-title">Components</h5>
{% for component in result.result.data.hardware.components %}
{% for key, value in component.items() %}
<div class="row">
<div class="col">
{{ key }}
</div>
<div class="col">
{{ value or '' }}
</div>
</div>
{% endfor %} {% endfor %}
</ul> {% endfor %}
</ul> </div>
</div>
{% if result.result.data.url_last %} {% if result.result.data.url_last %}
<h5>Last Digital passport</h5> <div class="row">
<a href="{{ result.result.data.url_last }}">{{ result.result.data.url_last }}</a> <div class="col-12">
{% endif %} <h5 class="card-title">Last Dpp</h5>
<div class="row">
<div class="col-12">
<a href="{{ result.result.data.url_last }}">Last Dpp</a>
</div>
</div>
</div>
</div>
{% endif %}
{% if result.result.data.digitalPassports %} </div>
<h5>Digital Passports</h5> </div>
<ul> </div>
{% for dpp in result.result.data.digitalPassports %}
<li>{{ dpp }}</li>
{% endfor %}
</ul>
{% endif %}
<br />
</div> </div>
</div>
</section>
</main>
<!-- ======= Footer ======= -->
<div class="container">
<div class="row">
<div class="col">
<footer class="footer">
<div class="copyright">
&copy; Copyright <strong><span>Usody</span></strong>. All Rights Reserved
</div>
<div class="credits">
<a href="https://help.usody.com/en/" target="_blank">Help</a> |
<a href="https://www.usody.com/legal/privacy-policy" target="_blank">Privacy</a> |
<a href="https://www.usody.com/legal/terms" target="_blank">Terms</a>
</div>
<div class="credits">
DeviceHub
</div>
</footer><!-- End Footer -->
</div> </div>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -275,25 +275,25 @@
{% if placeholder.binding %} {% if placeholder.binding %}
<div class="tab-pane fade profile-overview" id="dpps"> <div class="tab-pane fade profile-overview" id="dpps">
<h5 class="card-title">Digital Passports</h5> <h5 class="card-title">Digital Passports</h5>
{% for dpp in placeholder.binding.dpps %}
<div class="list-group col-12"> <div class="list-group col-12">
{% for dpp in placeholder.binding.dpps %}
<div class="list-group-item d-flex justify-content-between align-items-center"> <div class="list-group-item d-flex justify-content-between align-items-center">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="d-flex w-100 justify-content-between"> <div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Time Stamp</h5> <h5 class="mb-1">Time Stamp</h5>
<small class="text-muted">{{ dpp.timestamp }}</small> <small class="text-muted">{{ dpp.timestamp }}</small>
</div> </div>
<div class="col-12"> <div class="col-12">
<p class="mb-1"> <p class="mb-1">
<a href="{{ url_for('Did.DidView', dpp=dpp.key) }}" target="_blank">{{ dpp.key }}</a><br /> <a href="{{ url_for('Did.DidView', dpp=dpp.key) }}" target="_blank">{{ dpp.key }}</a><br />
</p> </p>
<small class="text-muted">{{ dpp.created.strftime('%H:%M %d-%m-%Y') }}</small> <small class="text-muted">{{ dpp.created.strftime('%H:%M %d-%m-%Y') }}</small>
</div> </div>
</div> </div>
</div> </div>
{% endfor %}
</div> </div>
{% endfor %}
</div> </div>
{% endif %} {% endif %}