pull/78/head
Konstantin Gründger 2019-09-21 15:08:48 +02:00 zatwierdzone przez Meisterschueler
rodzic 1b22897da8
commit 2c29cc9b7a
3 zmienionych plików z 18 dodań i 18 usunięć

Wyświetl plik

@ -51,7 +51,7 @@ def index():
@bp.route("/devices.html", methods=["GET", "POST"])
def devices():
devices = db.session.query(Device).order_by(Device.address).limit(100)
devices = db.session.query(Device).order_by(Device.address)
return render_template("devices.html", devices=devices)

Wyświetl plik

@ -46,30 +46,30 @@
<table class="datatable table table-striped table-bordered">
<theader>
<tr>
<th>Nr.</th>
<th>Date</th>
<th></th>
<th></th>
<th colspan="2">Airport</th>
<th colspan="2">Time UTC</th>
<th></th>
<th></th>
</tr>
<tr>
<th>#</th>
<th>Date</th>
<th>Takeoff</th>
<th>Landing</th>
<th>Takeoff</th>
<th>Landing</th>
<th>Duration</th>
<th>AGL</th>
</tr>
<tr>
<th></th>
<th></th>
<th>Takeoff</th>
<th>Landing</th>
<th>Takeoff</th>
<th>Landing</th>
<th></th>
<th></th>
</tr>
</theader>
<tbody>
{% set date = none %}
{% set ns = namespace(mydate=none) %}
{% for entry in device.logbook %}
<tr>
<td>{{ loop.index }}</td>
<td>{% if date != entry.takeoff_timestamp.strftime('%Y-%m-%d') %}{{ entry.takeoff_timestamp.strftime('%Y-%m-%d') }}{% endif %}</td>
<td>{{ loop.index }}</td>
<td>{% if ns.mydate != entry.reftime.strftime('%Y-%m-%d') %}{% set ns.mydate = entry.reftime.strftime('%Y-%m-%d') %}{{ ns.mydate }}{% endif %}</td>
<td>{% if entry.takeoff_airport is not none %}<a href="{{ url_for('main.airport_detail', airport=entry.takeoff_airport.id) }}">{{ entry.takeoff_airport.name }}</a>{% endif %}</td>
<td>{% if entry.landing_airport is not none %}<a href="{{ url_for('main.airport_detail', airport=entry.landing_airport.id) }}">{{ entry.landing_airport.name }}</a>{% endif %}</td>
<td>{% if entry.takeoff_timestamp is not none %} {{ entry.takeoff_timestamp.strftime('%H:%M') }} {% endif %}</td>

Wyświetl plik

@ -17,11 +17,11 @@
<tr>
<td><a href="{{ url_for('main.device_detail', id=device.id) }}">{{ device.address }}</a></td>
<td>{% if device.info is not none %}{{ device.info.registration }}{% else %} - {% endif %}</td>
<td {% if device.software_version and device.software_version < 6.6 %}class="text-danger"{% endif %}>{% if device.software_version is not none %}{{ device.software_version }}{% else %} - {% endif %}</td>
<td {% if device.software_version and device.software_version < 6.6 %}class="danger"{% endif %}>{% if device.software_version is not none %}{{ device.software_version }}{% else %} - {% endif %}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}
{% endblock %}