{# tom_targets/partials/target_table_partial.html #} {% load render_table from django_tables2 %} {# 1. Render the table (even if it's empty) #} {% render_table table %} {# 2. If table is empty, show the helpful context message below the empty headers #} {% if not table.data %}
{% if user.is_authenticated %} {% if empty_database %} {# Case A: The database is empty - suggest creating targets #} There are no targets in the database. You might want to create a target manually, import one from an alert broker or
{% csrf_token %}
{% else %} {# Case B: Database has targets, but filters hid them all #} No targets match those filters. {% endif %} {% else %} {# Case C: User is not logged in #} Please login to view or create targets. {% endif %}
{% endif %} {# 3. Update the skymap targets (data only, no viewer rebuild) #} {% load targets_extras %} {% aladin_skymap_targets_oob skymap_objects %}