From f7e2a9ab3466121d33c4a1dd215723a482779252 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Fri, 19 Jan 2024 12:19:08 +0100
Subject: [PATCH] TMSS-2886: added antenna_set column

---
 SAS/TMSS/backend/src/tmss/tmssapp/views.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/views.py b/SAS/TMSS/backend/src/tmss/tmssapp/views.py
index a9f69a1d822..53b19aaf6cd 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/views.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/views.py
@@ -769,14 +769,14 @@ def public_schedule(request):
 
     # else, return html table
     base_url = request._current_scheme_host
-    table_rows = '''<tr><th>Project</th><th>ID</th><th>Status</th><th>Start [UTC]</th><th>End [UTC]</th><th>Duration [min]</th><th>Center [LST]</th><th>Target(s)</th></tr>\n'''
+    table_rows = '''<tr><th>Project</th><th>ID</th><th>Status</th><th>Start [UTC]</th><th>End [UTC]</th><th>Duration [min]</th><th>Center [LST]</th><th>Antenna</th><th>Target(s)</th></tr>\n'''
     row_date = date.min
     for su in scheduled_or_running_units:
         if su.on_sky_start_time.date() > row_date:
             row_date = su.on_sky_start_time.date()
-            table_rows += '''<tr><td style="font-weight: bold; background-color: #999999;" colspan=8>%s</td></tr>\n''' % (row_date.strftime('%Y-%m-%d'))
+            table_rows += '''<tr><td style="font-weight: bold; background-color: #999999;" colspan=9>%s</td></tr>\n''' % (row_date.strftime('%Y-%m-%d'))
 
-        table_rows += '''<tr><td><a href="%s/project/view/%s">%s</a></td><td><a href="%s/schedulingunit/view/blueprint/%s">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%s</td><td>%s</td></tr>\n''' % (
+        table_rows += '''<tr><td><a href="%s/project/view/%s">%s</a></td><td><a href="%s/schedulingunit/view/blueprint/%s">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td></tr>\n''' % (
                                     base_url, su.project, su.project,
                                     base_url, su.id, su.id,
                                     su.status.value,
@@ -784,6 +784,7 @@ def public_schedule(request):
                                     su.on_sky_stop_time.strftime('%H:%M') if su.on_sky_stop_time else '',
                                     round(su.on_sky_duration.total_seconds()/60.0),
                                     su.main_observation_scheduled_central_lst.strftime('%H:%M') if su.main_observation_scheduled_central_lst else '',
+                                    ', '.join(sorted(list([q for q in set([x['specifications_doc__station_configuration__antenna_set'] for x in su.observation_tasks.values('specifications_doc__station_configuration__antenna_set')]) if q is not None]))),
                                     su.target_pointings_astropy)
 
     html_doc = '''<!DOCTYPE html>
-- 
GitLab