def get_description(self, wlbook, description_add=''):
description = ''
+
+ if wlbook.meta.audience in ('L', 'SP1', 'SP2', 'SP3', 'SP4'):
+ description += '<p><em>{}</em> to lektura szkolna.'.format(wlbook.meta.title)
+ if wlbook.tree.find('//pe') is not None:
+ description += '<br>Ebook <em>{title}</em> zawiera przypisy opracowane specjalnie dla uczennic i uczniów {school}.'.format(
+ title=wlbook.meta.title,
+ school='szkoły podstawowej' if wlbook.meta.audience.startswith('SP') else 'liceum i technikum'
+ )
+ description += '</p>\n'
+
abstract = wlbook.tree.find('.//abstrakt')
if abstract is not None:
- description = transform_abstrakt(abstract)
+ description += transform_abstrakt(abstract)
description += description_add
description += '<p>'
description += ', '.join(
for p in wlbook.meta.genres
) + '</p>'
- # TODO: Move away from using audiences for this.
- if wlbook.meta.audience in ('L', 'SP1', 'SP2', 'SP3', 'SP4'):
- description += '<p><em>{}</em> to lektura szkolna.'.format(wlbook.meta.title)
- if wlbook.tree.find('//pe') is not None:
- description += '<br>Ebook <em>{title}</em> zawiera przypisy opracowane specjalnie dla uczennic i uczniów {school}.'.format(
- title=wlbook.meta.title,
- school='szkoły podstawowej' if wlbook.meta.audience.startswith('SP') else 'liceum i technikum'
- )
- description += '</p>'
return description