{# Ënnstatus Copyright (C) 2015 Dennis Fink This program 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. This program 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 this program. If not, see . #} {% macro colorize_numbers(number) %} {% if number.startswith('-') %} {% set color = "text-danger" %} {% else %} {% if not number.startswith('+') %} {% set number = ''.join(['+', number]) %} {% endif %} {% set color = "text-success" %} {% endif %} {{ number }} {% endmacro %} {% macro create_donations_table(csv_file, total) %}
{% for row in csv_file %} {% endfor %}
# Date Statement Amount
{{ loop.index }} {{ row[0] }} {{ row[1] }} {{ colorize_numbers(row[2]) }}
Total: {{ colorize_numbers(total) }}
{% endmacro %}