Permalink
Browse files

Remove coloring in traffic table

  • Loading branch information...
lukasjuhrich committed Jan 29, 2019
1 parent c601750 commit 6ea95b9cd84df0f01e8cca49704dea822bd2875d
Showing with 1 addition and 10 deletions.
  1. +0 −9 sipa/blueprints/generic.py
  2. +1 −1 sipa/templates/_traffic.html
@@ -180,15 +180,6 @@ def logout():
bp_generic.add_app_template_filter(dynamic_unit, name='unit')


@bp_generic.app_template_filter('traffic_color')
def traffic_color(amount):
# TODO think about other thresholds replacing `User.daily_credit`
daily_credit = 10 * 1024 * 1024
return ("" if amount < daily_credit
else "bg-warning" if amount < 2 * daily_credit
else "bg-danger")


@bp_generic.app_template_filter('gib')
def to_gigabytes(number):
"""Convert a number from KiB to GiB
@@ -17,7 +17,7 @@ <h3 id="traffic-table">{{ _('Traffic Tabelle') }}</h3>
<td>{{ get_weekday(day['day']) }}</td>
<td>{{ day['input'] | unit }}</td>
<td>{{ day['output'] | unit }}</td>
<td class="{{ day['throughput'] | traffic_color }}">
<td class="{{ day['throughput'] }}">
{{ day['throughput'] | unit }}
</td>
</tr>

0 comments on commit 6ea95b9

Please sign in to comment.