from django.urls import reverse
from django.utils.html import mark_safe
from django.utils.timezone import utc
-from django.utils.translation import ugettext_lazy as _, override
+from django.utils.translation import gettext_lazy as _, override
from catalogue.models import Book
from catalogue.utils import get_random_hash
from polls.models import Poll
def clear_cache(self):
clear_cached_renders(self.top_bar)
+ clear_cached_renders(self.top_bar_2022)
clear_cached_renders(self.list_bar)
clear_cached_renders(self.detail_bar)
+ clear_cached_renders(self.detail_bar_2022)
clear_cached_renders(self.status)
clear_cached_renders(self.status_more)
def status_more(self):
return {'offer': self}
+ @cached_render('funding/2022/includes/funding.html')
+ def top_bar_2022(self):
+ ctx = self.basic_info()
+ ctx.update({
+ 'link': True,
+ 'closeable': True,
+ 'add_class': 'funding-top-header',
+ })
+ return ctx
+
+ @cached_render('funding/2022/includes/funding.html')
+ def detail_bar_2022(self):
+ ctx = self.basic_info()
+ ctx.update({
+ 'show_title': False,
+ })
+ return ctx
+
class Perk(models.Model):
""" A perk offer.