{% load i18n %}
<div class="job-dialog">
  <table>
    <tr>
      <td>{% trans "Parameters" %}</td>
      <td>{{ job.parameters }}</td>
    </tr>
    {% for key, value in job.status_details.items %}
      {% if key != 'new_job_pk' %}
        <tr>
          <td>{{key}}</td>
          <td>{% for key2, value2 in value.items %}
            {{key2}}: {{value2}}<br>
          {% empty %}
            {{value|linebreaksbr}}
          {% endfor %}</td>
        </tr>
      {% endif %}
    {% endfor %}
  </table>

  {% if job.status == 'failed' or job.status == 'restarted' %}
    <div class="buttons">
      {% if job.status == 'failed' %}
        <a class="button" href="{% url 'restart-job' connector=object.get_connector_slug slug=object.slug job_pk=job.pk %}">{% trans "Restart" %}</a>
      {% else %}
        <a class="button" href="{% url 'view-jobs-connector' connector=object.get_connector_slug slug=object.slug %}?job_id={{ job.status_details.new_job_pk }}">{% trans "See new job" %}</a>
      {% endif %}
    </div>
  {% endif %}

</div>
