Update templates/index.html

This commit is contained in:
2026-01-20 14:47:29 +01:00
parent d62e3edac6
commit 94cee29e10

View File

@@ -8,29 +8,32 @@
:root { --mac-bg: #f2f2f7; --mac-blue: #007aff; --mac-red: #ff3b30; --mac-green: #34c759; --mac-gray: #8e8e93; } :root { --mac-bg: #f2f2f7; --mac-blue: #007aff; --mac-red: #ff3b30; --mac-green: #34c759; --mac-gray: #8e8e93; }
body { font-family: -apple-system, system-ui, sans-serif; background: var(--mac-bg); padding: 20px; font-size: 14px; color: #1c1c1e; } body { font-family: -apple-system, system-ui, sans-serif; background: var(--mac-bg); padding: 20px; font-size: 14px; color: #1c1c1e; }
.container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1200px; margin: auto; } .container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1200px; margin: auto; }
.panel { background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); border-radius: 12px; padding: 20px; flex: 1; min-width: 320px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); } .panel { background: white; border-radius: 12px; padding: 20px; flex: 1; min-width: 320px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; margin-bottom: 15px; background: white; border-radius: 8px; overflow: hidden; } table { width: 100%; border-collapse: collapse; margin-bottom: 15px; border-radius: 8px; overflow: hidden; }
th { padding: 10px; font-size: 14px; color: white; text-transform: uppercase; } th { padding: 10px; font-size: 13px; color: white; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 8px; text-align: center; border: 1px solid #e5e5ea; font-size: 14px; } td { padding: 8px; text-align: center; border: 1px solid #e5e5ea; font-size: 13px; }
.h-blue { background: var(--mac-blue); } .h-blue { background: var(--mac-blue); }
.h-red { background: var(--mac-red); } .h-red { background: var(--mac-red); }
input { width: 90%; border: 1px solid #d1d1d6; border-radius: 5px; padding: 6px; text-align: center; font-size: 14px; } input { width: 85%; border: 1px solid #d1d1d6; border-radius: 5px; padding: 5px; text-align: center; }
select { border: 1px solid #d1d1d6; border-radius: 5px; padding: 5px; } select { border: 1px solid #d1d1d6; border-radius: 5px; padding: 4px; }
.btn { width: 100%; padding: 12px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; margin-top: 10px; font-size: 15px; color: white; text-transform: uppercase; } .btn { width: 100%; padding: 12px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; margin-top: 10px; font-size: 14px; text-transform: uppercase; color: white; }
.btn-calc { background: var(--mac-green); } .btn-calc { background: var(--mac-green); }
.btn-exp { background: #5856d6; }
.btn-cups { background: var(--mac-blue); } .btn-cups { background: var(--mac-blue); }
.btn-exp { background: #5856d6; }
.btn-print { background: #c7c7cc; color: #1c1c1e; } .btn-print { background: #c7c7cc; color: #1c1c1e; }
.res-box { background: white; padding: 15px; border-radius: 10px; border: 1px solid #d1d1d6; line-height: 1.6; } .res-box { border: 1px solid #e5e5ea; border-radius: 10px; padding: 15px; }
.res-section h4 { margin: 10px 0 5px 0; text-transform: uppercase; font-size: 12px; color: var(--mac-gray); } .res-section h4 { margin: 15px 0 5px 0; font-size: 11px; color: var(--mac-gray); text-transform: uppercase; }
hr { border: 0; border-top: 1px solid #d1d1d6; margin: 15px 0; } ul { list-style: none; padding: 0; margin: 0; }
.msg-ok { color: var(--mac-green); font-weight: bold; text-align: center; margin-top: 10px; } li { padding-left: 15px; position: relative; margin-bottom: 3px; }
.footer-info { margin-top: 15px; text-align: center; font-size: 10px; color: var(--mac-gray); text-transform: uppercase; } li::before { content: "•"; position: absolute; left: 0; color: #1c1c1e; }
hr { border: 0; border-top: 1px solid #e5e5ea; margin: 15px 0; }
.footer { text-align: center; font-size: 10px; color: var(--mac-gray); margin-top: 20px; text-transform: uppercase; }
.msg-ok { color: var(--mac-green); text-align: center; font-weight: bold; margin-top: 10px; }
@media print { .no-print { display: none !important; } } @media print { .no-print { display: none !important; } }
</style> </style>
</head> </head>
@@ -38,34 +41,17 @@
<div class="container"> <div class="container">
<div class="panel no-print"> <div class="panel no-print">
<form method="POST"> <form method="POST">
<table> <table><tr class="h-blue"><th colspan="3">Dimensioni</th></tr>
<tr class="h-blue"><th colspan="3">Dimensioni</th></tr>
<tr><td>Altezza</td><td><input type="text" name="a" value="{{form.get('a','0')}}"></td><td><select name="ua">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ua','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr> <tr><td>Altezza</td><td><input type="text" name="a" value="{{form.get('a','0')}}"></td><td><select name="ua">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ua','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
<tr><td>Larghezza</td><td><input type="text" name="l" value="{{form.get('l','0')}}"></td><td><select name="ul">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ul','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr> <tr><td>Larghezza</td><td><input type="text" name="l" value="{{form.get('l','0')}}"></td><td><select name="ul">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ul','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
<tr><td>Profondità</td><td><input type="text" name="p" value="{{form.get('p','0')}}"></td><td><select name="up">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('up','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr> <tr><td>Profondità</td><td><input type="text" name="p" value="{{form.get('p','0')}}"></td><td><select name="up">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('up','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
</table> </table>
<table> <table><tr class="h-red"><th colspan="3">Miscela (Parti)</th></tr>
<tr class="h-red"><th colspan="3">Miscela (Parti)</th></tr> <tr><td>Cem:<br><input type="text" name="p_cem" value="{{form.get('p_cem','1')}}"></td><td>Sab:<br><input type="text" name="p_sab" value="{{form.get('p_sab','3')}}"></td><td>Ghi:<br><input type="text" name="p_ghi" value="{{form.get('p_ghi','5')}}"></td></tr>
<tr>
<td>Cemento:<br><input type="text" name="p_cem" value="{{form.get('p_cem','1')}}"></td>
<td>Sabbia:<br><input type="text" name="p_sab" value="{{form.get('p_sab','3')}}"></td>
<td>Ghiaia:<br><input type="text" name="p_ghi" value="{{form.get('p_ghi','5')}}"></td>
</tr>
</table> </table>
<table><tr class="h-red"><th colspan="3">Peso sacchette (Kg)</th></tr><tr>
<td>Cem:<input type="text" name="w_cem" value="{{form.get('w_cem','25')}}"></td>
<td>Sab:<input type="text" name="w_sab" value="{{form.get('w_sab','25')}}"></td>
<td>Ghi:<input type="text" name="w_ghi" value="{{form.get('w_ghi','25')}}"></td>
</tr></table>
<table><tr class="h-red"><th colspan="3">Costo sacchette (€)</th></tr><tr>
<td>Cem:<input type="text" name="c_cem" value="{{form.get('c_cem','1')}}"></td>
<td>Sab:<input type="text" name="c_sab" value="{{form.get('c_sab','1')}}"></td>
<td>Ghi:<input type="text" name="c_ghi" value="{{form.get('c_ghi','1')}}"></td>
</tr></table>
<table><tr class="h-red"><th>Attrezzatura</th></tr><tr><td>Volume Betoniera: <input type="text" name="v_bet" value="{{form.get('v_bet','160')}}" style="width:60px;"> L</td></tr></table>
<button type="submit" class="btn btn-calc">Esegui Calcolo</button> <button type="submit" class="btn btn-calc">Esegui Calcolo</button>
</form> </form>
<div class="footer-info">Versione Software: Rev.1 | Data Rilascio: 20/01/2026</div> <div class="footer">Versione Software: Rev.1 | Data: 20/01/2026</div>
</div> </div>
<div class="panel"> <div class="panel">
@@ -76,26 +62,33 @@
<hr> <hr>
<div class="res-section"> <div class="res-section">
<h4>Acquisti</h4> <h4>Acquisti</h4>
Cemento: {{ res.s_cem }} sacchetti | Sabbia: {{ res.s_sab }} sacchetti | Ghiaia: {{ res.s_ghi }} sacchetti<br> <ul>
Acqua: {{ res.acqua }} L | <b>Totale: {{ res.tot_sacc }} sacchetti</b> <li>Cemento: {{ res.s_cem }} sacchetti</li>
<li>Sabbia: {{ res.s_sab }} sacchetti</li>
<li>Ghiaia: {{ res.s_ghi }} sacchetti</li>
<li>Acqua: {{ res.acqua }} L | <b>Totale: {{ res.tot_sacc }} sacch.</b></li>
</ul>
</div> </div>
<div class="res-section"> <div class="res-section">
<h4>Costo stimato: {{ res.costo_tot }} €</h4> <h4>Costo Stimato: <b>{{ res.costo_tot }} €</b></h4>
</div> </div>
<hr> <hr>
<div class="res-section"> <div class="res-section">
<h4>Per ogni carico ({{ res.n_c }} carichi):</h4> <h4>Per ogni carico ({{ res.n_c }} carichi):</h4>
• Cemento: {{ res.bc_cem }} | • Sabbia: {{ res.bc_sab }} | • Ghiaia: {{ res.bc_ghi }} | • Acqua: {{ res.bc_aq }} L <ul>
<li>Cemento: {{ res.bc_cem }} sacchetti</li>
<li>Sabbia: {{ res.bc_sab }} sacchetti</li>
<li>Ghiaia: {{ res.bc_ghi }} sacchetti</li>
<li>Acqua: {{ res.bc_aq }} L</li>
</ul>
</div> </div>
</div> </div>
<form method="POST" class="no-print"> <form method="POST" class="no-print">
{% for k,v in form.items() %}<input type="hidden" name="{{k}}" value="{{v}}">{% endfor %} {% for k,v in form.items() %}<input type="hidden" name="{{k}}" value="{{v}}">{% endfor %}
<input type="hidden" name="res_vol" value="{{res.vol}}"><input type="hidden" name="res_peso" value="{{res.peso}}"> <input type="hidden" name="res_vol" value="{{res.vol}}"><input type="hidden" name="res_peso" value="{{res.peso}}">
<input type="hidden" name="res_aq" value="{{res.acqua}}"><input type="hidden" name="res_costo_t" value="{{res.costo_tot}}"> <input type="hidden" name="res_costo_t" value="{{res.costo_tot}}"><input type="hidden" name="res_nc" value="{{res.n_c}}">
<input type="hidden" name="res_nc" value="{{res.n_c}}"><input type="hidden" name="res_s_cem" value="{{res.s_cem}}"> <input type="hidden" name="res_s_cem" value="{{res.s_cem}}"><input type="hidden" name="res_s_sab" value="{{res.s_sab}}"><input type="hidden" name="res_s_ghi" value="{{res.s_ghi}}">
<input type="hidden" name="res_s_sab" value="{{res.s_sab}}"><input type="hidden" name="res_s_ghi" value="{{res.s_ghi}}"> <input type="hidden" name="res_bc_cem" value="{{res.bc_cem}}"><input type="hidden" name="res_bc_sab" value="{{res.bc_sab}}"><input type="hidden" name="res_bc_ghi" value="{{res.bc_ghi}}"><input type="hidden" name="res_bc_aq" value="{{res.bc_aq}}">
<input type="hidden" name="res_bc_cem" value="{{res.bc_cem}}"><input type="hidden" name="res_bc_sab" value="{{res.bc_sab}}">
<input type="hidden" name="res_bc_ghi" value="{{res.bc_ghi}}"><input type="hidden" name="res_bc_aq" value="{{res.bc_aq}}">
<button type="submit" name="btn_stampa_cups" class="btn btn-cups">Stampa PDF (CUPS)</button> <button type="submit" name="btn_stampa_cups" class="btn btn-cups">Stampa PDF (CUPS)</button>
<button type="submit" formaction="/download" class="btn btn-exp">Esporta TXT</button> <button type="submit" formaction="/download" class="btn btn-exp">Esporta TXT</button>
@@ -103,7 +96,7 @@
</form> </form>
{% if msg_stampa %}<div class="msg-ok">{{ msg_stampa }}</div>{% endif %} {% if msg_stampa %}<div class="msg-ok">{{ msg_stampa }}</div>{% endif %}
{% else %} {% else %}
<p style="text-align:center; color:var(--mac-gray);">Inserisci i dati e premi "Esegui Calcolo".</p> <p style="text-align:center; color:var(--mac-gray);">Inserisci i dati e calcola.</p>
{% endif %} {% endif %}
</div> </div>
</div> </div>