1
0
Fork 0

Initial Ground Stations list view.

merge-requests/71/head
Pierros Papadeas 2014-10-28 02:45:22 +02:00
parent e19f464547
commit 4519a24459
3 changed files with 52 additions and 4 deletions

View File

@ -123,3 +123,10 @@ def view_observation(request, id):
return render(request, 'base/observation_view.html',
{'observation': observation, 'data': data})
def stations_list(request):
"""View to render Stations page."""
stations = Station.objects.all()
return render(request, 'base/stations.html', {'stations': stations})

View File

@ -1,5 +1,48 @@
{% extends "base.html" %}
{% load tags %}
{% block title %}Ground Stations{% endblock %}
{% block content %}
<h1>Ground Stations</h1>
<h1>
Ground Stations
{% if user.is_authenticated == 1 %}
<a class="btn btn-primary pull-right" href="">New Ground Station</a>
{% endif %}
</h1>
<div class="row">
<div class="col-md-12">
<table class="table table-hover">
<thead>
<th>ID</th>
<th>Name</th>
<th>Location</th>
<th>Altitude</th>
<th>Antenna</th>
</thead>
<tbody>
{% for station in stations.all %}
<tr>
<td>
<a href="#">
<span class="label label-default">
{{ station.id }}
</span>
</a>
</td>
<td>{{ station.name }}</td>
<td>{{ station.lat }}, {{ station.lng }}</td>
<td>{{ station.alt}} m</td>
<td>
{% for antenna in station.antenna.all %}
{{ antenna.antenna_type}} on {{ antenna.frequency }} ({{ antenna.band}})<br>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock content %}

View File

@ -23,9 +23,7 @@ urlpatterns = patterns(
url(r'^about/$',
TemplateView.as_view(template_name='base/about.html'),
name='about'),
url(r'^stations/$',
TemplateView.as_view(template_name='base/stations.html'),
name='stations'),
url(r'^stations/$', 'base.views.stations_list', name='stations'),
url(r'^prediction_windows/(?P<sat_id>[\w.@+-]+)/(?P<start_date>.+)/(?P<end_date>.+)/$',
'base.views.prediction_windows',
name='prediction_windows'),