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
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'),
.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
+}