From 293deaa71a6e390517966f4ba9fa907562524636 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 17 Apr 2012 16:22:06 +0200 Subject: [PATCH] fix #2036, fix #2078: more audiobook links --- apps/catalogue/static/player/openplayer.js | 18 ++++++++++++++++ apps/catalogue/static/player/player.css | 4 ++++ .../templates/catalogue/book_text.html | 17 +++++++++++---- .../templates/catalogue/book_wide.html | 9 ++++---- .../catalogue/templates/catalogue/player.html | 6 ++---- apps/catalogue/templatetags/catalogue_tags.py | 21 ++++++++++++++++++- apps/catalogue/views.py | 1 + apps/wolnelektury_core/static/js/base.js | 9 -------- wolnelektury/settings/static.py | 9 +++++++- 9 files changed, 70 insertions(+), 24 deletions(-) create mode 100644 apps/catalogue/static/player/openplayer.js diff --git a/apps/catalogue/static/player/openplayer.js b/apps/catalogue/static/player/openplayer.js new file mode 100644 index 000000000..e8da79c81 --- /dev/null +++ b/apps/catalogue/static/player/openplayer.js @@ -0,0 +1,18 @@ +(function($) { + $(function() { + + + +$('.open-player').click(function(event) { + event.preventDefault(); + window.open($(this).attr('href'), + 'player', + 'width=422, height=500' + ); +}); + + + + }); +})(jQuery); + diff --git a/apps/catalogue/static/player/player.css b/apps/catalogue/static/player/player.css index c449803e5..829a9a1c0 100644 --- a/apps/catalogue/static/player/player.css +++ b/apps/catalogue/static/player/player.css @@ -15,3 +15,7 @@ .play:hover { color: #0D7E85; } + +.daisy-list { + list-style: none; +} diff --git a/apps/catalogue/templates/catalogue/book_text.html b/apps/catalogue/templates/catalogue/book_text.html index 53a0c6a5f..e844c96c1 100644 --- a/apps/catalogue/templates/catalogue/book_text.html +++ b/apps/catalogue/templates/catalogue/book_text.html @@ -1,4 +1,5 @@ {% load i18n %} +{% load url from future %} {% load static from staticfiles %} {% load chunks compressed catalogue_tags %} {% trans "Infobox" %}
  • {% trans "Book's page" %}
  • {% trans "Download" %}
  • + {% if related.media.mp3 or related.media.ogg %} +
  • + {% trans "Listen" %}
  • + {% endif %}
    @@ -35,16 +40,20 @@ {% if book.pdf_file %}
  • PDF {% trans "to print" %}
  • {% endif %} - {% if book.epub_file %} + {% if book.epub_file %}
  • EPUB {% trans "for a reader" %}
  • {% endif %} - {% if book.mobi_file %} + {% if book.mobi_file %}
  • MOBI {% trans "for Kindle" %}
  • {% endif %} - {% if book.txt_file %} + {% if book.txt_file %}
  • TXT {% trans "for advanced usage" %}
  • {% endif %} -
  • {% trans "Download a custom PDF" %}
  • +
  • {% trans "Download a custom PDF" %}
  • + {% if related.media.mp3 or related.media.ogg or related.media.daisy %} +
  • {% trans "Download all audiobooks for this book" %}: + {% download_audio book %}
  • + {% endif %}