Ticket #952 link to xml source added to book details.
[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 href="{% url book_text book.slug %}">{% trans "Read online" %}</a>
45             {% endif %}
46             {% if book.has_pdf_file %}
47                 <a href="{{ book.pdf_file.url }}">{% trans "Download PDF" %}</a>
48             {% endif %}
49             {% if book.root_ancestor.epub_file %}
50                 <a href="{{ book.root_ancestor.epub_file.url }}">{% trans "Download EPUB" %}</a>
51             {% endif %}
52             {% if book.has_odt_file %}
53                 <p>ODT</p>
54                 <ul>
55                 {% for media in book.get_odt %}
56                     <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
57                 {% endfor %}
58                 </ul>
59             {% endif %}
60             {% if book.has_txt_file %}
61                 <a href="{{ book.txt_file.url }}">{% trans "Download TXT" %}</a>
62             {% endif %}
63             {% if book.has_ogg_file %}
64                 <p>OGG</p>
65                 <ul>
66                 {% for media in book.get_ogg %}
67                     <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
68                 {% endfor %}
69                 </ul>
70             {% endif %}       
71             {% if book.has_daisy_file %}
72                 <p>DAISY</p>
73                 <ul>
74                 {% for media in book.get_daisy %}
75                     <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
76                 {% endfor %}
77                 </ul>
78             {% endif %}                 
79             {% if book.has_mp3_file %}
80                 <p>MP3</p>
81                 <a href="http://czytamysluchajac.pl/" id="czytamysluchajac-logo"><img src="{{ STATIC_URL }}img/czytamysluchajac-logo-small.png" /></a>
82                 <ul>
83                 {% for media in book.get_mp3 %}
84                     <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
85                     <li class="mp3Player">            
86                       <object type="application/x-shockwave-flash" style="margin-top: 0.5em" data="{{ STATIC_URL }}player.swf" width="226" height="20">
87                             <param name="movie" value="{{ STATIC_URL }}player.swf" />
88                             <param name="bgcolor" value="#ffffff" />
89                             <param name="FlashVars" value="mp3={{ media.file.url }}     &amp;width=226&amp;showvolume=1&amp;bgcolor1=eeeeee&amp;bgcolor2=eeeeee&amp;buttoncolor=666666" />
90                         </object>
91                     </li>
92                 {% endfor %}
93                 </ul>     
94             {% endif %}       
95             </div>
96         </div>
97
98         {% if book_children %}
99         {% autopaginate book_children 10 %}
100         <div id="book-children">
101             <ol>
102             {% for book in book_children %}
103                 <li>{{ book.short_html }}</li>
104             {% endfor %}
105             </ol>
106         </div>
107         {% paginate %}
108         {% endif %}
109
110     </div>
111
112     <div id="tags-list">
113         <div id="book-info">
114             <h2>{% trans "Details" %}</h2>
115             <ul>
116                 <li>
117                         
118                     {% trans "Author" %}:
119                     {% for tag in categories.author %}
120                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
121                     {% endfor %}
122                 </li>
123                 <li>
124                     {% trans "Epoch" %}:
125                     {% for tag in categories.epoch %}
126                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
127                     {% endfor %}
128                 </li>
129                 <li>
130                     {% trans "Kind" %}:
131                     {% for tag in categories.kind %}
132                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
133                     {% endfor %}
134                 </li>
135                 <li>
136                     {% trans "Genre" %}:
137                     {% for tag in categories.genre %}
138                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
139                     {% endfor %}
140                 </li>              
141             </ul>
142             <h2>{% trans "Other resources" %}</h2>
143             <ul>
144                 <li><a href="{{ extra_info.about }}">{% trans "Book on project's wiki" %}</a></li>
145                 {% if extra_info.source_url %}
146                 <li><a href="{{ extra_info.source_url }}">{% trans "Source of the book" %}</a></li>
147                 {% endif %}
148                 {% if book.gazeta_link %}
149                 <li><a href="{{ book.gazeta_link }}">{% trans "Book description on Lektury.Gazeta.pl" %}</a></li>
150                 {% endif %}
151                 {% if book.wiki_link %}
152                 <li><a href="{{ book.wiki_link }}">{% trans "Book description on Wikipedia" %}</a></li>
153                 {% endif %}
154             </ul>
155             <p><a href="{{ book.xml_file.url }}">{% trans "View XML source" %}</a></p>
156         </div>
157         <div id="themes-list">
158             <h2>{% trans "Work's themes " %}</h2>
159             <ul>
160             {% for theme in book_themes %}
161                 <li><a href="{% url book_fragments book.slug,theme.slug %}">{{ theme }} ({{ theme.count }})</a></li>
162             {% endfor %}
163             </ul>
164         </div>
165         <div class="clearboth"></div>
166     </div>
167     <div id="set-window">
168         <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
169         <div class="target">
170             <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
171         </div>
172     </div>
173 {% endblock %}