merge player changes and detail page + search
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 29 Dec 2011 16:17:54 +0000 (17:17 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 29 Dec 2011 16:17:54 +0000 (17:17 +0100)
Conflicts:
wolnelektury/static/css/base.css
wolnelektury/static/css/book_box.css
wolnelektury/templates/catalogue/book_short.html

1  2 
apps/catalogue/models.py
apps/catalogue/urls.py
wolnelektury/settings.py
wolnelektury/static/css/base.css
wolnelektury/static/css/book_box.css
wolnelektury/static/css/header.css
wolnelektury/templates/catalogue/book_short.html
wolnelektury/urls.py

@@@ -721,25 -723,12 +721,25 @@@ class Book(models.Model)
                      getattr(settings, "ALL_%s_ZIP" % format_.upper()))
          return result.wait()
  
-     def zip_audiobooks(self):
-         bm = BookMedia.objects.filter(book=self, type='mp3')
+     def zip_audiobooks(self, format_):
+         bm = BookMedia.objects.filter(book=self, type=format_)
          paths = map(lambda bm: (None, bm.file.path), bm)
-         result = create_zip.delay(paths, self.fileid())
+         result = create_zip.delay(paths, "%s_%s" % (self.fileid(), format_))
          return result.wait()
  
 +    def search_index(self, book_info=None):
 +        if settings.CELERY_ALWAYS_EAGER:
 +            idx = search.ReusableIndex()
 +        else:
 +            idx = search.Index()
 +            
 +        idx.open()
 +        try:
 +            idx.index_book(self, book_info)
 +            idx.index_tags()
 +        finally:
 +            idx.close()
 +
      @classmethod
      def from_xml_file(cls, xml_file, **kwargs):
          from django.core.files import File
@@@ -26,13 -26,14 +26,14 @@@ urlpatterns = patterns('picture.views'
      url(r'^polki/nowa/$', 'new_set', name='new_set'),
      url(r'^tags/$', 'tags_starting_with', name='hint'),
      url(r'^jtags/$', 'json_tags_starting_with', name='jhint'),
 -    url(r'^szukaj/$', 'search', name='search'),
 +    url(r'^szukaj/$', 'search', name='old_search'),
  
      # zip
-     #url(r'^zip/pdf\.zip$', 'download_zip', {'format': 'pdf', 'slug': None}, 'download_zip_pdf'),
-     #url(r'^zip/epub\.zip$', 'download_zip', {'format': 'epub', 'slug': None}, 'download_zip_epub'),
-     #url(r'^zip/mobi\.zip$', 'download_zip', {'format': 'mobi', 'slug': None}, 'download_zip_mobi'),
-     #url(r'^zip/audiobook/(?P<book>%s)\.zip' % Book.FILEID_RE, 'download_zip', {'format': 'audiobook'}, 'download_zip_audiobook'),
+     url(r'^zip/pdf\.zip$', 'download_zip', {'format': 'pdf', 'slug': None}, 'download_zip_pdf'),
+     url(r'^zip/epub\.zip$', 'download_zip', {'format': 'epub', 'slug': None}, 'download_zip_epub'),
+     url(r'^zip/mobi\.zip$', 'download_zip', {'format': 'mobi', 'slug': None}, 'download_zip_mobi'),
+     url(r'^zip/mp3/(?P<book>%s)\.zip' % Book.FILEID_RE, 'download_zip', {'format': 'mp3'}, 'download_zip_mp3'),
+     url(r'^zip/ogg/(?P<book>%s)\.zip' % Book.FILEID_RE, 'download_zip', {'format': 'ogg'}, 'download_zip_ogg'),
  
      # Public interface. Do not change this URLs.
      url(r'^lektura/(?P<book>%s)\.html$' % Book.FILEID_RE, 'book_text', name='book_text'),
Simple merge
Simple merge
  .book-box-tools {
      font-size: 1.1em;
  }
 -.book-box-read a:before {
++
 +.book-box-tools a.downarrow:before {
-     content: "⇩";
+     content: "\2609";
+     font-family: WL-Nav;
+     font-size: 2.25em;
+     margin-right: .15em;
+     vertical-align: middle;
+ }
 -.book-box-download a:before {
 -    content: "⇩";
 -    font-family: WL-Nav;
 -    font-size: 2.25em;
 -    margin-right: .15em;
 -    vertical-align: middle;
 -}
++
+ .book-box-audiobook a:before {
+     content: "\266B";
      font-family: WL-Nav;
-     font-size: 2em;
-     margin-right: .25em;
+     font-size: 2.25em;
+     margin-right: .15em;
      vertical-align: middle;
  }
 +
 +ul.book-box-tools {
 +    margin: 0;
 +    padding: 0;
 +}
 +
 +.book-box-tools li {
 +    display: inline-block;
 +}
 +
  .book-box-read {
-     width: 11em;
+     width: 11.5em;
  }
  .book-box-download {
-     width: 8em;
+     width: 8.5em;
  }
  .book-box-audiobook {
-     width: 8em;
+     width: 7em;
  }
 +
 +.book-wide-box .right-column {
 +    float: right;
 +    width: 41.5em;
 +}
 +
 +.book-wide-box blockquote.cite-body {
 +    /* @ 18pt */
 +    width: 100%; /*23.055em;*/
 +    height: 7.222em;
 +    background-color: #f7f7f7;
 +    margin: 0;
 +    position: relative;
 +    top: -0.444em;
 +    right: -0.555em;
 +    vertical-align: center;
 +}
 +
 +.book-wide-box blockquote div {
 +    padding: 0.888em;
 +}
 +
 +.book-wide-box #other-tools {
 +    float: left;
 +    width: 14.5em;
 +    margin-left: 1.5em;
 +    
 +}
 +
 +
 +.book-wide-box #other-download {
 +    float: left;
 +    width 22.5em;
 +    margin: 0em 1.5em 0em 1.5em
 +}
Simple merge
@@@ -73,7 -60,7 +73,7 @@@
          </li>
          <li class="book-box-audiobook">
          {% if book.has_mp3_file %}
-             <a href="" class="mono downarrow">{% trans "Audiobook" %}</a>
 -            <a href="{% url book_player book.slug %}" class="open-player mono">{% trans "Listen" %}</a>
++            <a href="{% url book_player book.slug %}" class="open-player mono downarrow">{% trans "Listen" %}</a>
          {% endif %}
          </li>
      </ul>
Simple merge