{# tom_targets/partials/target_table_partial.html #}
{% load render_table from django_tables2 %}
{% if request.user.is_authenticated %}
Table Settings
{% endif %}
{# 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 a dataservice.
or
{% 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 %}