e6cc0f46c860232fc550d009ae56fde4b49a145c
[wolnelektury.git] / wolnelektury / templates / catalogue / book_detail.html
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load catalogue_tags pagination_tags %}
4
5 {% block title %}{{ book.title }} {% trans "on WolneLektury.pl" %}{% endblock %}
6
7 {% block metadescription %}{% book_title book %}. {{ block.super }}{% endblock %}
8
9 {% block bodyid %}book-detail{% endblock %}
10
11 {% block body %}
12     <h1>{% book_title book %}</h1>
13     <form action="{% url search %}" method="get" accept-charset="utf-8" id="search-form">
14         <p>{{ form.q }} <input type="submit" value="{% trans "Search" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url main_page %}">{% trans "return to main page" %}</a></p>
15     </form>
16
17     <div id="books-list">
18         <div id='breadcrumbs'>
19             {% if categories.author %}
20                 {% for tag in categories.author %}
21                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
22                 {% endfor %}
23                 &#187; 
24             {% endif %}
25             {% for parent in parents %}
26                 <a href="{{ parent.get_absolute_url }}">{{ parent }}</a> &#187; 
27             {% endfor %}
28         </div>
29
30         {% if extra_info.license %}
31         <p>{% trans "Work is licensed under " %} <a href="{{ extra_info.license }}">{{ extra_info.license_description }}</a>.</p>
32         {% endif %}
33         <p>{% trans "Based on" %}: {{ extra_info.source_name }}</p>
34         {% if book.has_description %}
35             <div id="description">
36                 <div id='description-long'>{{ book.description|safe }}</div>
37                 <div id='description-short'>{{ book.description|safe|truncatewords_html:30 }}</div>
38             </div>
39             <div id="toggle-description"><p></p></div>
40         {% endif %}
41         <div id="formats">
42             <p class="change-sets">{% trans "Put a book" %} <span><a href="{% url catalogue.views.book_sets book.slug %}" class="jqm-trigger">{% trans "on the shelf!" %}</a></span></p>
43             <div class="clearboth"></div>
44             <div class="wrap">
45                 {% if book.has_html_file %}
46                     <a class="online" href="{% url book_text book.slug %}">{% trans "Read online" %}</a>
47                 {% endif %}
48                 <div class="download">
49                     {% if book.has_pdf_file %}
50                         <a href="{{ book.pdf_file.url }}"><img src="{{ STATIC_URL }}img/pdf.png" title="{% trans "Download PDF" %} &ndash; {% trans "for reading" %} {% trans "and printing using" %} Adobe Reader" %}" alt="{% trans "Download PDF" %}" /></a>
51                     {% endif %}
52                     {% if book.root_ancestor.epub_file %}
53                         <a href="{{ book.root_ancestor.epub_file.url }}"><img src="{{ STATIC_URL }}img/epub.png" title="{% trans "Download EPUB" %} &ndash; {% trans "for reading" %} {% trans "on mobile devices" %}" alt="{% trans "Download EPUB" %}" /></a>
54                     {% endif %}
55                     {% if book.has_txt_file %}
56                         <a href="{{ book.txt_file.url }}"><img src="{{ STATIC_URL }}img/txt.png" title="{% trans "Download TXT" %} &ndash; {% trans "for reading" %} {% trans "on small displays, for example mobile phones" %}" alt="{% trans "Download TXT" %}" /></a>
57                     {% endif %}
58                     {% for media in book.get_odt %}
59                         <a href="{{ media.file.url }}"><img src="{{ STATIC_URL }}img/odt.png" title="{% trans "Download ODT" %} &ndash; {% trans "for reading" %} {% trans "and editing using" %} OpenOffice.org: {{ media.name }}" alt="{% trans "Download ODT" %}" /></a>
60                     {% endfor %}
61                 </div>
62                 {% if book.has_mp3_file or book.has_ogg_file or book.has_daisy_file %}
63                     <p class="header">
64                         <span class="desc">{% trans "Audiobooks" %}:</span>
65                         <span class="audiotabs">
66                             {% if book.has_mp3_file %}<span class="active" data-format="mp3">MP3</span>{% endif %}
67                             {% if book.has_ogg_file %}<span data-format="ogg">Ogg Vorbis</span>{% endif %}
68                             {% if book.has_daisy_file %}<span data-format="daisy">DAISY</span>{% endif %}
69                         </span>
70                     </p>
71                     <div class="audiobooks">
72                         <img src="{{ STATIC_URL }}img/speaker.png" id="speaker" alt="Speaker icon"/>
73                         {% if book.has_mp3_file %}
74                             <ul class="audiobook-list" id="mp3-files">
75                             {% for media in book.get_mp3 %}
76                                 <li class="mp3Player">
77                                   <a href="{{ media.file.url }}">{{ media.name }}</a><br/>
78                                   {% trans "Artist" %}: {{ media.get_extra_info_value.artist_name }}<br/>
79                                   {% trans "Director"%}: {{ media.get_extra_info_value.director_name }}<br/>
80                                   <object type="application/x-shockwave-flash" style="margin-top: 0.5em" data="{{ STATIC_URL }}player.swf" width="226" height="20">
81                                         <param name="movie" value="{{ STATIC_URL }}player.swf" />
82                                         <param name="bgcolor" value="#ffffff" />
83                                         <param name="FlashVars" value="mp3={{ media.file.url }}&amp;width=226&amp;showvolume=1&amp;bgcolor1=eeeeee&amp;bgcolor2=eeeeee&amp;buttoncolor=666666" />
84                                     </object>
85                                     
86                                 </li>
87                             {% endfor %}
88                             </ul>     
89                         {% endif %}
90
91                         {% if book.has_ogg_file %}
92                             <ul class="audiobook-list" id="ogg-files">
93                             {% for media in book.get_ogg %}
94                                 <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
95                             {% endfor %}
96                             </ul>
97                         {% endif %}
98                         {% if book.has_daisy_file %}
99                             <ul class="audiobook-list" id="daisy-files">
100                             {% for media in book.get_daisy %}
101                                 <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
102                             {% endfor %}
103                             </ul>
104                         {% endif %}
105                     </div> <!-- /audiobooks -->
106                     {% if projects|length > 1 %}
107                         <p>{% trans "Audiobooks were prepared as a part of the projects:" %}</p>
108                         <ul>
109                         {% for cs, fb in projects %}
110                             <li>
111                             {% if fb %}
112                                 {% blocktrans %}{{ cs }}, funded by {{ fb }}{% endblocktrans %}
113                             {% else %}
114                                 {{ cs }}
115                             {% endif %}
116                             </li>
117                         {% endfor %}
118                         </ul>
119                     {% else %}
120                         <p>
121                         {% with cs=projects.0.0 fb=projects.0.1 %}
122                             {% if fb %}
123                                 {% blocktrans %}Audiobooks were prepared as a part of the {{ cs }} project funded by {{ fb }}.{% endblocktrans %}
124                             {% else %}
125                                 {% blocktrans %}Audiobooks were prepared as a part of the {{ cs }} project.{% endblocktrans %}
126                             {% endif %}
127                         {% endwith %}
128                         </p>
129                     {% endif %}
130                 {% endif %}
131             </div>
132         </div>
133
134         {% if book_children %}
135         {% autopaginate book_children 10 %}
136         <div id="book-children">
137             <ol>
138             {% for book in book_children %}
139                 <li>{{ book.short_html }}</li>
140             {% endfor %}
141             </ol>
142         </div>
143         {% paginate %}
144         {% endif %}
145
146     </div>
147
148     <div id="tags-list">
149         <div id="book-info">
150             <h2>{% trans "Details" %}</h2>
151             <ul>
152                 <li>
153                     {% trans "Author" %}:
154                     {% for tag in categories.author %}
155                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
156                     {% endfor %}
157                 </li>
158                 <li>
159                     {% trans "Epoch" %}:
160                     {% for tag in categories.epoch %}
161                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
162                     {% endfor %}
163                 </li>
164                 <li>
165                     {% trans "Kind" %}:
166                     {% for tag in categories.kind %}
167                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
168                     {% endfor %}
169                 </li>
170                 <li>
171                     {% trans "Genre" %}:
172                     {% for tag in categories.genre %}
173                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
174                     {% endfor %}
175                 </li>              
176             </ul>
177             <h2>{% trans "Other resources" %}</h2>
178             <ul>
179                 {% if extra_info.source_url %}
180                 <li><a href="{{ extra_info.source_url }}">{% trans "Source of the book" %}</a></li>
181                 {% endif %}
182                 {% if book.gazeta_link %}
183                 <li><a href="{{ book.gazeta_link }}">{% trans "Book description on Lektury.Gazeta.pl" %}</a></li>
184                 {% endif %}
185                 {% if book.wiki_link %}
186                 <li><a href="{{ book.wiki_link }}">{% trans "Book description on Wikipedia" %}</a></li>
187                 {% endif %}
188             </ul>
189             <p><a href="{{ book.xml_file.url }}">{% trans "View XML source" %}</a></p>
190             <p><a href="{% url poem_from_book book.slug %}">Miksuj ten utwór</a></p>
191         </div>
192         <div id="themes-list">
193             <h2>{% trans "Work's themes " %}</h2>
194             <ul>
195             {% for theme in book_themes %}
196                 <li><a href="{% url book_fragments book.slug,theme.slug %}">{{ theme }} ({{ theme.count }})</a></li>
197             {% endfor %}
198             </ul>
199         </div>
200         <div class="clearboth"></div>
201     </div>
202     <div id="set-window">
203         <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
204         <div class="target">
205             <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
206         </div>
207     </div>
208 {% endblock %}