]> git.parisson.com Git - telemeta.git/commitdiff
no epub title in single mode
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 28 May 2015 15:33:42 +0000 (17:33 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 28 May 2015 15:33:42 +0000 (17:33 +0200)
telemeta/templates/telemeta/inc/epub_collection.html
telemeta/views/epub.py

index 4f0cbf01396a8d4ed54511be7acde231b06bee5d..d2accf60f9b2b54a629116a628638394d21fc1e8 100644 (file)
@@ -1,7 +1,9 @@
 <link rel="stylesheet" type="text/css" href="style/epub.css" />
 
+{% if not mode_single %}
 <h2>{{ title }}</h2>
 <h3>{{ subtitle }}</h3>
+{% endif %}
 
 {% for item in items %}
 <div class="item">
index 2537351c88de90f7fa5564fd20ba226712c06852..93d81f96ae6ca840cc7c139125f8ec137596ddeb 100644 (file)
@@ -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]