prettier player window,
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Feb 2012 11:38:05 +0000 (12:38 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Feb 2012 11:38:05 +0000 (12:38 +0100)
minor display fixes

17 files changed:
apps/catalogue/templatetags/catalogue_tags.py
apps/catalogue/views.py
lib/librarian
wolnelektury/settings.py
wolnelektury/static/css/catalogue.css
wolnelektury/static/css/header.css
wolnelektury/static/css/main_page.css
wolnelektury/static/css/player.css [new file with mode: 0644]
wolnelektury/static/img/logo-220.png [new file with mode: 0644]
wolnelektury/static/jplayer/jplayer.blue.monday.css
wolnelektury/static/js/base.js
wolnelektury/templates/catalogue/audiobook_list.html
wolnelektury/templates/catalogue/book_list.html
wolnelektury/templates/catalogue/book_text.html
wolnelektury/templates/catalogue/menu.html
wolnelektury/templates/catalogue/player.html
wolnelektury/views.py

index e2aac35..14ed64d 100644 (file)
@@ -148,6 +148,17 @@ def book_tree(book_list, books_by_parent):
     else:
         return ''
 
+@register.simple_tag
+def audiobook_tree(book_list, books_by_parent):
+    text = "".join("<li><a class='open-player' href='%s'>%s</a>%s</li>" % (
+        reverse("book_player", args=[book.slug]), book.title, audiobook_tree(books_by_parent.get(book, ()), books_by_parent)
+        ) for book in book_list)
+
+    if text:
+        return "<ol>%s</ol>" % text
+    else:
+        return ''
+
 @register.simple_tag
 def book_tree_texml(book_list, books_by_parent, depth=1):
     return "".join("""
index 6405a49..fad7775 100644 (file)
@@ -246,10 +246,11 @@ def player(request, slug):
         else:
             have_oggs = False
         audiobooks.append(media)
-    print audiobooks
 
     projects = sorted(projects)
 
+    extra_info = book.get_extra_info_value()
+
     return render_to_response('catalogue/player.html', locals(),
         context_instance=RequestContext(request))
 
index 361fd53..6badff0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 361fd53b42fae8bafe8fd680a0c697757aa19cf3
+Subproject commit 6badff0808ac498cca8f405d047316940aac8a03
index 5435951..ac80daf 100644 (file)
@@ -221,6 +221,7 @@ COMPRESS_CSS = {
     'player': {
         'source_filenames': [
             'jplayer/jplayer.blue.monday.css', 
+            'css/player.css', 
         ],
         'output_filename': 'css/player.min?.css',
     },
index c23547b..74338f8 100755 (executable)
        margin: 0;
 }
 .inline-body li {
-       display: inline;
+       display: inline-block;
        margin-right: 1em;
 }
 
index cdb74f8..ef47897 100755 (executable)
@@ -41,6 +41,7 @@
 #logo a {
     color:#f7f7f7;
     font-size: 2.05em;
+    text-shadow: 0 0 10px #17CFDB;
 }
 
 #tagline {
index e52a283..bc8e68f 100755 (executable)
@@ -80,6 +80,9 @@
     line-height: 1.45em;
 }
 
+.infopages-box li {
+       margin-bottom: .25em;
+}
 
 .infopages-box .social-links {
     margin-top: 1em;
diff --git a/wolnelektury/static/css/player.css b/wolnelektury/static/css/player.css
new file mode 100644 (file)
index 0000000..c449803
--- /dev/null
@@ -0,0 +1,17 @@
+#player h1 {
+       font-size: 2em;
+       margin: .5em;
+}
+
+.player-info {
+       margin: 1em;
+}
+
+
+.play {
+       cursor: pointer;
+}
+
+.play:hover {
+       color: #0D7E85;
+}
diff --git a/wolnelektury/static/img/logo-220.png b/wolnelektury/static/img/logo-220.png
new file mode 100644 (file)
index 0000000..9b15e88
Binary files /dev/null and b/wolnelektury/static/img/logo-220.png differ
index 3cef6fa..f8b314b 100644 (file)
@@ -379,7 +379,7 @@ div.jp-playlist ul {
        list-style-type:none;\r
        margin:0;\r
        padding:0 20px;\r
-       font-size:.72em;\r
+       font-size:.8em;\r
 }\r
 \r
 div.jp-title li {\r
@@ -411,10 +411,10 @@ div.jp-type-playlist div.jp-playlist a {
        text-decoration: none;\r
 }\r
 div.jp-type-playlist div.jp-playlist a:hover {\r
-       color:#0d88c1;\r
+       color:#0D7E85;\r
 }\r
 div.jp-type-playlist div.jp-playlist a.jp-playlist-current {\r
-       color:#0d88c1;\r
+       color:#0D7E85;\r
 }\r
 \r
 div.jp-type-playlist div.jp-playlist a.jp-playlist-item-remove {\r
@@ -426,7 +426,7 @@ div.jp-type-playlist div.jp-playlist a.jp-playlist-item-remove {
        color:#666;\r
 }\r
 div.jp-type-playlist div.jp-playlist a.jp-playlist-item-remove:hover {\r
-       color:#0d88c1;\r
+       color:#0D7E85;\r
 }\r
 div.jp-type-playlist div.jp-playlist span.jp-free-media {\r
        float:right;\r
@@ -438,7 +438,7 @@ div.jp-type-playlist div.jp-playlist span.jp-free-media a{
        color:#565656;\r
 }\r
 div.jp-type-playlist div.jp-playlist span.jp-free-media a:hover{\r
-       color:#0d88c1;\r
+       color:#0D7E85;\r
 }\r
 span.jp-artist {\r
        font-size:.8em;\r
index 7c02f03..33026ac 100755 (executable)
@@ -101,7 +101,7 @@ $('.open-player').click(function(event) {
     event.preventDefault();
     window.open($(this).attr('href'),
         'player',
-        'width=420, height=500'
+        'width=422, height=500'
         );
 });
 
index d794cd9..427f899 100644 (file)
@@ -1,5 +1,6 @@
 {% extends "catalogue/book_list.html" %}
 {% load i18n %}
+{% load catalogue_tags %}
 
 {% block bodyid %}book-a-list{% endblock %}
 
 Możecie z niej korzystać bezpłatnie i bez ograniczeń.
 Audiobooki nagrywają znani aktorzy, wśród nich Danuta Stenka i Jan Peszek.{% endblocktrans %}</p>
 {% endblock %}
+
+
+{% block book_list %}
+    {% audiobook_tree orphans books_by_parent %}
+    {% for author, group in books_by_author.items %}
+        {% if group %}
+            <a name="{{ author.slug }}"></a>
+            <div class="group">
+                <h2><a href="{{ author.get_absolute_url }}">{{ author }}</a></h2>
+                {% audiobook_tree group books_by_parent %}
+            </div>
+        {% endif %}
+    {% endfor %}
+{% endblock %}
index 318f1b4..a32f60f 100644 (file)
@@ -15,7 +15,7 @@
 
     <div style='clear:both;'></div>
 
-    <a name="top">
+    <a name="top"></a>
 
     <div id="book-list-nav" class="normal-text">
         {% trans "Table of Content" %}
@@ -35,7 +35,7 @@
         {% book_tree orphans books_by_parent %}
         {% for author, group in books_by_author.items %}
             {% if group %}
-                <a name="{{ author.slug }}">
+                <a name="{{ author.slug }}"></a>
                 <div class="group">
                     <h2><a href="{{ author.get_absolute_url }}">{{ author }}</a></h2>
                     {% book_tree group books_by_parent %}
index 6754ac6..cef76f8 100644 (file)
@@ -47,9 +47,7 @@
             </ul>
         </div>
         <div id="header">
-            <div id="logo">
-                <a href="/">Wolne Lektury</a>
-            </div>
+            <a href="/"><img src="{{ STATIC_URL }}img/logo-220.png" alt="Wolne Lektury" /></a>
         </div>
         <div id="themes">
             <ol>
index 99d8515..1a90b5c 100644 (file)
@@ -5,27 +5,27 @@
        <li class="hidden-box-wrapper menu">
                <a href="{% url catalogue %}#autorzy" class="hidden-box-trigger menu">
                        <span class='mono'>{% trans "Authors" %}</span></a>
-               <div class="hidden-box">{% tag_list author %}</div>
+               <div class="hidden-box">{% if author %}{% tag_list author %}{% endif %}</div>
        </li>
        <li class="hidden-box-wrapper menu">
                <a href="{% url catalogue %}#gatunki" class="hidden-box-trigger menu">
                        <span class='mono'>{% trans "Genres" %}</span></a>
-               <div class="hidden-box">{% tag_list genre %}</div>
+               <div class="hidden-box">{% if genre %}{% tag_list genre %}{% endif %}</div>
        </li>
        <li class="hidden-box-wrapper menu">
                <a href="{% url catalogue %}#rodzaje" class="hidden-box-trigger menu">
                        <span class='mono'>{% trans "Kinds" %}</span></a>
-               <div class="hidden-box">{% tag_list kind %}</div>
+               <div class="hidden-box">{% if kind %}{% tag_list kind %}{% endif %}</div>
        </li>
        <li class="hidden-box-wrapper menu">
                <a href="{% url catalogue %}#epoki" class="hidden-box-trigger menu">
                        <span class='mono'>{% trans "Epochs" %}</span></a>
-               <div class="hidden-box">{% tag_list epoch %}</div>
+               <div class="hidden-box">{% if epoch %}{% tag_list epoch %}{% endif %}</div>
        </li>
        <li class="hidden-box-wrapper menu">
                <a href="{% url catalogue %}#motywy" class="hidden-box-trigger menu">
                        <span class='mono'>{% trans "Themes" %}</span></a>
-               <div class="hidden-box">{% tag_list theme %}</div>
+               <div class="hidden-box">{% if theme %}{% tag_list theme %}{% endif %}</div>
        </li>
        <li class="menu">
                <a href="{% url book_list %}" class="menu">
index d38b53f..155d14e 100755 (executable)
@@ -1,6 +1,8 @@
 <!DOCTYPE html>
 <html>
     {% load i18n compressed %}
+    {% load catalogue_tags %}
+    {% load thumbnail %}
     <head>
         <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
         <meta name="description" 
     </head>
     <body id="{% block bodyid %}player{% endblock %}">
 
+               {% if book.cover %}
+            <img src="
+                {% thumbnail book.cover "101x140" as thumb %}
+                    {{ thumb.url }}
+                {% empty %}
+                    {{ book.cover.url }}
+                {% endthumbnail %}
+            " alt="Cover" style="float: left; margin: .5em 1em 1em 1em;" />
+        {% endif %}
+       
+
+<h1>{% book_title book %}</h1>
+
+<div class="player-info normal-text">
+       <p><a target="_blank" href="{{ book.get_absolute_url }}">{% trans "Book's page" %}</a>.</p>
+       <p>{% trans "Download as" %}
+        <a href="{% url download_zip_mp3 book.slug %}">MP3</a>{% if have_oggs %},
+            <a href="{% url download_zip_ogg book.slug %}">Ogg Vorbis</a>{% endif %}.
+    </p>
 
+    {% if book.has_daisy_file %}
+        <p>DAISY:</p>
+        <ul class="daisy-list">
+        {% for media in book.get_daisy %}
+            <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
+        {% endfor %}
+        </ul>
+    {% endif %}
+</div>
 
+<div style="clear: both"></div>
 
 <div class="jp-type-playlist">
   <div id="jplayer" class="jp-jplayer"
               (<a class='mp3' href='{{ i.mp3.file.url }}'>mp3</a>{% if i.ogg %}
               | <a class='ogg' href='{{ i.ogg.file.url }}'>ogg</a>{% endif %})
             </span>
-            <span class='play'>{{ i.mp3.name }}</span>
+            <div class='play'>{{ i.mp3.name }}
             <div class='extra-info'>
               {% trans "Artist" %}: <span class='artist'>{{ i.mp3.get_extra_info_value.artist_name }}</span>,
               {% trans "Director" %}: <span class='director'>{{ i.mp3.get_extra_info_value.director_name }}</span>
             </div>
+            </div>
           </li>
         {% endfor %}
 
 </div>
 
 
-    <p>{% trans "Download as" %}:
-        <a href="{% url download_zip_mp3 book.slug %}">MP3</a>{% if have_oggs %},
-            <a href="{% url download_zip_ogg book.slug %}">Ogg Vorbis</a>{% endif %}.
-    </p>
-
-
-        {% if book.has_daisy_file %}
-            <p>DAISY:</p>
-            <ul class="audiobook-list" id="daisy-files">
-            {% for media in book.get_daisy %}
-                <li><a href="{{ media.file.url }}">{{ media.name }}</a></li>
-            {% endfor %}
-            </ul>
-        {% endif %}
-
-
         {% if projects|length > 1 %}
             <p>{% trans "Audiobooks were prepared as a part of the projects:" %}</p>
             <ul>
         {% endif %}
 
 
-
-
-
-
-
-
-
-        <div class="clearboth"></div>
-
-
-
-
-
         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
         {% compressed_js "player" %}
 
index 361ec37..c262479 100755 (executable)
@@ -19,7 +19,7 @@ from ajaxable.utils import placeholdized
 
 @never_cache
 def main_page(request):
-    last_published = Book.objects.exclude(html_file='').order_by('-created_at')[:4]
+    last_published = Book.objects.filter(parent=None).order_by('-created_at')[:4]
 
     return render_to_response("main_page.html", locals(),
         context_instance=RequestContext(request))