kopia lustrzana https://github.com/glidernet/ogn-python
Put different takeoff / landing airport to "remarks"
rodzic
1909442241
commit
f5701db672
|
@ -29,8 +29,8 @@ class Airport(db.Model):
|
||||||
self.country_code,
|
self.country_code,
|
||||||
self.style,
|
self.style,
|
||||||
self.description,
|
self.description,
|
||||||
self.location_wkt.latitude if self.location_wkt else None,
|
self.location_wkt.latitude,
|
||||||
self.location_wkt.longitude if self.location_wkt else None,
|
self.location_wkt.longitude,
|
||||||
self.altitude,
|
self.altitude,
|
||||||
self.runway_direction,
|
self.runway_direction,
|
||||||
self.runway_length,
|
self.runway_length,
|
||||||
|
|
|
@ -156,12 +156,12 @@ def logbook():
|
||||||
|
|
||||||
# Get Logbook
|
# Get Logbook
|
||||||
filters = []
|
filters = []
|
||||||
if sel_date:
|
|
||||||
filters.append(db.func.date(Logbook.reftime) == sel_date)
|
|
||||||
|
|
||||||
if sel_country and sel_airport:
|
if sel_country and sel_airport:
|
||||||
filters.append(db.or_(Logbook.takeoff_airport_id == sel_airport, Logbook.landing_airport_id == sel_airport))
|
filters.append(db.or_(Logbook.takeoff_airport_id == sel_airport, Logbook.landing_airport_id == sel_airport))
|
||||||
|
|
||||||
|
if sel_date:
|
||||||
|
filters.append(db.func.date(Logbook.reftime) == sel_date)
|
||||||
|
|
||||||
if sel_device_id:
|
if sel_device_id:
|
||||||
filters.append(Logbook.device_id == sel_device_id)
|
filters.append(Logbook.device_id == sel_device_id)
|
||||||
|
|
||||||
|
|
|
@ -40,17 +40,23 @@
|
||||||
<th colspan="2">Takeoff</th>
|
<th colspan="2">Takeoff</th>
|
||||||
<th colspan="2">Landing</th>
|
<th colspan="2">Landing</th>
|
||||||
<th>AGL</th>
|
<th>AGL</th>
|
||||||
|
<th>Remark</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for entry in logbook %}
|
{% for entry in logbook %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ loop.index }}</td>
|
<td>{{ loop.index }}</td>
|
||||||
<td><a href="{{ url_for('device_detail', id=entry.device.id) }}">{% if entry.device.info is none %}{{ entry.device.address }}{% else %}{{ entry.device.info.registration }}{% endif %}</a></td>
|
<td><a href="{{ url_for('device_detail', id=entry.device.id) }}">{% if entry.device.info is none %}{{ entry.device.address }}{% else %}{{ entry.device.info.registration }}{% endif %}</a></td>
|
||||||
<td>{% if entry.device.info is none %}(unknown){% else %}{{ entry.device.info.aircraft }}{% endif %}</td>
|
<td>{% if entry.device.info is none %}(?){% else %}{{ entry.device.info.aircraft }}{% endif %}</td>
|
||||||
<td>{% if entry.takeoff_timestamp is not none %} {{ entry.takeoff_timestamp.strftime('%H:%M') }} {% endif %}</td>
|
<td>{% if entry.takeoff_timestamp is not none and entry.takeoff_airport.id|string() == sel_airport %} {{ entry.takeoff_timestamp.strftime('%H:%M') }} {% endif %}</td>
|
||||||
<td>{% if entry.takeoff_track is not none %} {{ '%02d' | format(entry.takeoff_track/10) }} {% endif %}</td>
|
<td>{% if entry.takeoff_track is not none and entry.takeoff_airport.id|string() == sel_airport %} {{ '%02d' | format(entry.takeoff_track/10) }} {% endif %}</td>
|
||||||
<td>{% if entry.landing_timestamp is not none %} {{ entry.landing_timestamp.strftime('%H:%M') }} {% endif %}</td>
|
<td>{% if entry.landing_timestamp is not none and entry.landing_airport.id|string() == sel_airport %} {{ entry.landing_timestamp.strftime('%H:%M') }} {% endif %}</td>
|
||||||
<td>{% if entry.landing_track is not none %} {{ '%02d' | format(entry.landing_track/10) }} {% endif %}</td>
|
<td>{% if entry.landing_track is not none and entry.landing_airport.id|string() == sel_airport %} {{ '%02d' | format(entry.landing_track/10) }} {% endif %}</td>
|
||||||
<td>{% if entry.max_altitude is not none %} {{ entry.max_altitude }} {% endif %}</td>
|
<td>{% if entry.max_altitude is not none %}{{ entry.max_altitude - entry.takeoff_airport.altitude }} m{% endif %}</td>
|
||||||
|
<td>
|
||||||
|
{% if entry.takeoff_airport is not none and entry.takeoff_airport.id|string() != sel_airport %}Take Off: <a href="{{ url_for('logbook', airport=entry.takeoff_airport.id) }}">{{ entry.takeoff_airport.name }}</a>
|
||||||
|
{% elif entry.landing_airport is not none and entry.landing_airport.id|string() != sel_airport %}Landing: <a href="{{ url_for('logbook', airport=entry.landing_airport.id) }}">{{ entry.landing_airport.name }}</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
Ładowanie…
Reference in New Issue