#1000: remove buggy links to source on wiki
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 12 Jan 2011 12:56:54 +0000 (13:56 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 12 Jan 2011 12:57:20 +0000 (13:57 +0100)
#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

apps/catalogue/views.py
wolnelektury/static/js/catalogue.js
wolnelektury/templates/catalogue/book_detail.html
wolnelektury/templates/catalogue/book_list.html
wolnelektury/templates/catalogue/main_page.html

index 124cd93..b69aa4a 100644 (file)
@@ -651,16 +651,11 @@ def shelf_book_formats(request, shelf):
             formats['pdf'] = True
         if book.root_ancestor.epub_file:
             formats['epub'] = True
             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.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))
 
 
     return HttpResponse(LazyEncoder().encode(formats))
 
index 510c543..afcacef 100644 (file)
@@ -501,7 +501,7 @@ function serverTime() {
             // we don't want to interact with "audiobook" label, just 'format' tabs
             var $this = $(this);
             $this.addClass("active");
             // 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();
         });
 
         $('.audiobook-list').hide();
index f3a7b53..11edda8 100644 (file)
@@ -61,9 +61,9 @@
                     <p class="header">
                         <span class="desc">{% trans "Audiobooks" %}:</span>
                         <span class="audiotabs">
                     <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">
                         </span>
                     </p>
                     <div class="audiobooks">
             </ul>
             <h2>{% trans "Other resources" %}</h2>
             <ul>
             </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 %}
                 {% if extra_info.source_url %}
                 <li><a href="{{ extra_info.source_url }}">{% trans "Source of the book" %}</a></li>
                 {% endif %}
index 2791ef2..ecf54f8 100644 (file)
@@ -8,8 +8,14 @@
 
 {% block body %}
     <h1>{% block book_list_header %}{% trans "Listing of all works" %}{% endblock %}</h1>
 
 {% 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">
     </form>
     <a name="top">
     <div id="book-list-nav">
index e094814..b2f01be 100644 (file)
@@ -15,7 +15,7 @@
             <span class='collections'>
                 <a href="{% url catalogue.views.book_list %}">{% trans "all books" %}</a>
                 <a href="{% url catalogue.views.audiobook_list %}">{% trans "audiobooks" %}</a>
             <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>
 
             </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>
                 <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">
         </div>
         <div id="tags-list">
             <div id="categories-list">