Skip to content
Snippets Groups Projects
Commit e42830ac authored by Andreas Nüßlein's avatar Andreas Nüßlein
Browse files

change "practices drafted" to "practices published"

parent 2bd352d0
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@
<hr>
<li class="home-keynumbers-list-item">
<span class="keynumber-text">
{% blocktrans with questionnaires_count='<span class="keynumber">'|addstr:created|addstr:'</span>'|safe %}{{ questionnaires_count }} new practices drafted in the past {{ days }} days.{% endblocktrans %}
{% blocktrans with questionnaires_count='<span class="keynumber">'|addstr:new_practices_published|addstr:'</span>'|safe %}{{ questionnaires_count }} new practices published in the past {{ days }} days.{% endblocktrans %}
</span>
</li>
</ul>
......@@ -58,17 +58,6 @@ class FactsTeaserView(TemplateView):
date_to = timezone.now()
date_launch = "2016-08-01"
@property
def date_from(self):
return timezone.now() - timedelta(days=self.start_date_offset_days)
# @method_decorator(cache_page(60 * 60))
def dispatch(self, request, *args, **kwargs):
"""
This page will take some time to load - cache it.
"""
return super().dispatch(request, *args, **kwargs)
def get_questionnaire_facts(self):
"""
Get data about questionnaires.
......@@ -84,8 +73,12 @@ class FactsTeaserView(TemplateView):
"unccd": Questionnaire.with_status.public()
.filter(code__startswith="unccd")
.count(),
"created": Questionnaire.with_status.not_deleted()
.filter(created__gte=self.date_from)
"new_practices_published": Questionnaire.with_status.public()
.filter(
created__gte=(
timezone.now() - timedelta(days=self.start_date_offset_days)
)
)
.count(),
"countries": len(
set(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment