X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/f4fdb08e0b0ff0da9faed1ac5d89a1523cad7271..245ee64cc85bfc2c1a27c30139d9e7c1268168d9:/librarian/cover.py diff --git a/librarian/cover.py b/librarian/cover.py index 717d5f0..29e24c8 100644 --- a/librarian/cover.py +++ b/librarian/cover.py @@ -554,12 +554,38 @@ class KMLUCover(LogoWLCover): ] +class MPWCover(LogoWLCover): + gradient_logo_height = 58 + gradient_logo_spacing = 25 + gradient_logos = [ + 'res/mpw-logo-white.png', + 'res/wl-logo-white.png', + 'res/fnp-logo-white.png', + ] + + +class AtriumCover(LogoWLCover): + gradient_logo_height = 58 + gradient_logo_spacing = 25 + gradient_logos = [ + 'res/atrium-logo.png', + 'res/wl-logo-white.png', + 'res/fnp-logo-white.png', + ] + + COVER_CLASSES = { 'default': LogoWLCover, 'kmlu': KMLUCover, + 'mpw': MPWCover, + 'atrium': AtriumCover, } def make_cover(book_info, *args, **kwargs): - cover_class = COVER_CLASSES[book_info.cover_class] + if 'cover_class' in kwargs: + cover_class_name = kwargs.pop('cover_class') + else: + cover_class_name = book_info.cover_class + cover_class = COVER_CLASSES[cover_class_name] return cover_class(book_info, *args, **kwargs)