{# Copyright 2017 Hermann Krumrey This file is part of bundesliga-tippspiel. bundesliga-tippspiel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. bundesliga-tippspiel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with bundesliga-tippspiel. If not, see . #} {% set show_tendency = history is defined and (history.values()|list)[0][1]|length >= 2 %} {% for index, (user, points) in leaderboard %} {% set tendency_class = None %} {% if show_tendency %} {% set user_history = history[user.username][1] %} {% set tendency_class = "minus-circle" %} {% if user_history|length >= 2 %} {% set tendency = user_history[-2] - user_history[-1] %} {% if tendency < 0 %} {% set tendency_class = "chevron-circle-down" %} {% elif tendency > 0 %} {% set tendency_class = "chevron-circle-up" %} {% endif %} {% endif %} {% endif %} {% endfor %}
# Name {{ unit }}
{% if show_tendency %} {% endif %} {{ index + 1 }} {{ user.username }} {% if season_winners is defined %} {% for season, winner_id in season_winners.items() %} {% if winner_id == user.id %} {% endif %} {% endfor %} {% endif %} {{ points }}