{% extends "admin/change_form.html" %}
{% load i18n admin_urls static pyas2%}

{% block title %} View MDN Details{% endblock title %}
{% block content %}
  {% block content_title %}{% endblock %}
  <h1> View MDN Details</h1>
  <div>
    <fieldset class="module aligned ">
      <div class="form-row field-name">
        <div>
          <label class="required" >MDN ID:</label>
          <p>{{ original.mdn_id }}</p>
        </div>
      </div>
      <div class="form-row field-name">
        <div>
          <label class="required" >Message:</label>
          <p>
          <a href="{% url 'admin:pyas2_message_change' original.message_id%}">
            {{ original.message.message_id}}</a>
          </p>
        </div>
      </div>
      <div class="form-row field-name">
        <div>
          <label class="required" >Status:</label>
          <p>{{ original.get_status_display }}</p>
        </div>
      </div>
      <div class="form-row field-name">
        <div>
          <label class="required" >Signed:</label>
          <p>
          {% if original.signed %}
            <img src="{% static "admin/img/icon-yes.svg"%}" alt="Yes">
          {% else %}
            <img src="{% static "admin/img/icon-no.svg"%}" alt="No">
          {% endif %}
          </p>
        </div>
      </div>
      <div class="form-row field-name">
        <div>
          <label class="required" >Message Headers:</label>
          <p>{{ original.headers|readfilefield|linebreaksbr }}</p>
        </div>
      </div>
      <div class="form-row field-name">
        <div>
          <label class="required" >Message Headers:</label>
          <p>{{ original.payload|readfilefield|linebreaksbr }}
        </div>
      </div>
    </fieldset>
  </div>
{% endblock content %}