From: Marcin Koziej Date: Thu, 29 Dec 2011 16:17:54 +0000 (+0100) Subject: merge player changes and detail page + search X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/075fb07f19c2f20cd3b6818b973e7aebebdacc9f?ds=inline merge player changes and detail page + search Conflicts: wolnelektury/static/css/base.css wolnelektury/static/css/book_box.css wolnelektury/templates/catalogue/book_short.html --- 075fb07f19c2f20cd3b6818b973e7aebebdacc9f diff --cc apps/catalogue/models.py index e4cd8c40e,112ec1b99..77efe6e98 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.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 diff --cc apps/catalogue/urls.py index fa472c970,241afca3a..4020592d2 --- a/apps/catalogue/urls.py +++ b/apps/catalogue/urls.py @@@ -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%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%s)\.zip' % Book.FILEID_RE, 'download_zip', {'format': 'mp3'}, 'download_zip_mp3'), + url(r'^zip/ogg/(?P%s)\.zip' % Book.FILEID_RE, 'download_zip', {'format': 'ogg'}, 'download_zip_ogg'), # Public interface. Do not change this URLs. url(r'^lektura/(?P%s)\.html$' % Book.FILEID_RE, 'book_text', name='book_text'), diff --cc wolnelektury/static/css/book_box.css index aa50e67f4,272f558b3..9b589dc52 --- a/wolnelektury/static/css/book_box.css +++ b/wolnelektury/static/css/book_box.css @@@ -129,64 -109,33 +129,73 @@@ .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 +} diff --cc wolnelektury/templates/catalogue/book_short.html index 5a9b17de9,5557126da..1c3a74253 --- a/wolnelektury/templates/catalogue/book_short.html +++ b/wolnelektury/templates/catalogue/book_short.html @@@ -73,7 -60,7 +73,7 @@@
  • {% if book.has_mp3_file %} - {% trans "Audiobook" %} - {% trans "Listen" %} ++ {% trans "Listen" %} {% endif %}