Rearrange source to src dir.
[redakcja.git] / src / catalogue / templates / catalogue / book_detail.html
1 {% extends "catalogue/base.html" %}
2 {% load book_list i18n %}
3
4
5 {% block titleextra %}{{ book.title }}{% endblock %}
6
7
8 {% block content %}
9
10
11 <h1>{{ book.title }}</h1>
12
13
14 {% if editable %}<form method='POST'>{% csrf_token %}{% endif %}
15 <table class='editable'><tbody>
16     {{ form.as_table }}
17     {% if editable %}
18         <tr><td></td><td><button type="submit">{% trans "Save" %}</button></td></tr>
19     {% endif %}
20 </tbody></table>
21 {% if editable %}</form>{% endif %}
22
23 {% if editable %}
24     {% if book.gallery %}
25     <p><a href="{% url 'catalogue_book_gallery' book.slug %}">{% trans "Edit gallery" %}</a></p>
26     {% endif %}
27
28     <p><a href="{% url 'catalogue_book_append' book.slug %}">{% trans "Append to other book" %}</a></p>
29 {% endif %}
30
31
32 <div class='section'>
33
34     <h2>{% trans "Chunks" %}</h2>
35
36     <table class='single-book-list'><tbody>
37     {% for chunk in book %}
38         {{ chunk.short_html|safe }}
39     {% endfor %}
40     </tbody></table>
41
42 </div>
43
44
45
46 <div class='section'>
47
48
49 <h2>{% trans "Publication" %}</h2>
50
51 <div class="cover-preview">
52 <img class="cover-preview" src="{% url 'cover_preview' book.slug %}" />
53 {% if book.dc_cover_image %}
54     <a href="{{ book.dc_cover_image.get_absolute_url }}">{{ book.dc_cover_image }}</a>
55 {% endif %}
56 </div>
57
58 <p>{% trans "Last published" %}: 
59     {% if book.last_published %}
60         {{ book.last_published }}
61     {% else %}
62         &mdash;
63     {% endif %}
64 </p>
65
66 {% if publishable %}
67     <p>
68     <a href="{% url 'catalogue_book_xml' book.slug %}" rel="nofollow">{% trans "Full XML" %}</a><br/>
69     <a target="_blank" href="{% url 'catalogue_book_html' book.slug %}" rel="nofollow">{% trans "HTML version" %}</a><br/>
70     <a href="{% url 'catalogue_book_txt' book.slug %}" rel="nofollow">{% trans "TXT version" %}</a><br/>
71     <a href="{% url 'catalogue_book_pdf' book.slug %}" rel="nofollow">{% trans "PDF version" %}</a><br/>
72     <a href="{% url 'catalogue_book_pdf_mobile' book.slug %}" rel="nofollow">{% trans "PDF version for mobiles" %}</a><br/>
73     <a href="{% url 'catalogue_book_epub' book.slug %}" rel="nofollow">{% trans "EPUB version" %}</a><br/>
74     <a href="{% url 'catalogue_book_mobi' book.slug %}" rel="nofollow">{% trans "MOBI version" %}</a><br/>
75     </p>
76
77     {% if user.is_authenticated %}
78         <!--
79         Angel photos:
80         Angels in Ely Cathedral (http://www.flickr.com/photos/21804434@N02/4483220595/) /
81         mira66 (http://www.flickr.com/photos/21804434@N02/) /
82         CC BY 2.0 (http://creativecommons.org/licenses/by/2.0/)
83         -->
84         <form method="POST" action="{% url 'catalogue_publish' book.slug %}">{% csrf_token %}
85             {{ publish_options_form.as_p }}
86             <img src="{{ STATIC_URL }}img/angel-left.png" style="vertical-align: middle" />
87             <button id="publish-button" type="submit">
88                 <span>{% trans "Publish" %}</span></button>
89             <img src="{{ STATIC_URL }}img/angel-right.png" style="vertical-align: middle" />
90             </form>
91     {% else %}
92         <a href="{% url 'login' %}">{% trans "Log in to publish." %}</a>
93     {% endif %}
94 {% else %}
95     <p>{% trans "This book can't be published yet, because:" %}</p>
96     <ul><li>{{ publishable_error }}</li></ul>
97 {% endif %}
98
99 <div style="clear: both;"></div>
100 </div>
101
102
103 {% endblock content %}