Skip to content
Snippets Groups Projects
Commit 62b1c9e2 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat(observations): Add timeseries link to observation list, dummy view

parent 3bf59b9d
No related branches found
No related tags found
No related merge requests found
...@@ -351,6 +351,14 @@ var renderObservationTable = function(data) ...@@ -351,6 +351,14 @@ var renderObservationTable = function(data)
tbodyHTML.push("<td>" + obs.cropOrganismName + "</td>"); tbodyHTML.push("<td>" + obs.cropOrganismName + "</td>");
tbodyHTML.push("<td>" + obs.observationHeading + "</td>"); tbodyHTML.push("<td>" + obs.observationHeading + "</td>");
if (obs.observationTimeSeriesId) {
tbodyHTML.push(
"<td><a href='/observations/timeseries/" + obs.observationTimeSeriesId + "' target='new'><i class='fa fa-list'/></a></td>"
);
} else {
tbodyHTML.push("<td></td>");
}
if(Object.keys(measuredVal).length != 0){ if(Object.keys(measuredVal).length != 0){
tbodyHTML.push("<td><a tabindex='0' class='btn btn-lg' role='button' data-toggle='popover' data-placement='left' data-trigger='focus' data-html='true' data-content='" + printVal.join("<br/>") + "' ><i class='fa fa-balance-scale' aria-hidden='true' </i></a></td>") tbodyHTML.push("<td><a tabindex='0' class='btn btn-lg' role='button' data-toggle='popover' data-placement='left' data-trigger='focus' data-html='true' data-content='" + printVal.join("<br/>") + "' ><i class='fa fa-balance-scale' aria-hidden='true' </i></a></td>")
} else{ } else{
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
<th>{% trans "Crop" %}</th> <th>{% trans "Crop" %}</th>
<th>{% trans "Heading" %}</th> <th>{% trans "Heading" %}</th>
<th></th> <th></th>
<th></th>
</thead> </thead>
<tbody id="observationTableBody"> <tbody id="observationTableBody">
</tbody> </tbody>
......
<h1>TIMESERIES {{ observation_time_series_id }}</h1>
\ No newline at end of file
...@@ -31,4 +31,5 @@ urlpatterns = [ ...@@ -31,4 +31,5 @@ urlpatterns = [
re_path(r'old', views.index_old, name='index_old'), re_path(r'old', views.index_old, name='index_old'),
# ex: /observations/5/ # ex: /observations/5/
re_path(r'^(?P<observation_id>\d+)/$', (views.detail), name='detail'), re_path(r'^(?P<observation_id>\d+)/$', (views.detail), name='detail'),
re_path(r'^timeseries/(?P<observation_time_series_id>\w+)/$', views.timeseries, name='timeseries'),
] ]
\ No newline at end of file
...@@ -73,3 +73,9 @@ def detail(request, observation_id): ...@@ -73,3 +73,9 @@ def detail(request, observation_id):
"observation_id" : observation_id, "observation_id" : observation_id,
} }
return render(request, 'observations/detail.html', context) return render(request, 'observations/detail.html', context)
def timeseries(request, observation_time_series_id):
context = {
"observation_time_series_id" : observation_time_series_id,
}
return render(request, 'observations/timeseries.html', context)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment