72 lines
2.6 KiB
HTML
72 lines
2.6 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Import Warehouse Locations from CSV{% endblock %}
|
|
{% block content %}
|
|
<div class="scan-container">
|
|
<!-- Import Locations from CSV Card (first) -->
|
|
<div class="card scan-form-card" style="margin-bottom: 24px;">
|
|
<h3>Import Locations from CSV</h3>
|
|
<form method="POST" enctype="multipart/form-data" class="form-centered">
|
|
<label for="csv_file">Choose CSV file:</label>
|
|
<input type="file" name="csv_file" accept=".csv" required><br>
|
|
<button type="submit" class="btn">Upload & Preview</button>
|
|
{% if locations %}
|
|
<button type="submit" name="create_locations" value="1" class="btn" style="margin-left: 12px;">Create Locations</button>
|
|
{% endif %}
|
|
</form>
|
|
</div>
|
|
<!-- Preview Table Card (always visible) -->
|
|
<div class="card scan-table-card" style="margin-bottom: 24px;">
|
|
<h3>Preview Table</h3>
|
|
<table class="scan-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Location Code</th>
|
|
<th>Size</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% if locations %}
|
|
{% for loc in locations %}
|
|
<tr>
|
|
<td>{{ loc[0] }}</td>
|
|
<td>{{ loc[1] }}</td>
|
|
<td>{{ loc[2] }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% else %}
|
|
<tr><td colspan="3" style="text-align:center;">No CSV file uploaded yet.</td></tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% if report %}
|
|
<div class="card" style="margin-bottom: 24px;">
|
|
<h4>Import Report</h4>
|
|
<p>{{ report }}</p>
|
|
</div>
|
|
{% endif %}
|
|
<!-- CSV File Format Card (last) -->
|
|
<div class="card scan-form-card" style="margin-bottom: 24px;">
|
|
<h3>CSV File Format</h3>
|
|
<label style="margin-bottom: 8px; display: block;">Fisierul CSV trebuie sa aiba urmatorul format:</label>
|
|
<table class="scan-table" style="width: 100%;">
|
|
<thead>
|
|
<tr>
|
|
<th>Location Code</th>
|
|
<th>Size</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>EX123</td>
|
|
<td>100</td>
|
|
<td>Zona depozitare A</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|