ogn-python/app/templates/logbooks.html

73 wiersze
3.3 KiB
HTML

2019-02-10 13:00:35 +00:00
{% extends "base.html" %}
{% block content %}
<div class="container">
<div class="panel panel-success">
<div class="panel-heading"><h3 class="panel-title">Logbook</h3></div>
<div class="panel-body">
2019-04-02 21:48:24 +00:00
2019-02-10 13:00:35 +00:00
<form>
<div class="well">
<select name="country" onchange="this.form.submit();">
<option value="">(none)</option>
{% for country in countries %}
<option value="{{ country.iso2 }}"{% if sel_country == country.iso2 %} SELECTED{% endif %}>{{ country.iso2 }}</option>
{% endfor %}
</select>
2020-10-27 19:46:14 +00:00
<select name="airport_id" onchange="this.form.submit();">
2019-02-10 13:00:35 +00:00
<option value="">(none)</option>
{% for airport in airports %}
2020-10-27 19:46:14 +00:00
<option value="{{ airport.id }}"{% if sel_airport_id == airport.id %} SELECTED{% endif %}>{{ airport.name }}</option>
2019-02-10 13:00:35 +00:00
{% endfor %}
</select>
<select name="date" onchange="this.form.submit();">
2019-04-02 21:48:24 +00:00
{% if dates|length %}
{% for entry in dates %}
<option value="{{ entry.date }}"{% if sel_date|string() == entry.date|string() %} SELECTED{% endif %}>{{ entry.date }} ({{ entry.logbook_count }})</option>
{% endfor %}
{% else %}
<option value="">(none)</option>
{% endif %}
2019-02-10 13:00:35 +00:00
</select>
</div>
</form>
2020-11-15 17:27:54 +00:00
{% if logbooks is not none %}
2019-02-10 13:00:35 +00:00
<table class="datatable table table-striped table-bordered">
<tr>
2020-10-27 19:46:14 +00:00
<th>#</th>
2020-11-24 19:26:28 +00:00
<th>Registration</th>
2019-02-10 13:00:35 +00:00
<th>Type</th>
<th colspan="2">Takeoff</th>
<th colspan="2">Landing</th>
2019-03-23 20:16:50 +00:00
<th>Time</th>
2019-02-10 13:00:35 +00:00
<th>AGL</th>
<th>Remark</th>
2019-02-10 13:00:35 +00:00
</tr>
2020-11-15 17:27:54 +00:00
{% for entry in logbooks %}
2019-02-10 13:00:35 +00:00
<tr>
2020-10-27 19:46:14 +00:00
<td>{{ loop.index }}</td>{% set sender = entry.sender %}
<td>{{ sender|to_html_link|safe }}</td>
<td>{% if sender.infos|length > 0 and sender.infos[0].aircraft|length %}{{ sender.infos[0].aircraft }}{% else %}-{% endif %}</td>
<td>{% if entry.takeoff_timestamp is not none and entry.takeoff_airport.id == sel_airport_id %} {{ entry.takeoff_timestamp.strftime('%H:%M') }} {% endif %}</td>
<td>{% if entry.takeoff_track is not none and entry.takeoff_airport.id == sel_airport_id %} {{ '%02d' | format(entry.takeoff_track/10) }} {% endif %}</td>
<td>{% if entry.landing_timestamp is not none and entry.landing_airport.id == sel_airport_id %} {{ entry.landing_timestamp.strftime('%H:%M') }} {% endif %}</td>
<td>{% if entry.landing_track is not none and entry.landing_airport.id == sel_airport_id %} {{ '%02d' | format(entry.landing_track/10) }} {% endif %}</td>
2019-03-23 20:16:50 +00:00
<td>{% if entry.duration is not none %}{{ entry.duration }}{% endif %}</td>
2020-11-15 17:27:54 +00:00
<td>{% if entry.max_altitude is not none %}{{ '%d' | format(entry.max_altitude - entry.takeoff_airport.altitude) }} m{% endif %}</td>
<td>
{% if entry.takeoff_airport is not none and entry.takeoff_airport.id != sel_airport_id %}Take Off: {{ entry.takeoff_airport|to_html_flag|safe }}<a href="{{ url_for('main.logbooks', country=entry.takeoff_airport.country_code, airport_id=entry.takeoff_airport.id, date=sel_date) }}">{{ entry.takeoff_airport.name }}</a>
{% elif entry.landing_airport is not none and entry.landing_airport.id != sel_airport_id %}Landing: {{ entry.landing_airport|to_html_flag|safe }}<a href="{{ url_for('main.logbooks', country=entry.takeoff_airport.country_code, airport_id=entry.landing_airport.id, date=sel_date) }}">{{ entry.landing_airport.name }}</a>
{% endif %}
</td>
2019-02-10 13:00:35 +00:00
</tr>
{% endfor %}
</table>
{% endif %}
</div>
</div>
{% endblock %}