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