|
|
@@ -9,6 +9,7 @@ from graphos.renderers import gchart
|
|
9
|
9
|
from graphos.sources.simple import SimpleDataSource
|
|
10
|
10
|
from graphos.sources.model import ModelDataSource
|
|
11
|
11
|
import random
|
|
|
12
|
+import math
|
|
12
|
13
|
from django.utils import timezone
|
|
13
|
14
|
|
|
14
|
15
|
class resetCounterForm(forms.ModelForm):
|
|
|
@@ -43,7 +44,8 @@ def home(request):
|
|
43
|
44
|
if (counter.lastReset.delta.total_seconds())/(24*3600) > maxJSS:
|
|
44
|
45
|
maxJSS = (counter.lastReset.delta.total_seconds())/(24*3600)
|
|
45
|
46
|
else:
|
|
46
|
|
- counter.CSSclass = "danger"
|
|
|
47
|
+ counter.CSSclass = "primary"
|
|
|
48
|
+ counter.opacity = 0.3 + 0.7*math.exp(-(counter.lastReset.delta.total_seconds())/(7*24*3600))
|
|
47
|
49
|
counter.lastReset.formatted_delta = format_timedelta(counter.lastReset.delta,locale='fr',threshold=1)
|
|
48
|
50
|
counter.isHidden = "hidden"
|
|
49
|
51
|
counters = sorted(counters,key=lambda t: t.lastReset.delta)
|