lesmianator on steroids
[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 bodyid %}book-detail{% endblock %}
8
9 {% block body %}
10     <h1>{% book_title book %}</h1>
11     <form action="{% url search %}" method="get" accept-charset="utf-8" id="search-form">
12         <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>
13     </form>
14
15     <div id="books-list">
16         <div id='breadcrumbs'>
17             {% if categories.author %}
18                 {% for tag in categories.author %}
19                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
20                 {% endfor %}
21                 &#187; 
22             {% endif %}
23             {% for parent in parents %}
24                 <a href="{{ parent.get_absolute_url }}">{{ parent }}</a> &#187; 
25             {% endfor %}
26         </div>
27
28         {% if extra_info.license %}
29         <p>{% trans "Work is licensed under " %} <a href="{{ extra_info.license }}">{{ extra_info.license_description }}</a>.</p>
30         {% endif %}
31         <p>{% trans "Based on" %}: {{ extra_info.source_name }}</p>
32         {% if book.has_description %}
33             <div id="description">
34                 <div id='description-long'>{{ book.description|safe }}</div>
35                 <div id='description-short'>{{ book.description|safe|truncatewords_html:30 }}</div>
36             </div>
37             <div id="toggle-description"><p></p></div>
38         {% endif %}
39         <div id="formats">
40             <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>
41             <div class="clearboth"></div>
42             <div class="wrap">
43                 {% if book.has_html_file %}
44                     <a class="online" href="{% url book_text book.slug %}">{% trans "Read online" %}</a>
45                 {% endif %}
46                 <div class="download">
47                     {% if book.has_pdf_file %}
48                         <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>
49                     {% endif %}
50                     {% if book.root_ancestor.epub_file %}
51                         <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>
52                     {% endif %}
53                     {% if book.has_txt_file %}
54                         <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>
55                     {% endif %}
56                     {% for media in book.get_odt %}
57                         <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>
58                     {% endfor %}
59                 </div>
60                 {% if book.has_mp3_file or book.has_ogg_file or book.has_daisy_file %}
61                     <p class="header">
62                         <span class="desc">{% trans "Audiobooks" %}:</span>
63                         <span class="audiotabs">
64                             {% if book.has_mp3_file %}<span class="active" data-format="mp3">MP3</span>{% endif %}
65                             {% if book.has_ogg_file %}<span data-format="ogg">Ogg Vorbis</span>{% endif %}
66                             {% if book.has_daisy_file %}<span data-format="daisy">DAISY</span>{% endif %}
67                         </span>
68                     </p>
69                     <div class="audiobooks">
70                         <img src="{{ STATIC_URL }}img/speaker.png" id="speaker" alt="Speaker icon"/>
71                         {% if book.has_mp3_file %}
72                             <ul class="audiobook-list" id="mp3-files">
73                             {% for media in book.get_mp3 %}
74                                 <li class="mp3Player">
75                                   <a href="{{ media.file.url }}">{{ media.name }}</a><br/>
76                                   {% trans "Artist" %}: {{ media.get_extra_info_value.artist_name }}<br/>
77                                   {% trans "Director"%}: {{ media.get_extra_info_value.director_name }}<br/>
78                                   <object type="application/x-shockwave-flash" style="margin-top: 0.5em" data="{{ STATIC_URL }}player.swf" width="226" height="20">
79                                         <param name="movie" value="{{ STATIC_URL }}player.swf" />
80                                         <param name="bgcolor" value="#ffffff" />
81                                         <param name="FlashVars" value="mp3={{ media.file.url }}&amp;width=226&amp;showvolume=1&amp;bgcolor1=eeeeee&amp;bgcolor2=eeeeee&amp;buttoncolor=666666" />
82                                     </object>
83                                     
84                                 </li>
85                             {% endfor %}
86                             </ul>     
87                         {% endif %}
88
89                         {% if book.has_ogg_file %}
90                             <ul class="audiobook-list" id="ogg-files">
91                             {% for media in book.get_ogg %}
92                                 <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
93                             {% endfor %}
94                             </ul>
95                         {% endif %}
96                         {% if book.has_daisy_file %}
97                             <ul class="audiobook-list" id="daisy-files">
98                             {% for media in book.get_daisy %}
99                                 <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
100                             {% endfor %}
101                             </ul>
102                         {% endif %}
103                     </div> <!-- /audiobooks -->
104                     <p>{% blocktrans with '<a href="http://czytamysluchajac.pl">CzytamySłuchając</a>' as cs %}Audiobooks were prepared as a part of the {{ cs }} project.{% endblocktrans %}
105                     </p>
106                 {% endif %}
107             </div>
108         </div>
109
110         {% if book_children %}
111         {% autopaginate book_children 10 %}
112         <div id="book-children">
113             <ol>
114             {% for book in book_children %}
115                 <li>{{ book.short_html }}</li>
116             {% endfor %}
117             </ol>
118         </div>
119         {% paginate %}
120         {% endif %}
121
122     </div>
123
124     <div id="tags-list">
125         <div id="book-info">
126             <h2>{% trans "Details" %}</h2>
127             <ul>
128                 <li>
129                     {% trans "Author" %}:
130                     {% for tag in categories.author %}
131                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
132                     {% endfor %}
133                 </li>
134                 <li>
135                     {% trans "Epoch" %}:
136                     {% for tag in categories.epoch %}
137                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
138                     {% endfor %}
139                 </li>
140                 <li>
141                     {% trans "Kind" %}:
142                     {% for tag in categories.kind %}
143                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
144                     {% endfor %}
145                 </li>
146                 <li>
147                     {% trans "Genre" %}:
148                     {% for tag in categories.genre %}
149                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
150                     {% endfor %}
151                 </li>              
152             </ul>
153             <h2>{% trans "Other resources" %}</h2>
154             <ul>
155                 {% if extra_info.source_url %}
156                 <li><a href="{{ extra_info.source_url }}">{% trans "Source of the book" %}</a></li>
157                 {% endif %}
158                 {% if book.gazeta_link %}
159                 <li><a href="{{ book.gazeta_link }}">{% trans "Book description on Lektury.Gazeta.pl" %}</a></li>
160                 {% endif %}
161                 {% if book.wiki_link %}
162                 <li><a href="{{ book.wiki_link }}">{% trans "Book description on Wikipedia" %}</a></li>
163                 {% endif %}
164             </ul>
165             <p><a href="{{ book.xml_file.url }}">{% trans "View XML source" %}</a></p>
166             <p><a href="{% url poem_from_book book.slug %}">Miksuj ten utwór</a></p>
167         </div>
168         <div id="themes-list">
169             <h2>{% trans "Work's themes " %}</h2>
170             <ul>
171             {% for theme in book_themes %}
172                 <li><a href="{% url book_fragments book.slug,theme.slug %}">{{ theme }} ({{ theme.count }})</a></li>
173             {% endfor %}
174             </ul>
175         </div>
176         <div class="clearboth"></div>
177     </div>
178     <div id="set-window">
179         <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
180         <div class="target">
181             <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
182         </div>
183     </div>
184 {% endblock %}