1
Fork 0
mirror of https://github.com/Steffo99/estus.git synced 2024-11-21 23:24:18 +00:00

Add Ordine details

This commit is contained in:
Steffo 2017-09-19 10:57:53 +02:00
parent 089ff60af4
commit 1df9ba3af2
3 changed files with 54 additions and 1 deletions

View file

@ -905,6 +905,16 @@ def page_order_show(oid):
return redirect(url_for("page_order_list"))
@app.route('/order_details/<int:oid>')
def page_order_details(oid):
if 'username' not in session:
return abort(403)
ordine = Ordine.query.get_or_404(oid)
dispositivi = Dispositivo.query.join(Ordine).filter_by(oid=oid).all()
return render_template("ordine/details.htm", dispositivi=dispositivi, pagetype="order",
user=session.get("username"), ordine=ordine)
@app.route('/query', methods=['GET', 'POST'])
def page_query():
"""Pagina delle query manuali:

View file

@ -39,7 +39,7 @@
Ordine
</h4>
<div class="list-group-item-text">
<a href="/ordine_details/{{ disp.ordine.oid }}">{{ disp.ordine.numero_ordine }}</a>
<a href="/order_details/{{ disp.ordine.oid }}">{{ disp.ordine.numero_ordine }}</a>
</div>
</li>
{% endif %}

View file

@ -0,0 +1,43 @@
{% extends "base.htm" %}
{% block title %}Dettagli Ordine • estus{% endblock %}
{% block content %}
<h1>
Dettagli dell'impiegato
</h1>
<ul class="list-group">
<li class="list-group-item">
<h4 class="list-group-item-heading">
Numero ordine
</h4>
<div class="list-group-item-text">
{{ ordine.numero_ordine }}
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Data dell'ordine (AAAA-MM-GG)
</h4>
<div class="list-group-item-text">
{{ ordine.data }}
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Fine garanzia (AAAA-MM-GG)
</h4>
<div class="list-group-item-text">
<code>{{ ordine.garanzia }}</code>
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Dispositivi associati
</h4>
<div class="list-group-item-text">
{% for dispositivo in dispositivi %} <a href="/disp_details/{{ dispositivo.did }}">{{ dispositivo.tipo }}</a> <br>{% endfor %}
</div>
</ul>
<a href="/ordine_show/{{ ordine.iid }}" class="btn btn-primary">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Modifica
</a>
{% endblock %}