{% extends "admin/base_site.html" %}
{% load i18n %}

{% block breadcrumbs %}
<div class="breadcrumbs">
  <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
  &rsaquo; <a href="{% url 'django-admindocs-docroot' %}">{% translate 'Documentation' %}</a>
  &rsaquo; <a href="{% url 'django-admindocs-manuals' %}">{% translate 'Manuals' %}</a>
  &rsaquo; {{ manual.title }}
</div>
{% endblock %}
{% block title %}{{ manual.title }}{% endblock %}


{% block extrastyle %}
  {{ block.super }}
  {% with orientation=manual.pdf_orientation|default:'landscape' %}
    <style>
      .manual-content {
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
      }
      .manual-content pre,
      .manual-content code {
        white-space: pre-wrap;
        word-break: break-word;
      }
      .manual-content img,
      .manual-content table {
        max-width: 100%;
      }
      @media print {
        @page {
          size: {{ orientation }};
        }
      }
    </style>
  {% endwith %}
{% endblock %}

{% block content %}
<h1>{{ manual.title }}</h1>
<div id="content-main">
  <div class="object-tools">
    <ul>
      <li><a href="{% url 'django-admindocs-manual-pdf' manual.slug %}" download>{% translate 'Download PDF' %}</a></li>
    </ul>
  </div>
  <div class="manual-content">{{ manual.content_html|safe }}</div>
</div>
{% endblock %}
