From 46607e78e344a6c5695c383265fd441b87dbe40c Mon Sep 17 00:00:00 2001
From: Jan Szejko
Date: Wed, 8 Mar 2017 11:17:40 +0100
Subject: [PATCH] publisher info in html
---
src/catalogue/models/book.py | 7 +++++++
src/catalogue/templates/catalogue/book_info.html | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py
index f9f6ac345..c537e5d62 100644
--- a/src/catalogue/models/book.py
+++ b/src/catalogue/models/book.py
@@ -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`.
diff --git a/src/catalogue/templates/catalogue/book_info.html b/src/catalogue/templates/catalogue/book_info.html
index 5b67ad631..948976174 100755
--- a/src/catalogue/templates/catalogue/book_info.html
+++ b/src/catalogue/templates/catalogue/book_info.html
@@ -35,6 +35,13 @@
{% endif %}
+{% if book.extra_info.publisher %}
+
+ {% trans "Publisher:" %}
+ {{ book.publisher }}
+
+{% endif %}
+
{% if book.extra_info.funders %}
{% trans "Publication funded by:" %}
--
2.20.1