Commit 25dea832 authored by Skia's avatar Skia
Browse files

Display bar list with "openness"

parent c62d3f4f
Pipeline #180 failed with stage
in 1 minute and 54 seconds
......@@ -20,8 +20,15 @@ header {
position: absolute;
top : 0px;
right : 8%;
left: 40%;
background-color:#DDD;
margin: 0 10px;
padding: 0 10px;
}
header ul {
display: inline-block;
list-style-type: none;
margin: 0px;
vertical-align: middle;
}
header a {
display: inline-block;
......
......@@ -21,6 +21,18 @@
<a href="{{ url('core:login') }}">{% trans %}Login{% endtrans %}</a> |
<a href="{{ url('core:register') }}">{% trans %}Register{% endtrans %}</a>
{% else %}
<ul>
{% for bar in Counter.objects.filter(type="BAR").all() %}
<li>
{% if bar.is_open() %}
<span style="color: green">&#x2713;</span>
{% else %}
<span style="color: red">&#10007;</span>
{% endif %}
{{ bar }}
</li>
{% endfor %}
</ul>
<a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a> |
<a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a> |
<a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
......@@ -40,7 +52,7 @@
<form action="{{ url('set_language') }}" method="post">{% csrf_token %}
<input name="next" value="{{ request.path }}" type="hidden" />
<input name="language" value="{{ language[0] }}" type="hidden" />
<input type="submit" value="{{ language[1]}}" />
<input type="submit" value="{{ language[0]|upper }}" />
</form>
{% endfor %}
</div>
......
......@@ -184,10 +184,7 @@ class Counter(models.Model):
return bl[random.randrange(0, len(bl))]
def is_open(self):
response = False
if len(self.get_barmen_list()) > 0:
response = True
return response
return len(self.get_barmen_list()) > 0:
def barman_list(self):
return [b.id for b in self.get_barmen_list()]
......
......@@ -111,6 +111,7 @@ TEMPLATES = [
"can_view": "core.views.can_view",
"get_subscriber": "subscription.views.get_subscriber",
"settings": "sith.settings",
"Counter": "counter.models.Counter",
},
"bytecode_cache": {
"name": "default",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment