Add stats and beautify stations page
parent
0e35aa4783
commit
6b77df6252
|
@ -126,6 +126,11 @@ class Station(models.Model):
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def observations_count(self):
|
||||||
|
count = self.observations.all().count()
|
||||||
|
return count
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def apikey(self):
|
def apikey(self):
|
||||||
return get_apikey(user=self.owner)
|
return get_apikey(user=self.owner)
|
||||||
|
|
|
@ -301,6 +301,10 @@ span.datetime-time {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.station-antennas .label-info {
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Observations
|
/* Observations
|
||||||
==================== */
|
==================== */
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
$(document).ready(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// Render Station success rate
|
||||||
|
var success_rate = $('.gs.progress-bar-success').data('success-rate');
|
||||||
|
var percentagerest = $('.gs.progress-bar-danger').data('percentagerest');
|
||||||
|
$('.gs.progress-bar-success').css('width', success_rate + '%');
|
||||||
|
$('.gs.progress-bar-danger').css('width', percentagerest + '%');
|
||||||
|
});
|
|
@ -19,7 +19,8 @@
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Location</th>
|
<th>Location</th>
|
||||||
<th>Altitude</th>
|
<th>Last seen</th>
|
||||||
|
<th>Observations</th>
|
||||||
<th>Antennas</th>
|
<th>Antennas</th>
|
||||||
<th>Owner</th>
|
<th>Owner</th>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -53,12 +54,32 @@
|
||||||
{% if station.qthlocator %}
|
{% if station.qthlocator %}
|
||||||
- {{ station.qthlocator }}
|
- {{ station.qthlocator }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@{{ station.alt}}m
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>{{ station.alt}} m</td>
|
|
||||||
<td>
|
<td>
|
||||||
|
{% if station.last_seen %}
|
||||||
|
{{ station.last_seen|timesince }} ago
|
||||||
|
{% else %}
|
||||||
|
Never seen
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if station.success_rate %}
|
||||||
|
<span class="badge" data-toggle="tooltip" data-placement="bottom"
|
||||||
|
title="{{ station.success_rate }}% Success">
|
||||||
|
{{ station.observations_count }}
|
||||||
|
</span>
|
||||||
|
{% else %}
|
||||||
|
No stats
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td class="station-antennas">
|
||||||
{% for antenna in station.antenna.all %}
|
{% for antenna in station.antenna.all %}
|
||||||
{{ antenna.band}} {{ antenna.get_antenna_type_display }} | {{ antenna.frequency|frq }} - {{ antenna.frequency_max|frq }}<br>
|
<span class="label label-info" data-toggle="tooltip" data-placement="bottom"
|
||||||
|
title="{{ antenna.frequency|frq }} - {{ antenna.frequency_max|frq }}">
|
||||||
|
{{ antenna.band}} {{ antenna.get_antenna_type_display }}
|
||||||
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -79,4 +100,5 @@
|
||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
<script src="{% static 'js/gridsquare.js' %}"></script>
|
<script src="{% static 'js/gridsquare.js' %}"></script>
|
||||||
|
<script src="{% static 'js/stations.js' %}"></script>
|
||||||
{% endblock javascript %}
|
{% endblock javascript %}
|
||||||
|
|
Loading…
Reference in New Issue