mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
Fix the number of minutes for a counter to be inactive to 10
This commit is contained in:
parent
63f10c13d4
commit
be7e0401dd
@ -223,10 +223,10 @@ class Counter(models.Model):
|
|||||||
|
|
||||||
def is_inactive(self):
|
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()):
|
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:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -8,13 +8,21 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h3>{% trans counter_name=counter %}{{ counter_name }} activity{% endtrans %}</h3>
|
<h3>{% trans counter_name=counter %}{{ counter_name }} activity{% endtrans %}</h3>
|
||||||
{% if counter.type == 'BAR' %}
|
{% if counter.type == 'BAR' %}
|
||||||
<h4>{% trans %}Barman list{% endtrans %}</h4>
|
<h4>{% trans %}Barmen list{% endtrans %}</h4>
|
||||||
<ul>
|
<ul>
|
||||||
{% for b in counter.get_barmen_list() %}
|
{% for b in counter.get_barmen_list() %}
|
||||||
<li>{{ user_profile_link(b) }}</li>
|
<li>{{ user_profile_link(b) }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% 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 %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user