This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/templates/inventory/snapshot_detail.html

143 lines
4.7 KiB
HTML
Raw Normal View History

2022-05-19 16:16:47 +00:00
{% extends "ereuse_devicehub/base_site.html" %}
{% block main %}
<div class="pagetitle">
<h1>Inventory</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ url_for('inventory.devicelist')}}">Inventory</a></li>
<li class="breadcrumb-item active">{{ page_title }}</li>
</ol>
</nav>
</div><!-- End Page Title -->
<section class="section profile">
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body pt-3">
<h3>{{ snapshot_sid }} | {{ snapshot_uuid }}</h3>
<!-- Bordered Tabs -->
{% if form.show() %}
<ul class="nav nav-tabs nav-tabs-bordered">
<li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#log">Log</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#change-type">Change type updated</button>
</li>
</ul>
{% endif %}
2022-05-19 16:16:47 +00:00
<div class="tab-content pt-2">
{% if form.show() %}
<div class="tab-pane fade" id="change-type">
<h5 class="card-title">Change Snapshot Type Upload</h5>
<div class="list-group col-6">
<div class="list-group-item">
2023-01-17 12:07:01 +00:00
<form method="post" class="row g-3 needs-validation" id="form_change_updated">
{{ form.csrf_token }}
{% for f in form %}
{% if f != form.csrf_token %}
<p class="mb-1">
{{ f }}
</p>
{% endif %}
{% endfor %}
<p class="mb-1">
2023-01-17 12:00:34 +00:00
<!-- <button class="btn btn-primary" type="submit">Save</button> -->
<a href="javascript:change_updated()" type="button" class="btn btn-primary">Save</a>
<span class="d-none" id="activeChangeUpdatedModal" data-bs-toggle="modal" data-bs-target="#btnChangeStatus"></span>
</p>
</form>
</div>
</div>
</div>
{% endif %}
<div class="tab-pane fade show active" id="log">
2022-05-19 16:16:47 +00:00
<h5 class="card-title">Traceability log Details</h5>
<div class="list-group col-6">
{% for log in snapshots_log %}
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{ log.get_status() }}</h5>
<small class="text-muted">{{ log.created.strftime('%H:%M %d-%m-%Y') }}</small>
</div>
<p class="mb-1">
Device:
{{ log.get_device() }}<br />
Version: {{ log.version }}<br />
</p>
<p>
<small class="text-muted">
{{ log.description }}
</small>
</p>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
2023-01-17 12:00:34 +00:00
<div class="modal fade" id="btnChangeStatus" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Change type updated</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div id="new_device" class="d-none">
Are you sure that you want to Change to <strong>New device</strong>?
<p class="text-danger">
This action cannot be undone.
</p>
</div>
<div id="update" class="d-none">
Are you sure that you want to Change to <strong>Update</strong>?
<p class="text-danger">
This action cannot be undone.
</p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary-outline" data-bs-dismiss="modal">Cancel</button>
2023-01-17 12:07:01 +00:00
<a href="javascript:send_form_change_updated()" type="button" class="btn btn-danger">
2023-01-17 12:00:34 +00:00
Confirm Save!
</a>
</div>
</div>
</div>
</div>
<script>
function change_updated() {
$("#update").attr('class', 'd-none');
$("#new_device").attr('class', 'd-none');
2023-01-17 12:07:01 +00:00
const stype = $("#snapshot_type").val();
2023-01-17 12:00:34 +00:00
$("#"+stype).attr('class', 'd-block');
2023-01-17 12:07:01 +00:00
2023-01-17 12:00:34 +00:00
$("#activeChangeUpdatedModal").click();
}
2023-01-17 12:07:01 +00:00
function send_form_change_updated() {
$("#form_change_updated").trigger('submit');
}
2023-01-17 12:00:34 +00:00
</script>
2022-05-19 16:16:47 +00:00
{% endblock main %}
2023-01-17 12:00:34 +00:00