From: Guillaume Pellerin Date: Thu, 28 May 2015 15:33:42 +0000 (+0200) Subject: no epub title in single mode X-Git-Tag: 1.6a~4^2~41 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=315eab8b17ccfac0e0d9a833a68a0669c18266e5;p=telemeta.git no epub title in single mode --- diff --git a/telemeta/templates/telemeta/inc/epub_collection.html b/telemeta/templates/telemeta/inc/epub_collection.html index 4f0cbf01..d2accf60 100644 --- a/telemeta/templates/telemeta/inc/epub_collection.html +++ b/telemeta/templates/telemeta/inc/epub_collection.html @@ -1,7 +1,9 @@ +{% if not mode_single %}

{{ title }}

{{ subtitle }}

+{% endif %} {% for item in items %}
diff --git a/telemeta/views/epub.py b/telemeta/views/epub.py index 2537351c..93d81f96 100644 --- a/telemeta/views/epub.py +++ b/telemeta/views/epub.py @@ -90,18 +90,17 @@ class BaseEpubMixin(TelemetaBaseMixin): self.book.set_cover(filename, open(media.file.path, 'r').read()) break - context = {} + context = {'mode_single': mode_single} preamble = epub.EpubHtml(title='Preamble', file_name='preamble' + '.xhtml', lang='fr') preamble.content = render_to_string(self.template_preamble, context) preamble.is_chapter = False + default_image_added = False + default_image_relative_path = '' self.book.add_item(preamble) self.chapters.append(preamble) for collection in self.collections: items = {} - default_image_added = False - default_image_relative_path = '' - for item in collection.items.all(): if '.' in item.old_code: id = item.old_code.split('.')[1]