bff6d70b17
Aplicatie Flask + SQLite pentru productie alimentara: cantarirea componentelor unui produs finit si tiparirea etichetei prin QZ Tray. - produse finite (retete) formate din componente cantarite - designer vizual de etichete (mm/px, zona sigura, campuri variabile, cod QR cu continut din mai multe bucati) - legare produs finit -> sablon de eticheta - navigare pe doua taburi: Cantarire / Setari - administrare: componente, produse finite, sabloane, campuri, istoric - backup, resetare baza de date, checklist de pregatire, /healthz - CLI de administrare si serviciu systemd pentru productie - vendor/syncpulse-scale-bridge (GPL-3.0-or-later) pentru citirea cantarului
48 lines
1.7 KiB
HTML
48 lines
1.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Componente{% endblock %}
|
|
|
|
{% block content %}
|
|
<section class="page-head">
|
|
<div>
|
|
<h1>Componente</h1>
|
|
<p class="subtitle">Ce se cântărește: fasole, carne, garnitură etc.</p>
|
|
</div>
|
|
<a class="btn primary" href="{{ url_for('components.create') }}">+ Component nou</a>
|
|
</section>
|
|
|
|
<section class="card">
|
|
{% if components %}
|
|
<div class="table-wrap">
|
|
<table class="table">
|
|
<thead>
|
|
<tr><th>Cod</th><th>Denumire</th><th>UM</th><th>Descriere</th><th>Stare</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for c in components %}
|
|
<tr class="{{ 'row-muted' if not c.active }}">
|
|
<td><code>{{ c.code }}</code></td>
|
|
<td>{{ c.name }}</td>
|
|
<td>{{ c.unit }}</td>
|
|
<td class="muted">{{ c.description or "-" }}</td>
|
|
<td>
|
|
{% if c.active %}<span class="badge ok">activ</span>
|
|
{% else %}<span class="badge off">inactiv</span>{% endif %}
|
|
</td>
|
|
<td class="right nowrap">
|
|
<a class="link" href="{{ url_for('components.edit', component_id=c.id) }}">Editează</a>
|
|
<form class="inline" method="post" action="{{ url_for('components.remove', component_id=c.id) }}"
|
|
onsubmit="return confirm('Ștergi componentul {{ c.code }}? Dacă e folosit într-o rețetă, va fi doar dezactivat.');">
|
|
<button class="link danger" type="submit">Șterge</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="muted">Nu există componente. <a href="{{ url_for('components.create') }}">Adaugă primul component</a>.</p>
|
|
{% endif %}
|
|
</section>
|
|
{% endblock %}
|