{% macro user(list, index) %} {% if list[index] is defined %}{{ list[index].user_id|user_url }}{% else %} {% endif %} {% endmacro %} {% macro total(list, index) %} {% if list[index] is defined %}{{ list[index].total|number_format }}{% else %} {% endif %} {% endmacro %} {% macro accrual(d) %} {% if d is defined %}{{ d.total|number_format }}{% else %}—{% endif %} {% endmacro %} {% macro delta(interval, n) %} {% set p = n - 1 %} {% if interval[n] is defined and interval[p] is defined %}{{ (interval[p].total - interval[n].total)|number_format }} {% elseif interval[n] is defined %}{{ interval[n].total|number_format }} {% elseif interval[p] is defined %}{{ -interval[p].total|number_format }} {% else %}—{% endif %} {% endmacro %} {% set max = 6 %}
Interval | Current | {% for n in range(1, max) %}Δ n-{{ n }} | {% endfor %}
Day | {{ _self.accrual(day.0) }} | {% for n in range(1, max) %}{{ _self.delta(day, n) }} | {% endfor %}
Week | {{ _self.accrual(week.0) }} | {% for n in range(1, max) %}{{ _self.delta(week, n) }} | {% endfor %}
Month | {{ _self.accrual(month.0) }} | {% for n in range(1, max) %}{{ _self.delta(month, n) }} | {% endfor %}
Item | Last day | Last week | Last month | Last quarter | Last year | Total |
{{ i.title }} | {{ day[i.id].total|number_format }} | {{ week[i.id].total|number_format }} | {{ month[i.id].total|number_format }} | {{ quarter[i.id].total|number_format }} | {{ year[i.id].total|number_format }} | {{ i.total|number_format }} |
Hoarders | Spenders | Pool Contributors | Overall Spenders | ||||||
Points | User | Points | User | Points | User | Points | User | ||
{{ i + 1 }} | {{ _self.total(hoarders, i) }} | {{ _self.user(hoarders, i) }} | {{ _self.total(spenders, i) }} | {{ _self.user(spenders, i) }} | {{ _self.total(poolers, i) }} | {{ _self.user(poolers, i) }} | {{ _self.total(overall, i) }} | {{ _self.user(overall, i) }} | {{ i + 1 }} |