From: Lukasz Anwajler Date: Thu, 30 Dec 2010 01:31:23 +0000 (-0600) Subject: New design for book-detail template (downloading books etc), part2 X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/248250233ed99390536a6d427758d8cb606c8b57?ds=sidebyside New design for book-detail template (downloading books etc), part2 --- diff --git a/wolnelektury/static/css/master.css b/wolnelektury/static/css/master.css index 73a2cdadc..851306579 100644 --- a/wolnelektury/static/css/master.css +++ b/wolnelektury/static/css/master.css @@ -292,18 +292,109 @@ p .ac_input { #book-detail #formats .change-sets { margin-right: 0.5em; } +/* +#formats .wrap ul { + margin: 0; + padding: 0; +} + +#formats .wrap li { + display: block; + width: 100%; + height: 1.9em; + background-color: #F2F2F2; + border: 1px solid #EEE; + text-align: center; +} +*/ +#formats .wrap .header { + display: block; + width: 100%; + height: 1.9em; + background-color: #FFF; + border: 1px solid #EEE; + margin: 0; + padding: 0; + -moz-border-radius: 4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; + color:#2F4110; + margin-top: 40px; +} + +#formats .wrap .header span.active { + display: block; + height: 1.5em; + background-color:#FFF; + width: 80px; + text-align: center; + padding: 2px 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + color: #2F4110; + font-weight: bold; + float:left; + border: 1px solid #EEE; +} + +#formats .wrap .header span { + display: block; + height: 1.6em; + background-color:#EEE; + width: 80px; + text-align: center; + padding: 2px 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + color: #2F4110; + font-weight: bold; + float:left; + cursor: pointer; + border: 1px solid #EEE; +} -#formats .wrap p { +#formats .wrap .header span.desc { + display: block; + height: 1.6em; + background-color: #EEE; + width: 100px; + text-align: center; + padding: 2px 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + color: #2F4110; + font-weight: bold; + float:left; + cursor: normal; + margin-right: 20px; + border:0px; +} + + +#formats .wrap p.online { display: block; width: 100%; height: 1.5em; background-color: #EEE; margin-top: 0.5em; - padding: 0.5em 0; + padding: 1em 0; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; - text-align: center; + text-align: center; + font-size: 1.6em; + +} + +#formats .wrap div.download { + text-align: center; + margin-bottom: 10px; +} +#formats .wrap div.download img { + padding: 0 10px 0 10px; } #czytamysluchajac { @@ -320,9 +411,26 @@ p .ac_input { padding-top: 1em; padding-bottom: 0em; } -li.mp3Player { +div.audiobooks li { list-style-type: none; } + +div.audiobooks { + padding: 15px; + float: left; +} + +.audiobook-list { + float: left; width: 270px; + position: relative; + left: 10px; +} + +#speaker { + float: left; + padding:5px 10px; +} + #formats #czytamysluchajac-logo { background: white; text-align: left; diff --git a/wolnelektury/static/js/catalogue.js b/wolnelektury/static/js/catalogue.js index 1c23be82f..71225e189 100644 --- a/wolnelektury/static/js/catalogue.js +++ b/wolnelektury/static/js/catalogue.js @@ -1,3 +1,4 @@ +var STATIC = '/static/'; var LOCALE_TEXTS = { "pl": { "DELETE_SHELF": "Czy na pewno usunąć półkę", @@ -74,7 +75,6 @@ var BANNER_TEXTS = [ 'Pomóż uwolnić 286 utworów z listy lektur szkolnych. Przekaż swój 1% na Wolne Lektury.' ] - function changeBannerText() { var index = Math.floor(Math.random() * BANNER_TEXTS.length); if (BANNER_TEXTS[index] == $('#onepercent-text').html()) { @@ -492,5 +492,44 @@ function serverTime() { return false; }); + // player for audiobooks + + // event handlers for playing different formats + $('p.header span').click(function(){ + if(this.className != "desc"){ + $('.audiobook-list').hide(); + $('p.header span.active').attr('class', ''); + // we don't want to interact with "audiobook" label, just 'format' tabs + this.className = "active"; + $("#"+$("p.header span.active").html().toLowerCase()+"-files").show(); + } + }); + + + + $('.audiobook-list').hide(); + $("#"+$("p.header span.active").html().toLowerCase()+"-files").show(); + + /* this will be useful for javascript html player + var medias = $('.audiobook-list a'); + var mp3List = []; + var oggList = []; + var daisyList = []; + var tmpExt; + if (medias.length > 0) { + // creating sources list for player + medias.each(function(index, item) { + tmpExt = item.href.split(".").pop(); + if(tmpExt == "mp3") { + mp3List.push(item.href); + } else if (tmpExt == "ogg") { + oggList.push(item.href); + } else if(tmpExt == "daisy") { + daisyList.push(item.href); + } + }); + }*/ + }); })(jQuery) + diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html index 125b9bb01..2e423a01b 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -40,58 +40,63 @@

{% trans "Put a book" %} {% trans "on the shelf!" %}

- {% if book.has_html_file %} - {% trans "Read online" %} - {% endif %} - {% if book.has_pdf_file %} - {% trans "Download PDF" %} - {% endif %} - {% if book.root_ancestor.epub_file %} - {% trans "Download EPUB" %} - {% endif %} - {% if book.has_odt_file %} -

ODT

- - {% endif %} - {% if book.has_txt_file %} - {% trans "Download TXT" %} - {% 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_html_file %} +

{% trans "Read online" %}

+ {% endif %} +
+ {% if book.has_pdf_file %} + {% trans + {% endif %} + {% if book.root_ancestor.epub_file %} + {% trans + {% endif %} + {% if book.has_txt_file %} + {% trans + {% endif %} + {% if book.has_odt_file %} + {% trans + {% endif %} +
+

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

+
+ Speaker icon + {% if book.has_ogg_file %} + + {% endif %} + {% if book.has_daisy_file %} + + {% endif %} + + {% if book.has_mp3_file %} +
    + {% for media in book.get_mp3 %} +
  • + {{ media.name }} + + + + + + +
  • + {% endfor %} +
+ {% endif %} +
+

{% trans "Audiobooks were prepared as a part of project" %}: CzytamySłuchając.

@@ -114,7 +119,6 @@

{% trans "Details" %}