From 6463fd49ebde9ada3791fddc014166177c8fc430 Mon Sep 17 00:00:00 2001
From: Tanner Prestegard <tanner.prestegard@ligo.org>
Date: Wed, 19 Jun 2019 21:28:49 -0500
Subject: [PATCH] Add handling for case with no candidates to public alerts
 page

---
 gracedb/templates/superevents/public_alerts.html | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gracedb/templates/superevents/public_alerts.html b/gracedb/templates/superevents/public_alerts.html
index 93a433b64..eea50d096 100644
--- a/gracedb/templates/superevents/public_alerts.html
+++ b/gracedb/templates/superevents/public_alerts.html
@@ -26,6 +26,7 @@
 <h3>Detection candidates: {{ candidates }}</h3>
 <br /><br />
 
+{% if candidates > 0 %}
 <div class="tablesaw-overflow">
 <table class="tablesaw" data-tablesaw-sortable data-tablesaw-sortable-switch data-tablesaw-mode="columntoggle" data-tablesaw-minimap>
   <thead><tr>
@@ -98,7 +99,9 @@
   <li>Retractions are marked in red.</li>
   <li>More details about public alerts are provided in the <a href="https://emfollow.docs.ligo.org/userguide/">LIGO/Virgo Alerts User Guide</a>.</li>
 </ul>
-
+{% else %}
+<h2>No candidates at present.</h2>
+{% endif %}
 <br /><br /><br />
 
 {% endblock %}
-- 
GitLab