Fixes #925 (xml source link on book's page).
authorLukasz Anwajler <lukasz@anwajler.com>
Mon, 22 Nov 2010 20:17:38 +0000 (14:17 -0600)
committerLukasz Anwajler <lukasz@anwajler.com>
Mon, 22 Nov 2010 20:17:38 +0000 (14:17 -0600)
Minor fix: non-standard (mp3, ogg, odt, daisy) media for book are not required anymore in admin.

apps/catalogue/models.py
wolnelektury/templates/catalogue/book_detail.html

index f811461..98e37c1 100644 (file)
@@ -208,7 +208,7 @@ class Book(models.Model):
     epub_file     = models.FileField(_('EPUB file'), upload_to=book_upload_path('epub'), blank=True)    
     txt_file      = models.FileField(_('TXT file'), upload_to=book_upload_path('txt'), blank=True)        
     # other files
-    medias        = models.ManyToManyField(BookMedia)
+    medias        = models.ManyToManyField(BookMedia, blank=True)
     
     parent        = models.ForeignKey('self', blank=True, null=True, related_name='children')
     objects  = models.Manager()
index 676cc0b..ffb586b 100644 (file)
                     <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
                     {% endfor %}
                 </li>
+                <li>
+                    <a href="{{ book.xml_file.url }}">{% trans "View XML source" %}</a>
+                </li>                
             </ul>
             <h2>{% trans "Other resources" %}</h2>
             <ul>