From: Radek Czajka Date: Thu, 20 Jun 2013 12:53:36 +0000 (+0200) Subject: auto-count on main X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/6c7e3b7d082affb3d779049d5311eb5775de65dd?ds=sidebyside;hp=5d8a65f12464816813e1b03837d65af1580c6fe5 auto-count on main --- diff --git a/catalogue/templates/catalogue/snippets/carousel.html b/catalogue/templates/catalogue/snippets/carousel.html index 75a3b2c..82984cf 100755 --- a/catalogue/templates/catalogue/snippets/carousel.html +++ b/catalogue/templates/catalogue/snippets/carousel.html @@ -6,7 +6,8 @@
  • diff --git a/catalogue/templatetags/catalogue_tags.py b/catalogue/templatetags/catalogue_tags.py index 32a5a0b..7003dfe 100755 --- a/catalogue/templatetags/catalogue_tags.py +++ b/catalogue/templatetags/catalogue_tags.py @@ -8,8 +8,12 @@ register = template.Library() @register.inclusion_tag("catalogue/snippets/carousel.html") def catalogue_carousel(): - return { - } + lessons_count = Lesson.objects.filter(type__in=('course', 'synthetic')).count() + if 1 < lessons_count % 10 < 5 and lessons_count / 10 % 10 != 1: + lessons_desc = u'kompletne lekcje' + else: + lessons_desc = u'kompletnych lekcji' + return locals() @register.inclusion_tag("catalogue/snippets/section_buttons.html") def catalogue_section_buttons():