Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
be7e0401
Commit
be7e0401
authored
Oct 16, 2016
by
guillaume-renaud
Committed by
Skia
Nov 08, 2016
Browse files
Fix the number of minutes for a counter to be inactive to 10
parent
63f10c13
Changes
2
Hide whitespace changes
Inline
Side-by-side
counter/models.py
View file @
be7e0401
...
...
@@ -223,10 +223,10 @@ class Counter(models.Model):
def
is_inactive
(
self
):
"""
Returns True if the counter self is inactive from
5
minutes, else False
Returns True if the counter self is inactive from
10
minutes, else False
"""
if
(
self
.
is_open
()):
return
((
timezone
.
now
()
-
self
.
permanencies
.
model
.
objects
.
order_by
(
'-activity'
).
first
().
activity
)
>
datetime
.
timedelta
(
minutes
=
5
))
return
((
timezone
.
now
()
-
self
.
permanencies
.
model
.
objects
.
order_by
(
'-activity'
).
first
().
activity
)
>
datetime
.
timedelta
(
minutes
=
10
))
else
:
return
False
...
...
counter/templates/counter/activity.jinja
View file @
be7e0401
...
...
@@ -8,13 +8,21 @@
{%
block
content
%}
<h3>
{%
trans
counter_name
=
counter
%}{{
counter_name
}}
activity
{%
endtrans
%}
</h3>
{%
if
counter.type
==
'BAR'
%}
<h4>
{%
trans
%}
Barm
a
n list
{%
endtrans
%}
</h4>
<h4>
{%
trans
%}
Barm
e
n list
{%
endtrans
%}
</h4>
<ul>
{%
for
b
in
counter.get_barmen_list
()
%}
<li>
{{
user_profile_link
(
b
)
}}
</li>
{%
endfor
%}
</ul>
{%
endif
%}
<h5>
{%
trans
%}
Legend
{%
endtrans
%}
</h5>
<span
style=
"color: green"
>
✓
</span>
:
{%
trans
%}
counter is open, there's at least one barman connected
{%
endtrans
%}
<br>
<span
style=
"color: orange"
>
?
</span>
:
{%
trans
%}
counter is open but not active, the last sale was done at least 10 minutes ago
{%
endtrans
%}
<br>
<span
style=
"color: red"
>
✗
</span>
:
{%
trans
%}
counter is not open : no one is connected
{%
endtrans
%}
{%
endblock
%}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment