{% if jobs %}
  <table class="ht-table ht-table--dense ht-text-xs">
    <thead>
      <tr>
        <th>Name</th>
        {% if instance_owner_map %}<th>Instance</th>{% endif %}
        <th>Trigger</th>
        <th>Next Run</th>
        <th>Repeat</th>
        <th>Status</th>
      </tr>
    </thead>
    <tbody>
      {% for job in jobs %}
        <tr>
          <td>
            <code>{{ job.name }}</code>
          </td>
          {% if instance_owner_map %}
            <td>
              {% if job.owner in instance_owner_map %}
                <a href="/ui/apps/{{ instance_owner_map[job.owner][0] }}/{{ instance_owner_map[job.owner][1] }}"><code>{{ job.owner.split(".")[-1] }}</code></a>
              {% else %}
                <code>{{ job.owner }}</code>
              {% endif %}
            </td>
          {% endif %}
          <td>
            <span class="ht-badge ht-badge--info ht-badge--sm">{{ job.trigger_type }}</span>
          </td>
          <td>{{ job.next_run }}</td>
          <td>{{ "Yes" if job.repeat else "No" }}</td>
          <td>
            {% if job.cancelled %}
              <span class="ht-badge ht-badge--warning ht-badge--sm">cancelled</span>
            {% else %}
              <span class="ht-badge ht-badge--success ht-badge--sm">active</span>
            {% endif %}
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% else %}
  <p class="ht-text-muted ht-text-xs">No scheduled jobs.</p>
{% endif %}
