hide preview links (they don't do what they should anyway)
[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     {% if book.gallery %}
21     <p><a href="{% url 'catalogue_book_gallery' book.slug %}">{% trans "Edit gallery" %}</a></p>
22     {% endif %}
23
24     <p><a href="{% url 'catalogue_book_append' book.slug %}">{% trans "Append to other book" %}</a></p>
25 {% endif %}
26
27
28 <div class='section'>
29
30     <h2>{% trans "Chunks" %}</h2>
31
32     <table class='single-book-list'><tbody>
33     {% for chunk in book %}
34         {{ chunk.short_html|safe }}
35     {% endfor %}
36     </tbody></table>
37
38 </div>
39
40
41
42 <div class='section'>
43
44
45 <h2>{% trans "Publication" %}</h2>
46
47 <p>{% trans "Last published" %}:
48     {% if book.last_published %}
49         {{ book.last_published }}
50     {% else %}
51         &mdash;
52     {% endif %}
53 </p>
54
55 {% if publishable %}
56     <p>
57     <a href="{% url 'catalogue_book_xml' book.slug %}" rel="nofollow">{% trans "Full XML" %}</a><br/>
58     {% comment %}
59     <a target="_blank" href="{% url 'catalogue_book_html' book.slug %}" rel="nofollow">{% trans "HTML version" %}</a><br/>
60     <a href="{% url 'catalogue_book_txt' book.slug %}" rel="nofollow">{% trans "TXT version" %}</a><br/>
61     <a href="{% url 'catalogue_book_pdf' book.slug %}" rel="nofollow">{% trans "PDF version" %}</a><br/>
62     {% endcomment %}
63     </p>
64
65     {% if user.is_authenticated %}
66         <!--
67         Angel photos:
68         Angels in Ely Cathedral (http://www.flickr.com/photos/21804434@N02/4483220595/) /
69         mira66 (http://www.flickr.com/photos/21804434@N02/) /
70         CC BY 2.0 (http://creativecommons.org/licenses/by/2.0/)
71         -->
72         <form method="POST" action="{% url 'catalogue_publish' book.slug %}">{% csrf_token %}
73             <img src="{{ STATIC_URL }}img/angel-left.png" style="vertical-align: middle" />
74             <button id="publish-button" type="submit">
75                 <span>{% trans "Publish" %}</span></button>
76             <img src="{{ STATIC_URL }}img/angel-right.png" style="vertical-align: middle" />
77             </form>
78     {% else %}
79         <a href="{% url 'login' %}">{% trans "Log in to publish." %}</a>
80     {% endif %}
81 {% else %}
82     <p>{% trans "This book can't be published yet, because:" %}</p>
83     <ul><li>{{ publishable_error }}</li></ul>
84 {% endif %}
85
86 <div style="clear: both;"></div>
87 </div>
88
89
90
91 <div class='section'>
92     <h2>{% trans "Comments" %}</h2>
93
94     {% render_comment_list for book %}
95     {% with book.get_absolute_url as next %}
96         {% render_comment_form for book %}
97     {% endwith %}
98 </div>
99
100 {% endblock content %}