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
25dea832
Commit
25dea832
authored
Sep 04, 2016
by
Skia
🤘
Browse files
Display bar list with "openness"
parent
c62d3f4f
Pipeline
#180
failed with stage
in 1 minute and 54 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/static/core/style.css
View file @
25dea832
...
...
@@ -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
;
...
...
core/templates/core/base.jinja
View file @
25dea832
...
...
@@ -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>
...
...
counter/models.py
View file @
25dea832
...
...
@@ -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
()]
...
...
sith/settings_sample.py
View file @
25dea832
...
...
@@ -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"
,
...
...
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