{% for job in jobs %}
  <tr>
    <td>
      <code>{{ job.name }}</code>
    </td>
    <td>
      {% if instance_owner_map and 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 }}</code></a>
      {% elif app_owner_map and job.owner in app_owner_map %}
        <a href="/ui/apps/{{ app_owner_map[job.owner] }}"><code>{{ job.owner }}</code></a>
      {% else %}
        <code>{{ job.owner }}</code>
      {% endif %}
    </td>
    <td>
      <span class="ht-badge ht-badge--info ht-badge--sm">{{ job.trigger_type }}</span>
      {% if job.trigger_detail %}<code class="ht-text-xs ht-text-muted">{{ job.trigger_detail }}</code>{% endif %}
    </td>
    <td>
      {% if job.next_run %}
        <time x-data
              x-text="new Date('{{ job.next_run }}'.replace(/\[.*\]$/, '')).toLocaleString()">{{ job.next_run }}</time>
      {% else %}
        —
      {% endif %}
    </td>
    <td>
      {% if job.repeat %}
        <span class="ht-badge ht-badge--link ht-badge--sm">repeating</span>
      {% else %}
        <span class="ht-badge ht-badge--neutral ht-badge--sm">once</span>
      {% endif %}
    </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>
{% else %}
  <tr>
    <td colspan="6" class="ht-text-center ht-text-muted">No scheduled jobs.</td>
  </tr>
{% endfor %}
