71 lines
2.6 KiB
HTML
71 lines
2.6 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Product Setup - Autotest{% endblock %}
|
|
|
|
{% block body %}
|
|
<div class="setup-container" style="display: flex; gap: 0px; align-items: flex-start; margin-left: 100px;">
|
|
|
|
<div class="forms-column" style="flex: 1; min-width: 300px;">
|
|
|
|
<section class="setup-section" style="margin-bottom: 40px;">
|
|
<h2>Add Board Family</h2>
|
|
<form action="/product-setup/add-family" method="POST" class="account-input">
|
|
<input type="text" name="family_name" placeholder="e.g. DPX-S" required>
|
|
<button type="submit">Add Family</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="setup-section">
|
|
<h2>Add New Board</h2>
|
|
<form action="/product-setup/add-board" method="POST" class="account-input">
|
|
|
|
<label style="display:block; margin-bottom:5px; font-weight:600;">Board Family:</label>
|
|
<select name="board_family_id" style="display: block; margin-bottom: 10px; min-width: 250px; background-color: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border); padding: 5px; border-radius: 6px;" required>
|
|
<option value="" disabled selected>Select a Family</option>
|
|
{% for family in families %}
|
|
<option value="{{ family.board_family_id }}">{{ family.board_family_prefix }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
|
|
<input type="text" name="board_name" placeholder="Board Name">
|
|
|
|
<button type="submit">Add Product</button>
|
|
|
|
</form>
|
|
</section>
|
|
</div>
|
|
|
|
<div class="table-column" style="flex: 2;">
|
|
<h2>Products</h2>
|
|
<table style="width: 100%; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background-color: var(--bg-surface);">
|
|
<thead>
|
|
<tr style="background-color: var(--bg-active); border-bottom: 1px solid var(--border);">
|
|
<th style="padding: 12px; text-align: left;">Product Families</th>
|
|
<th style="padding: 12px; text-align: left;">Boards</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for boards in products_table %}
|
|
{% for board in boards %}
|
|
<tr style="border-bottom: 1px solid var(--border);">
|
|
|
|
<td style="padding: 12px; text-align: left; font-weight: 600; color: var(--text-muted);">
|
|
{% if loop.first %}{{ board.family.board_family_prefix }}{% endif %}
|
|
</td>
|
|
|
|
<td style="padding: 12px; text-align: left; font-weight: 600; color: var(--text-muted);">
|
|
{{ board.family.board_family_prefix }}{{ board.board_name}}
|
|
</td>
|
|
|
|
</tr>
|
|
{% endfor %}
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="1" style="padding: 20px; text-align: center; color: var(--text-muted);">No products registered yet. Add one on the left.</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|