From 0f9389460e21fd3e7d4abf563feff7e714e6611c Mon Sep 17 00:00:00 2001
From: lewa <lene.wasskog@nibio.no>
Date: Tue, 25 Jun 2024 14:08:21 +0200
Subject: [PATCH] feat(observation): Adjust columns in observation list

---
 observations/static/observations/js/observationList.js | 9 ++++-----
 observations/templates/observations/index.html         | 5 +++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/observations/static/observations/js/observationList.js b/observations/static/observations/js/observationList.js
index a8bf87ae..b42eae82 100644
--- a/observations/static/observations/js/observationList.js
+++ b/observations/static/observations/js/observationList.js
@@ -353,19 +353,18 @@ var renderObservationTable = function(data)
 
         if (obs.observationTimeSeriesLabel) {
           tbodyHTML.push(
-              "<td><a href='/observations/timeseries/" + obs.observationTimeSeriesId + "' target='new'><span class='timeseries-label'/> " + obs.observationTimeSeriesLabel + "</a></td>"
+              "<td align='center'><a href='/observations/timeseries/" + obs.observationTimeSeriesId + "' target='new'><span class='timeseries-label'/> " + obs.observationTimeSeriesLabel + "</a></td>"
           );
         } else {
           tbodyHTML.push("<td></td>");
         }
-
+        
+        tbodyHTML.push("<td align='center'><a href='/observations/" + obs.observationId + "' target='new'><i class='fa fa-info-circle' aria-hidden='true'/></a></td>");
         if(Object.keys(measuredVal).length != 0){
-            tbodyHTML.push("<td><a tabindex='0' role='button' data-toggle='popover' data-placement='left' data-trigger='focus' data-html='true' data-content='" + printVal.join("<br/>").replace("'","&apos;") + "' ><span class='fa fa-balance-scale' aria-hidden='true'/></a></td>")
+            tbodyHTML.push("<td align='center'><a tabindex='0' role='button' data-toggle='popover' data-placement='left' data-trigger='focus' data-html='true' data-content='" + printVal.join("<br/>").replace("'","&apos;") + "' ><i class='fa fa-balance-scale' aria-hidden='true'/></a></td>")
         } else{
             tbodyHTML.push("<td></td>")
         }
-        
-        tbodyHTML.push("<td><a href='/observations/" + obs.observationId + "' target='new'>" + gettext("Details") + "</a></td>");
         tbodyHTML.push("</tr>");
     }
     tbody.innerHTML = tbodyHTML.join("\n");
diff --git a/observations/templates/observations/index.html b/observations/templates/observations/index.html
index 4c800cdf..feec7d46 100644
--- a/observations/templates/observations/index.html
+++ b/observations/templates/observations/index.html
@@ -61,14 +61,15 @@
               </div>
             <button type="submit" class="btn btn-primary">{% trans "Filter" %}</button>
         </form>
-<div class="table-responsive">
+        <div class="table-responsive">
             <table class="table table-striped" id="observationTable">
                     <thead>
                             <th>{% trans "Date of observation" %}</th>
                             <th>{% trans "Organism" %}</th>
                             <th>{% trans "Crop" %}</th>
                             <th>{% trans "Heading" %}</th>
-                            <th></th>
+                            <th>{% trans "Time series" %}</th>
+                            <th>{% trans "Details" %}</th>
                             <th></th>
                     </thead>
                     <tbody id="observationTableBody">
-- 
GitLab