52 lines
1.8 KiB
HTML
52 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>CSV Preview</title>
|
|
<script src="{{ url_for('static', filename='edited_csv.js') }}"></script>
|
|
</head>
|
|
<body>
|
|
<h1>CSV Preview</h1>
|
|
|
|
<!-- Render tables for new and existing assets -->
|
|
{% for table_name, assets, editable in [
|
|
('New Assets', new_assets, true),
|
|
('Existing Assets', existing, false)
|
|
] %}
|
|
{% if assets %}
|
|
<h2>{{ table_name }}</h2>
|
|
<table border="1" class="table-new-assets">
|
|
<thead>
|
|
<tr>
|
|
{% for attrib in item_attributes %}
|
|
<th data-attrib="{{ attrib.attrib_name }}">{{ attrib.display_name }}</th>
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for asset in assets %}
|
|
<tr>
|
|
{% for attrib in item_attributes %}
|
|
<td {% if editable %}contenteditable="true"{% endif %}>
|
|
{{ asset[attrib.attrib_name] }}
|
|
</td>
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
<!-- Form button to confirm and save data -->
|
|
{% if new_assets %}
|
|
<form action="/confirm_save" method="POST" onsubmit="return collectEditedData(event)">
|
|
<button type="submit">Confirm and Save to Database</button>
|
|
</form>
|
|
{% endif %}
|
|
|
|
<!-- Cancel button that redirects to the home page -->
|
|
<button type="button" onclick="window.location.href='/'">Cancel</button>
|
|
</body>
|
|
</html> |