{% extends "dashboard_app/_content.html" %}
{% load i18n %}
{% load humanize %}


{% block content %}
<div id="tabs">
  <ul>
    <li><a href="#tab-attachment-information">{% trans "Attachment Information" %}</a></li>
    <li><a href="{% url dashboard_app.views.ajax_attachment_viewer attachment.pk %}">{% trans "Inline Viewer" %}</a></li>
  </ul>
  <div id="tab-attachment-information">
    <dl>
      <dt>{% trans "Pathname" %}</dt>
      <dd>{{ attachment.content_filename }}</dd>
      <dt>{% trans "MIME type"%}</dt>
      <dd>{{ attachment.mime_type }}</dd>
      <dt>{% trans "Stored in dashboard" %}</dt>
      <dd>{{ attachment.content|yesno }}</dd>
      {% if attachment.content %}
      <dt>{% trans "File size" %}</dt>
      <dd>{{ attachment.content.size|filesizeformat }}</dd>
      {% endif %}
      <dt>{% trans "Stored on 3rd party server" %}</dt>
      <dd>{{ attachment.public_url|yesno }}</dd>
      {% if attachment.public_url %}
      <dt>{% trans "Public URL" %}</dt>
      <dd><a href="{{ attachment.public_url }}">{{ attachment.public_url }}</a></dd>
      {% endif %}
    </dl>
  </div>
</div>
<script type="text/javascript">
  $(document).ready(function() {
    $("#tabs").tabs({
      ajaxOptions: {
        dataType: "html",
        error: function( xhr, status, index, anchor ) {
          $( anchor.hash ).html(
          "Couldn't load this tab. We'll try to fix this as soon as possible.");
        }
      }
    });
  });
</script>
{% endblock %}
