fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
edit buttons
[wolnelektury.git]
/
src
/
catalogue
/
templatetags
/
catalogue_tags.py
diff --git
a/src/catalogue/templatetags/catalogue_tags.py
b/src/catalogue/templatetags/catalogue_tags.py
index
93950d7
..
f4f121d
100644
(file)
--- a/
src/catalogue/templatetags/catalogue_tags.py
+++ b/
src/catalogue/templatetags/catalogue_tags.py
@@
-528,3
+528,12
@@
def content_warning(book):
return {
"warnings": warnings
}
return {
"warnings": warnings
}
+
+
+@register.inclusion_tag('catalogue/preview_ad.html', takes_context=True)
+def preview_ad(context):
+ book = Book.objects.filter(preview=True).first()
+ return {
+ 'accessible': book.is_accessible_to(context['request'].user),
+ 'book': book,
+ }