New design for book-detail template (downloading books etc), part2
[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                     <p class="online"><a href="{% url book_text book.slug %}">{% trans "Read online" %}</a></p>
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 - for reading 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 - for reading 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 - for reading on small displays, for example mobile phones" %}" alt="{% trans "Download TXT" %}" /></a>
55                     {% endif %}
56                     {% if book.has_odt_file %}
57                         <a href="{{ book.odt_file.url }}"><img src="{{ STATIC_URL }}img/odt.png" title="{% trans "Download ODT - for reading and editing using OpenOffice.org" %}" alt="{% trans "Download ODT" %}" /></a>
58                     {% endif %}                
59                 </div>            
60                 <p class="header">
61                     <span class="desc">{% trans "Audiobooks" %}:</span>
62                     {% if book.has_mp3_file %}<span class="active">MP3</span>{% endif %}
63                     {% if book.has_ogg_file %}<span>OGG</span>{% endif %}
64                     {% if book.has_daisy_file %}<span>DAISY</span>{% endif %}
65                 </p>        
66                 <div class="audiobooks">
67                     <img src="{{ STATIC_URL }}img/speaker.png" id="speaker" alt="Speaker icon"/>
68                     {% if book.has_ogg_file %}
69                         <ul class="audiobook-list" id="ogg-files">
70                         {% for media in book.get_ogg %}
71                             <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
72                         {% endfor %}
73                         </ul>
74                     {% endif %}       
75                     {% if book.has_daisy_file %}
76                         <ul class="audiobook-list" id="daisy-files">
77                         {% for media in book.get_daisy %}
78                             <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
79                         {% endfor %}
80                         </ul>
81                     {% endif %}              
82
83                     {% if book.has_mp3_file %}
84                         <ul class="audiobook-list" id="mp3-files">
85                         {% for media in book.get_mp3 %}
86                             <li class="mp3Player">
87                               <a href="{{ media.file.url }}">{{ media.name }}</a>            
88                               <object type="application/x-shockwave-flash" style="margin-top: 0.5em" data="{{ STATIC_URL }}player.swf" width="226" height="20">
89                                     <param name="movie" value="{{ STATIC_URL }}player.swf" />
90                                     <param name="bgcolor" value="#ffffff" />
91                                     <param name="FlashVars" value="mp3={{ media.file.url }}&amp;width=226&amp;showvolume=1&amp;bgcolor1=eeeeee&amp;bgcolor2=eeeeee&amp;buttoncolor=666666" />
92                                 </object>
93                                 
94                             </li>
95                         {% endfor %}
96                         </ul>     
97                     {% endif %}
98                 </div> <!-- /audiobooks -->
99                 <p>{% trans "Audiobooks were prepared as a part of project" %}: <a href="http://czytamysluchajac.pl">CzytamySłuchając</a>.</p>
100             </div>
101         </div>
102
103         {% if book_children %}
104         {% autopaginate book_children 10 %}
105         <div id="book-children">
106             <ol>
107             {% for book in book_children %}
108                 <li>{{ book.short_html }}</li>
109             {% endfor %}
110             </ol>
111         </div>
112         {% paginate %}
113         {% endif %}
114
115     </div>
116
117     <div id="tags-list">
118         <div id="book-info">
119             <h2>{% trans "Details" %}</h2>
120             <ul>
121                 <li>
122                     {% trans "Author" %}:
123                     {% for tag in categories.author %}
124                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
125                     {% endfor %}
126                 </li>
127                 <li>
128                     {% trans "Epoch" %}:
129                     {% for tag in categories.epoch %}
130                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
131                     {% endfor %}
132                 </li>
133                 <li>
134                     {% trans "Kind" %}:
135                     {% for tag in categories.kind %}
136                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
137                     {% endfor %}
138                 </li>
139                 <li>
140                     {% trans "Genre" %}:
141                     {% for tag in categories.genre %}
142                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
143                     {% endfor %}
144                 </li>              
145             </ul>
146             <h2>{% trans "Other resources" %}</h2>
147             <ul>
148                 <li><a href="{{ extra_info.about }}">{% trans "Book on project's wiki" %}</a></li>
149                 {% if extra_info.source_url %}
150                 <li><a href="{{ extra_info.source_url }}">{% trans "Source of the book" %}</a></li>
151                 {% endif %}
152                 {% if book.gazeta_link %}
153                 <li><a href="{{ book.gazeta_link }}">{% trans "Book description on Lektury.Gazeta.pl" %}</a></li>
154                 {% endif %}
155                 {% if book.wiki_link %}
156                 <li><a href="{{ book.wiki_link }}">{% trans "Book description on Wikipedia" %}</a></li>
157                 {% endif %}
158             </ul>
159             <p><a href="{{ book.xml_file.url }}">{% trans "View XML source" %}</a></p>
160         </div>
161         <div id="themes-list">
162             <h2>{% trans "Work's themes " %}</h2>
163             <ul>
164             {% for theme in book_themes %}
165                 <li><a href="{% url book_fragments book.slug,theme.slug %}">{{ theme }} ({{ theme.count }})</a></li>
166             {% endfor %}
167             </ul>
168         </div>
169         <div class="clearboth"></div>
170     </div>
171     <div id="set-window">
172         <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
173         <div class="target">
174             <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
175         </div>
176     </div>
177 {% endblock %}