some css tweaks to download popup and logo/tagline shifted right a bit
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 28 Dec 2011 15:55:55 +0000 (16:55 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 28 Dec 2011 15:55:55 +0000 (16:55 +0100)
apps/catalogue/models.py
wolnelektury/static/css/base.css
wolnelektury/static/css/book_box.css
wolnelektury/static/css/header.css
wolnelektury/templates/catalogue/book_short.html

index 2effb3b..e4cd8c4 100644 (file)
@@ -510,16 +510,12 @@ class Book(models.Model):
             tags = self.tags.filter(category__in=('author', 'kind', 'genre', 'epoch'))
             tags = split_tags(tags)
 
-            formats = []
+            formats = {}
             # files generated during publication
             for ebook_format in self.ebook_formats:
                 if self.has_media(ebook_format):
-                    formats.append(u'<a href="%s">%s</a>' % (
-                        self.get_media(ebook_format).url,
-                        ebook_format.upper()
-                    ))
+                    formats[ebook_format] = self.get_media(ebook_format)
 
-            formats = [mark_safe(format) for format in formats]
 
             short_html = unicode(render_to_string('catalogue/book_short.html',
                 {'book': self, 'tags': tags, 'formats': formats}))
index f55a39e..dd686c7 100755 (executable)
@@ -90,6 +90,7 @@ h2 {
     -moz-box-shadow: 2px 2px 2px #ddd;
     -webkit-box-shadow: 2px 2px 2px #ddd;
     box-shadow: 2px 2px 2px #ddd;
+    z-index: 2;
 }
 #themes-list ul {
     list-style: none;
index ca2e726..b517502 100755 (executable)
 .book-box-download {
     position: relative;
 }
+
+.book-box-download a {
+    position: relative;
+    z-index: 1;
+}
+
 .book-box-formats {
     display: none;
     position: absolute;
 
+    width: 16.363em;
     border: 1px solid #ddd;
-    padding: .8em 1em;
+    padding: 3.454em 1.727em .818em 1.727em;
     background: #fff;
     -moz-box-shadow: 2px 2px 2px #ddd;
     -webkit-box-shadow: 2px 2px 2px #ddd;
     box-shadow: 2px 2px 2px #ddd;
-    
+
+    z-index: 0;
+    top: -1.454em;
+    left: -1.727em;
 }
-.book-box-formats a {
+.book-box-formats span {
     display: block;
 }
+
+.book-box-download:hover .book-box-formats:first {
+    margin-top: 1.454em;
+}
+
 .book-box-download:hover .book-box-formats {
     display: block;
 }
 .book-box-tools {
     font-size: 1.1em;
 }
-.book-box-tools a:before {
+.book-box-tools a.downarrow:before {
     content: "⇩";
     font-family: WL-Nav;
     font-size: 2em;
index 79e8815..8615d8b 100755 (executable)
@@ -37,8 +37,8 @@
 
 #logo {
     position: absolute;
-    top: 1.9em;
-    margin-left: 1.6em;
+    top: 5.5em;
+    margin-left: 1.5em;
 }
 
 #logo a {
@@ -49,7 +49,7 @@
 
 #tagline {
     display: inline-block;
-    margin-left: 24em;
+    margin-left: 25.5em;
 }
 #tagline span {
     font-size: 1.1em;
index c80efff..8ac23a3 100644 (file)
     <ul class="book-box-tools">
         <li class="book-box-read">
         {% if book.html_file %}
-            <a href="{% url book_text book.urlid %}" class="mono">{% trans "Read online" %}</a>
+            <a href="{% url book_text book.urlid %}" class="mono downarrow">{% trans "Read online" %}</a>
         {% endif %}
         </li>
         <li class="book-box-download">
-            <a class="mono">{% trans "Download" %}</a>
+            <a class="mono downarrow">{% trans "Download" %}</a>
             <div class="book-box-formats mono">
-                {{ formats|join:"" }}
+             {% if formats.pdf %}
+             <span><a href="{{formats.pdf.url}}">PDF</a> do wydruku</span>
+             {% endif %}
+             {% if formats.epub %}
+             <span><a href="{{formats.epub.url}}">EPUB</a> na czytnik</span>
+             {% endif %}
+             {% if formats.mobi %}
+             <span><a href="{{formats.mobi.url}}">MOBI</a> na Kindle</span>
+             {% endif %}
+             {% if formats.txt %}
+             <span><a href="{{formats.txt.url}}">TXT</a> do zadań specjalnych</span>
+             {% endif %}
             </div>
         </li>
         <li class="book-box-audiobook">
         {% if book.has_mp3_file %}
-            <a href="" class="mono">{% trans "Audiobook" %}</a>
+            <a href="" class="mono downarrow">{% trans "Audiobook" %}</a>
         {% endif %}
         </li>
     </ul>