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