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

Add Dispositivo details page

This commit is contained in:
Lorenzo 2017-09-11 15:22:44 +02:00
parent 055cbf207b
commit ae2369e658
2 changed files with 66 additions and 12 deletions

View file

@ -398,6 +398,7 @@ def page_disp_list():
for dispositivo in dispositivi:
accesso = Accesso.query.join(Dispositivo).filter_by(did=dispositivo.did).join(Impiegato).all()
if not accesso:
# oh dio mio a cosa stavo pensando viva il duck typing
accessi.append([FakeAccesso(dispositivo)])
else:
accessi.append(accesso)
@ -409,9 +410,10 @@ def page_disp_list():
def page_details_host(did):
if 'username' not in session:
return redirect(url_for('page_login'))
disp = Dispositivo.query.get(did)
disp = Dispositivo.query.filter_by(did=did).first()
accessi = Accesso.query.filter_by(did=did).all()
css = url_for("static", filename="style.css")
return render_template("dispositivo/details.htm", css=css, disp=disp, type="disp", user=session["username"])
return render_template("dispositivo/details.htm", css=css, disp=disp, accessi=accessi, type="disp", user=session["username"])
if __name__ == "__main__":

View file

@ -1,15 +1,67 @@
{% extends "base.htm" %}
{% block title %}Dettagli Dispositivo{% endblock %}
{% block content %}
<h1>
Ispeziona dispositivo
</h1>
<ul class="list-group">
{% for ente in conteggioservizi %}
<li class="list-group-item">
<div class="list-group-item-heading">
Sassi
</div>
<h4 class="list-group-item-heading">
Tipo Dispositivo
</h4>
<div class="list-group-item-text">
10
{{ disp.tipo }}
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Marca
</h4>
<div class="list-group-item-text">
{{ disp.marca }}
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Modello
</h4>
<div class="list-group-item-text">
{{ disp.modello }}
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Modello
</h4>
<div class="list-group-item-text">
{{ disp.fornitore }}
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Utenti
</h4>
<div class="list-group-item-text">
{% for accesso in accessi %}
<a href="/imp_show/{{ accesso.iid }}">{{ accesso.impiegato.nomeimpiegato }}</a><br>
{% endfor %}
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Codice Inventario CED
</h4>
<div class="list-group-item-text">
<code>{{ disp.inv_ced }}</code>
</div>
</li>
<li class="list-group-item">
<h4 class="list-group-item-heading">
Codice Inventario Ente
</h4>
<div class="list-group-item-text">
<code>{{ disp.inv_ente }}</code>
</div>
</li>
</ul>
{% endblock %}