From: Jan Szejko Date: Wed, 8 Mar 2017 10:17:40 +0000 (+0100) Subject: publisher info in html X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/46607e78e344a6c5695c383265fd441b87dbe40c?ds=inline;hp=063d22a8861972ce34ac079d0b2a1fb7d7156966 publisher info in html --- 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:" %}