mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Display bar list with "openness"
This commit is contained in:
parent
c62d3f4f4a
commit
25dea832be
@ -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">✓</span>
|
||||
{% else %}
|
||||
<span style="color: red">✗</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",
|
||||
|
Loading…
Reference in New Issue
Block a user