formats['pdf'] = True
if book.root_ancestor.epub_file:
formats['epub'] = True
- if book.odt_file:
- formats['odt'] = True
if book.txt_file:
formats['txt'] = True
- if book.mp3_file:
- formats['mp3'] = True
- if book.ogg_file:
- formats['ogg'] = True
- if book.daisy_file:
- formats['daisy'] = True
+ for format in ('odt', 'mp3', 'ogg'):
+ if not formats[format] and book.has_media(format):
+ formats[format] = True
return HttpResponse(LazyEncoder().encode(formats))
// we don't want to interact with "audiobook" label, just 'format' tabs
var $this = $(this);
$this.addClass("active");
- $("#"+$this.html().toLowerCase()+"-files").show();
+ $("#"+$this.attr('data-format')+"-files").show();
});
$('.audiobook-list').hide();
<p class="header">
<span class="desc">{% trans "Audiobooks" %}:</span>
<span class="audiotabs">
- {% if book.has_mp3_file %}<span class="active">MP3</span>{% endif %}
- {% if book.has_ogg_file %}<span>OGG</span>{% endif %}
- {% if book.has_daisy_file %}<span>DAISY</span>{% endif %}
+ {% if book.has_mp3_file %}<span class="active" data-format="mp3">MP3</span>{% endif %}
+ {% if book.has_ogg_file %}<span data-format="ogg">Ogg Vorbis</span>{% endif %}
+ {% if book.has_daisy_file %}<span data-format="daisy">DAISY</span>{% endif %}
</span>
</p>
<div class="audiobooks">
</ul>
<h2>{% trans "Other resources" %}</h2>
<ul>
- <li><a href="{{ extra_info.about }}">{% trans "Book on project's wiki" %}</a></li>
{% if extra_info.source_url %}
<li><a href="{{ extra_info.source_url }}">{% trans "Source of the book" %}</a></li>
{% endif %}
{% block body %}
<h1>{% block book_list_header %}{% trans "Listing of all works" %}{% endblock %}</h1>
- <form action="{% url search %}" method="GET" accept-charset="utf-8" id="search-form">
- <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>
+ <form action="{% url search %}" method="get" accept-charset="utf-8" id="search-form">
+ <p>{{ form.q }} {{ form.tags }} <input type="submit" value="{% trans "Search" %}" />
+ <strong>{% trans "or" %}</strong> {% trans "see" %}:
+ <span class='collections'>
+ <a href="{% url catalogue.views.book_list %}">{% trans "all books" %}</a>
+ <a href="{% url catalogue.views.audiobook_list %}">{% trans "audiobooks" %}</a>
+ <a href="{% url catalogue.views.daisy_list %}">{% trans "DAISY" %}</a>
+ </span></p>
</form>
<a name="top">
<div id="book-list-nav">
<span class='collections'>
<a href="{% url catalogue.views.book_list %}">{% trans "all books" %}</a>
<a href="{% url catalogue.views.audiobook_list %}">{% trans "audiobooks" %}</a>
- <a href="{% url catalogue.views.daisy_list %}">{% trans "daisy" %}</a>
+ <a href="{% url catalogue.views.daisy_list %}">{% trans "DAISY" %}</a>
</span></p>
</form>
<p>{% trans "Lessons' prospects and other ideas for using Wolnelektury.pl for teaching." %}</p>
<p class="see-more"><a href="{% url lessons_document_list %}" title="{% trans "Hand-outs for teachers" %}">{% trans "See more" %} ⇒</a></p>
</div>
- <div id="czytamysluchajac">
- <a href="http://czytamysluchajac.pl/"><img src="{{ STATIC_URL }}img/czytamysluchajac-logo-small.png" alt="CzytamySluchajac - logo" style="float:left; padding: 10px;" /></a>
- <p style="padding-top:10px;"><a href="http://czytamysluchajac.pl/">Czytamy Słuchając</a> {% trans "are professional recordings of literary texts from our repository, available on free license in MP3 and Ogg Vorbis formats as well as in DAISY system." %}</p>
- <p class="see-more"><a href="http://czytamysluchajac.pl/index.php/o-projekcie/" title="Czytamy Słuchając">{% trans "See more" %} ⇒</a></p>
- </div>
</div>
<div id="tags-list">
<div id="categories-list">