X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae60b2a3949e96357477cc04f90fd0873cee8a92..9ce7b544a0616db407be602ea453771fc9c0a6dd:/src/funding/templatetags/funding_tags.py diff --git a/src/funding/templatetags/funding_tags.py b/src/funding/templatetags/funding_tags.py index 5dbeec6eb..851e0ce1e 100755 --- a/src/funding/templatetags/funding_tags.py +++ b/src/funding/templatetags/funding_tags.py @@ -5,16 +5,23 @@ from django import template from ssify import ssi_variable from ssify.utils import ssi_cache_control + from ..models import Offer from ..utils import sanitize_payment_title +from ..views import offer_bar register = template.Library() @ssi_variable(register, patch_response=[ssi_cache_control(must_revalidate=True, max_age=0)]) -def current_offer(request): +def current_offer(request=None): offer = Offer.current() return offer.pk if offer is not None else None +@register.inclusion_tag('funding/includes/funding.html') +def funding_top_bar(): + return offer_bar(Offer.current(), link=True, closeable=True, add_class="funding-top-header") + + register.filter(sanitize_payment_title)