publisher info in html
authorJan Szejko <janek37@gmail.com>
Wed, 8 Mar 2017 10:17:40 +0000 (11:17 +0100)
committerJan Szejko <janek37@gmail.com>
Wed, 8 Mar 2017 10:17:40 +0000 (11:17 +0100)
src/catalogue/models/book.py
src/catalogue/templates/catalogue/book_info.html

index f9f6ac3..c537e5d 100644 (file)
@@ -500,6 +500,13 @@ class Book(models.Model):
             names = [tag[0] for tag in names]
         return ', '.join(names)
 
+    def publisher(self):
+        publisher = self.extra_info['publisher']
+        if isinstance(publisher, basestring):
+            return publisher
+        elif isinstance(publisher, list):
+            return ', '.join(publisher)
+
     @classmethod
     def tagged_top_level(cls, tags):
         """ Returns top-level books tagged with `tags`.
index 5b67ad6..9489761 100755 (executable)
   </p>
 {% endif %}
 
+{% if book.extra_info.publisher %}
+  <p>
+    {% trans "Publisher:" %}
+    {{ book.publisher }}
+  </p>
+{% endif %}
+
 {% if book.extra_info.funders %}
   <p>
     {% trans "Publication funded by:" %}