{% extends "catalogue/base.html" %}
-{% load comments i18n %}
+{% load book_list comments i18n %}
-{% block leftcolumn %}
+{% block content %}
-<a href="{% url catalogue_book_edit book.slug %}">{% trans "edit" %}</a>
- <h1>{{ book.title }}</h1>
-<table>
- {% for c in chunks %}
- <tr class="chunk-{{ c.grade }}">
- <td><a target="_blank" href="{{ c.chunk.get_absolute_url }}">{{ c.chunk.comment }}</a></td>
- <td>{% for fix in c.fix %}
+<h1>{{ book.title }}</h1>
- {% ifequal fix "wl" %}<span class="fix"
- title="{% trans "add basic document structure" %}"
- ></></span>{% endifequal %}
- {% ifequal fix "bad-master" %}<span class="fix"
- title='{% trans "change master tag to" %} "{{ first_master }}"'
- >master</span>{% endifequal %}
-
- {% ifequal fix "trim-begin" %}<span class="fix"
- title="{% trans "add begin trimming tag" %}"
- >✁</span>{% endifequal %}
+{% if editable %}<form method='POST'>{% csrf_token %}{% endif %}
+<table class='editable'><tbody>
+ {{ form.as_table }}
+ {% if editable %}
+ <tr><td></td><td><button type="submit">{% trans "Save" %}</button></td></tr>
+ {% endif %}
+</tbody></table>
+{% if editable %}</form>{% endif %}
- {% ifequal fix "trim-end" %}<span class="fix"
- title="{% trans "add end trimming tag" %}"
- >✃</span>{% endifequal %}
+{% if editable %}
+ {% if book.gallery %}
+ <p><a href="{% url 'catalogue_book_gallery' book.slug %}">{% trans "Edit gallery" %}</a></p>
+ {% endif %}
- {% endfor %}
+ <p><a href="{% url 'catalogue_book_append' book.slug %}">{% trans "Append to other book" %}</a></p>
+{% endif %}
- {% ifequal c.grade "plain" %}
- <span class="fix-info">{% trans "unstructured text" %}</span>
- {% endifequal %}
- {% ifequal c.grade "xml" %}
- <span class="fix-info">{% trans "unknown XML" %}</span>
- {% endifequal %}
+<div class='section'>
- {% ifequal c.grade "wl-broken" %}
- <span class="fix-info">{% trans "broken document" %}</span>
- {% endifequal %}
+ <h2>{% trans "Chunks" %}</h2>
- </td>
- <td><a href="{% url catalogue_chunk_edit book.slug c.chunk.slug%}">[{% trans "edit" %}]</a></td>
- <td>{% if c.chunk.publishable %}P{% endif %}</td>
- <td>{% if c.chunk.user.is_authenticated %}
- <a href="{% url catalogue_user c.chunk.user.username %}">{{ c.chunk.user }}</a>
- {% endif %}</td>
- <td><a href="{% url catalogue_chunk_add book.slug c.chunk.slug %}">[+]</a></td>
- </tr>
+ <table class='single-book-list'><tbody>
+ {% for chunk in book %}
+ {{ chunk.short_html|safe }}
{% endfor %}
- {% if need_fixing %}
- <tr><td></td><td>
- <form method="POST" action="">
- {% csrf_token %}
- {% if choose_master %}
- {{ form.master }}
- {% endif %}
- <button type="submit">{% trans "Apply fixes" %}</button>
- </form>
- </td></tr>
- {% endif %}
-</table>
+ </tbody></table>
+
+</div>
+
+
-<p><a href="{% url catalogue_book_append book.slug %}">{% trans "Append to other book" %}</a></p>
+<div class='section'>
-<p>{% trans "Last published" %}: {{ book.last_published }}</p>
-{% if book.publishable %}
+<h2>{% trans "Publication" %}</h2>
+
+<p>{% trans "Last published" %}:
+ {% if book.last_published %}
+ {{ book.last_published }}
+ {% else %}
+ —
+ {% endif %}
+</p>
+
+{% if publishable %}
<p>
- <a href="{% url catalogue_book_xml book.slug %}">{% trans "Full XML" %}</a><br/>
- <a target="_blank" href="{% url catalogue_book_html book.slug %}">{% trans "HTML version" %}</a><br/>
- <a href="{% url catalogue_book_txt book.slug %}">{% trans "TXT version" %}</a><br/>
+ <a href="{% url 'catalogue_book_xml' book.slug %}" rel="nofollow">{% trans "Full XML" %}</a><br/>
{% comment %}
- <a href="{% url catalogue_book_epub book.slug %}">{% trans "EPUB version" %}</a><br/>
- <a href="{% url catalogue_book_pdf book.slug %}">{% trans "PDF version" %}</a><br/>
+ <a target="_blank" href="{% url 'catalogue_book_html' book.slug %}" rel="nofollow">{% trans "HTML version" %}</a><br/>
+ <a href="{% url 'catalogue_book_txt' book.slug %}" rel="nofollow">{% trans "TXT version" %}</a><br/>
+ <a href="{% url 'catalogue_book_pdf' book.slug %}" rel="nofollow">{% trans "PDF version" %}</a><br/>
{% endcomment %}
</p>
- <!--
- Angel photos:
- Angels in Ely Cathedral (http://www.flickr.com/photos/21804434@N02/4483220595/) /
- mira66 (http://www.flickr.com/photos/21804434@N02/) /
- CC BY 2.0 (http://creativecommons.org/licenses/by/2.0/)
- -->
- <form method="POST" action="{% url catalogue_publish book.slug %}">{% csrf_token %}
- <img src="{{ STATIC_URL }}img/angel-left.png" style="vertical-align: middle" />
- <button id="publish-button" type="submit">
- <span>{% trans "Publish" %}</span></button>
- <img src="{{ STATIC_URL }}img/angel-right.png" style="vertical-align: middle" />
- </form></p>
+ {% if user.is_authenticated %}
+ <!--
+ Angel photos:
+ Angels in Ely Cathedral (http://www.flickr.com/photos/21804434@N02/4483220595/) /
+ mira66 (http://www.flickr.com/photos/21804434@N02/) /
+ CC BY 2.0 (http://creativecommons.org/licenses/by/2.0/)
+ -->
+ <form method="POST" action="{% url 'catalogue_publish' book.slug %}">{% csrf_token %}
+ <img src="{{ STATIC_URL }}img/angel-left.png" style="vertical-align: middle" />
+ <button id="publish-button" type="submit">
+ <span>{% trans "Publish" %}</span></button>
+ <img src="{{ STATIC_URL }}img/angel-right.png" style="vertical-align: middle" />
+ </form>
+ {% else %}
+ <a href="{% url 'login' %}">{% trans "Log in to publish." %}</a>
+ {% endif %}
{% else %}
- {% trans "This book cannot be published yet" %}
+ <p>{% trans "This book can't be published yet, because:" %}</p>
+ <ul><li>{{ publishable_error }}</li></ul>
{% endif %}
-{% endblock leftcolumn %}
+<div style="clear: both;"></div>
+</div>
+
+
+
+<div class='section'>
+ <h2>{% trans "Comments" %}</h2>
-{% block rightcolumn %}
-{% render_comment_list for book %}
-{% with book.get_absolute_url as next %}
- {% render_comment_form for book %}
-{% endwith %}
+ {% render_comment_list for book %}
+ {% with book.get_absolute_url as next %}
+ {% render_comment_form for book %}
+ {% endwith %}
+</div>
-{% endblock rightcolumn %}
+{% endblock content %}