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

Add Ordine field in device details page

This commit is contained in:
Steffo 2017-09-19 10:44:55 +02:00
parent 7e716c05fd
commit 089ff60af4
2 changed files with 12 additions and 0 deletions

View file

@ -604,6 +604,8 @@ def page_disp_details(did):
if 'username' not in session: if 'username' not in session:
return abort(403) return abort(403)
disp = Dispositivo.query.get_or_404(did) disp = Dispositivo.query.get_or_404(did)
if disp.oid is not None:
disp = Dispositivo.query.filter_by(did=did).join(Ordine).first()
accessi = Accesso.query.filter_by(did=did).all() accessi = Accesso.query.filter_by(did=did).all()
return render_template("dispositivo/details.htm", disp=disp, accessi=accessi, pagetype="disp", return render_template("dispositivo/details.htm", disp=disp, accessi=accessi, pagetype="disp",
user=session.get("username")) user=session.get("username"))

View file

@ -33,6 +33,16 @@
</div> </div>
</li> </li>
{% endif %} {% endif %}
{% if disp.oid %}
<li class="list-group-item">
<h4 class="list-group-item-heading">
Ordine
</h4>
<div class="list-group-item-text">
<a href="/ordine_details/{{ disp.ordine.oid }}">{{ disp.ordine.numero_ordine }}</a>
</div>
</li>
{% endif %}
{% if disp.so != " " %} {% if disp.so != " " %}
<li class="list-group-item"> <li class="list-group-item">
<h4 class="list-group-item-heading"> <h4 class="list-group-item-heading">