Skip to content
Snippets Groups Projects
Commit 8c3e17cb authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-2886: show name instead of status

parent b84ec35d
No related branches found
No related tags found
No related merge requests found
......@@ -762,7 +762,8 @@ def public_schedule(request):
.filter(status__value__in=models.SchedulingUnitStatus.ACTIVE_STATUS_VALUES) \
.filter(obsolete_since__isnull=True) \
.filter(on_sky_stop_time__gte=datetime.utcnow()) \
.order_by('on_sky_start_time').all()[:3]
.filter(on_sky_start_time__lte=datetime.utcnow()+timedelta(days=7)) \
.order_by('on_sky_start_time').all()
# return json if requested
if 'json' in request.headers.get('Accept','').lower():
......@@ -771,7 +772,7 @@ 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>Antenna</th><th>Target(s)</th></tr>\n'''
table_rows = '''<tr><th>Project</th><th>ID</th><th>Name</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:
......@@ -781,7 +782,7 @@ def public_schedule(request):
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,
su.name,
su.on_sky_start_time.strftime('%H:%M') if su.on_sky_start_time else '',
su.on_sky_stop_time.strftime('%H:%M') if su.on_sky_stop_time else '',
round(su.on_sky_duration.total_seconds()/60.0),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment