{% extends "base.html" %}
{% load toolbar_tags i18n %}
{% load static %}

{% block titleextra %}{% if chunk.pretty_title %}{{ chunk.pretty_title }}{% else %}{{ chunk.book.title }}{% endif %}{% endblock %}
{% block extrahead %}
  {% load pipeline %}
  {% stylesheet 'detail' %}
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <link rel="stylesheet" href="/wlxml/wl.css">
{% endblock %}

{% block extrabody %}
  <script type="text/javascript">
   var STATIC_URL = '{{STATIC_URL}}';
  </script>
  {% javascript 'detail' %}
    <script
	src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
	integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
	crossorigin="anonymous"></script>
{% endblock %}

{% block maincontent %}
  <div id="document-meta"
       data-chunk-id="{{ chunk.pk }}" style="display:none">

    <span data-key="book-slug">{{ chunk.book.slug }}</span>
    <span data-key="scans">{{ chunk.book.catalogue_book.scans_galleries|join:',' }}</span>
    <span data-key="gallery">{{ chunk.book.gallery }}</span>
    <span data-key="gallery-start">{% if chunk.gallery_start %}{{ chunk.gallery_start }}{% endif %}</span>
    <span data-key="revision">{{ revision }}</span>

    {% block meta-extra %} {% endblock %}
  </div>

  <nav class="navbar navbar-expand-sm navbar-dark bg-dark" id="header">
    <a class="navbar-brand" href="{{ chunk.book.get_absolute_url }}" target="_blank">
      <img src="{% url 'cover_preview' chunk.book.slug chunk.slug %}"
           style="height: 59px; margin-top:-13px;margin-bottom: -13px;">
    </a>

    <ul class="tabs nav nav-tabs mr-auto" id="tabs">
      {% block tabs-menu %}{% endblock %}
    </ul>

    {% block tools-menu %}
    {% endblock %}

    <ul class="tabs nav nav-tabs" id="tabs-right">
      {% block tabs-right %}{% endblock %}
    </ul>

    <div class='navbar-nav'>
      <a class='nav-item nav-link' href="{{ REDMINE_URL }}projects/wl-publikacje/wiki/Pomoc" target="_blank">
        {% trans "Help" %}</a>

      <div id="people" class="nav-item nav-link" ></div>

      <div id="user-area">
        {% include "registration/head_login.html" %}
        {% block dialogs %} {% endblock %}
      </div>




      <span class="navbar-text">{% trans "Version" %}: <span id="document-revision">{% trans "Unknown" %}</span></span>
      {% if not readonly %}
        <button class='ml-2 nav-item btn btn-primary' id="save-button" title="[Ctrl-s]">{% trans "Save" %}</button>
	<span id='save-attempt-info' class="navbar-text ml-2"><span class="alert alert-info">{% trans "Save attempt in progress" %}</span></span>
	<span id='out-of-date-info' class="navbar-text ml-2"><span class="alert alert-danger">{% trans "There is a newer version of this document!" %}</span></span>
      {% endif %}
    </div>
  </nav>
  <div id="splitter">
    <div id="editor" class="{% block editor-class %} {% endblock %}">
      {% block tabs-content %} {% endblock %}
    </div>
    {% block splitter-extra %} {% endblock %}
  </div>


{% endblock %}
