diff --git a/observations/static/observations/js/observationList.js b/observations/static/observations/js/observationList.js index 3a6ed604a732565a09771b8b043b0957384f718c..2cbc5b2386e82ee4deacf4e67ee429263c0adbc9 100644 --- a/observations/static/observations/js/observationList.js +++ b/observations/static/observations/js/observationList.js @@ -351,6 +351,14 @@ var renderObservationTable = function(data) tbodyHTML.push("<td>" + obs.cropOrganismName + "</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){ 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{ diff --git a/observations/templates/observations/index.html b/observations/templates/observations/index.html index bfbce1a687e5b71bce2327164f99ba4133f6572d..77955ab5dda6d22fd55766e7f7a74aa600625d80 100644 --- a/observations/templates/observations/index.html +++ b/observations/templates/observations/index.html @@ -69,6 +69,7 @@ <th>{% trans "Crop" %}</th> <th>{% trans "Heading" %}</th> <th></th> + <th></th> </thead> <tbody id="observationTableBody"> </tbody> diff --git a/observations/templates/observations/timeseries.html b/observations/templates/observations/timeseries.html new file mode 100644 index 0000000000000000000000000000000000000000..215a66e926fe408a09bf07f4fe109fae91171081 --- /dev/null +++ b/observations/templates/observations/timeseries.html @@ -0,0 +1 @@ +<h1>TIMESERIES {{ observation_time_series_id }}</h1> \ No newline at end of file diff --git a/observations/urls.py b/observations/urls.py index 0f75f017609c5a9b3844f67a759b656444156451..f7cc4794405900cf761b489d2f3396f79461ded6 100755 --- a/observations/urls.py +++ b/observations/urls.py @@ -31,4 +31,5 @@ urlpatterns = [ re_path(r'old', views.index_old, name='index_old'), # ex: /observations/5/ 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 diff --git a/observations/views.py b/observations/views.py index 94caa4442f660865d9d69296ce1ccc97d3abc021..31b680e98379a16e239798dee38ccc232d1e20d3 100755 --- a/observations/views.py +++ b/observations/views.py @@ -73,3 +73,9 @@ def detail(request, observation_id): "observation_id" : observation_id, } 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