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