1 from django import template
2 from ..models import Banner
3 from ..places import PLACES
6 register = template.Library()
9 @register.inclusion_tag('annoy/banner.html', takes_context=True)
10 def annoy_banner(context, place):
11 banners = Banner.choice(place, request=context['request'])
13 'banner': banners.first(),
14 'closable': PLACES.get(place, False),
18 @register.inclusion_tag('annoy/banners.html', takes_context=True)
19 def annoy_banners(context, place):
21 'banners': Banner.choice(place, request=context['request']),
22 'closable': PLACES.get(place, False),