diff --git a/com/templates/com/news_list.jinja b/com/templates/com/news_list.jinja index d3e3016b..7c2ec629 100644 --- a/com/templates/com/news_list.jinja +++ b/com/templates/com/news_list.jinja @@ -42,6 +42,8 @@
{% trans %}Birthdays{% endtrans %}
{% if user.is_subscribed %} + {# Cache request for 1 hour #} + {% cache 3600 birthdays %} + {% endcache %} {% else %}

{% trans %}You need an up to date subscription to access this content{% endtrans %}

{% endif %} diff --git a/core/migrations/0032_auto_20190909_0043.py b/core/migrations/0032_auto_20190909_0043.py new file mode 100644 index 00000000..35671cc0 --- /dev/null +++ b/core/migrations/0032_auto_20190909_0043.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.24 on 2019-09-08 22:43 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [("core", "0031_auto_20190906_1615")] + + operations = [ + migrations.AlterField( + model_name="notification", + name="viewed", + field=models.BooleanField( + db_index=True, default=False, verbose_name="viewed" + ), + ) + ] diff --git a/core/models.py b/core/models.py index f873e785..d27a2f79 100644 --- a/core/models.py +++ b/core/models.py @@ -1393,7 +1393,7 @@ class Notification(models.Model): _("type"), max_length=32, choices=settings.SITH_NOTIFICATIONS, default="GENERIC" ) date = models.DateTimeField(_("date"), default=timezone.now) - viewed = models.BooleanField(_("viewed"), default=False) + viewed = models.BooleanField(_("viewed"), default=False, db_index=True) def __str__(self): if self.param: diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 9d0e53cc..43d2a058 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -60,21 +60,23 @@
+ {% cache 100 counters_activity %} + {% for bar in Counter.objects.filter(type="BAR").all() %} +
  • + + {% if bar.is_inactive(): %} + + {% elif bar.is_open(): %} + + {% else %} + + {% endif %} + {{ bar }} + +
  • + {% endfor %} + + {% endcache %}