From: Radek Czajka Date: Wed, 12 Jan 2011 12:56:54 +0000 (+0100) Subject: #1000: remove buggy links to source on wiki X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/af544a7534db40bd650ac88fe5cf23cccf7b5b27 #1000: remove buggy links to source on wiki #1005: fix checking shelf book formats #999: book lists links on book lists pages #1001: OGG -> Ogg Vorbis #1004: remove Czytamy Sluchajac from main page --- diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 124cd9313..b69aa4a9c 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -651,16 +651,11 @@ def shelf_book_formats(request, shelf): 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)) diff --git a/wolnelektury/static/js/catalogue.js b/wolnelektury/static/js/catalogue.js index 510c543ce..afcacef79 100644 --- a/wolnelektury/static/js/catalogue.js +++ b/wolnelektury/static/js/catalogue.js @@ -501,7 +501,7 @@ function serverTime() { // 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(); diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html index f3a7b53ba..11edda829 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -61,9 +61,9 @@

{% trans "Audiobooks" %}: - {% if book.has_mp3_file %}MP3{% endif %} - {% if book.has_ogg_file %}OGG{% endif %} - {% if book.has_daisy_file %}DAISY{% endif %} + {% if book.has_mp3_file %}MP3{% endif %} + {% if book.has_ogg_file %}Ogg Vorbis{% endif %} + {% if book.has_daisy_file %}DAISY{% endif %}

@@ -152,7 +152,6 @@

{% trans "Other resources" %}