Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jannik Hellenkamp
website
Commits
026d4c20
Commit
026d4c20
authored
Oct 01, 2016
by
Andreas Valder
Browse files
fixed acl editor...
parent
6f757c67
Changes
5
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
026d4c20
...
...
@@ -70,7 +70,6 @@ def mod_required(func):
return
decorator
app
.
jinja_env
.
globals
[
'navbar'
]
=
[]
app
.
jinja_env
.
globals
[
'acls'
]
=
[]
# iconlib can be 'bootstrap'
# ( see: http://getbootstrap.com/components/#glyphicons )
# or 'fa'
...
...
static/moderator.js
View file @
026d4c20
...
...
@@ -163,11 +163,9 @@ var moderatorinterface = {
setacls
:
function
(
value
)
{
var
idlist
=
[];
for
(
i
in
value
)
{
for
(
j
in
value
[
i
])
{
if
(
idlist
.
indexOf
(
value
[
i
][
j
][
'
auth_id
'
])
==
-
1
)
{
idlist
[
idlist
.
length
]
=
value
[
i
][
j
][
'
auth_id
'
];
moderatorinterface
.
acls
[
moderatorinterface
.
acls
.
length
]
=
value
[
i
][
j
];
}
if
(
idlist
.
indexOf
(
value
[
i
][
'
auth_id
'
])
==
-
1
)
{
idlist
[
idlist
.
length
]
=
value
[
i
][
'
auth_id
'
];
moderatorinterface
.
acls
[
moderatorinterface
.
acls
.
length
]
=
value
[
i
];
}
}
}
...
...
templates/base.html
View file @
026d4c20
{% set page_border = page_border|default(1) %}
{% set global_acls = [] %}
{% set min_announcement_level = min_announcement_level|default(1) %}
{% set levels = {0: ('info', 'Nur auf Hauptseite sichtbar'), 1: ('info', 'Überall sichtbar (Hinweis)'), 2: ('warning', 'Überall sichtbar (Warnung)'), 3: ('danger', 'Überall sichtbar (Wichtig)')} %}
{% from 'macros.html' import valueeditor, valuecheckbox, valuedeletebtn %}
...
...
@@ -141,7 +142,7 @@
</body>
{% if ismod() %}
<script>
moderatorinterface
.
setacls
({{
acls
|
tojson
|
safe
}})
moderatorinterface
.
setacls
({{
global_
acls
|
tojson
|
safe
}})
</script>
{% endif %}
</html>
templates/course.html
View file @
026d4c20
...
...
@@ -12,7 +12,7 @@
<h1
class=
"panel-title"
>
{{ valueeditor(['courses',course.id,'title'], course.title)}}
<ul
class=
"pull-right list-inline"
>
<li>
{{ valuedeletebtn(['courses',course.id,'deleted']) }}
</li>
<li>
{{ editacl('course',course.id,course.auth) }}
</li>
<li>
{{ editacl('course',course.id,course.auth
, global_acls
) }}
</li>
</ul>
</h1>
</div>
...
...
@@ -49,7 +49,7 @@
</div>
<ul
class=
"list-group lectureslist"
>
{% for l in lectures %}
{{ lecture_list_item(l,videos|selectattr('lecture_id','equalto',l.id)|list)
}}
{{ lecture_list_item(l,videos|selectattr('lecture_id','equalto',l.id)|list
,global_acls
)}}
{% endfor %}
</ul>
</div>
...
...
templates/macros.html
View file @
026d4c20
...
...
@@ -113,7 +113,7 @@ $('#embedcodebtn').popover(
</script>
{% endmacro %}
{% macro lecture_list_item(lecture,videos) %}
{% macro lecture_list_item(lecture,videos
i,global_acls
) %}
<li
class=
"list-group-item"
id=
"lecture-{{lecture.id}}"
>
<div
class=
"row"
>
<img
class=
"col-sm-2 col-xs-12"
src=
"{{ config.VIDEOPREFIX }}/{{lecture.titlefile}}"
alt=
"Vorschaubild"
onerror=
"this.src='{{url_for('static',filename='no-thumbnail.png')}}'; this.onerror=''; "
>
...
...
@@ -152,7 +152,7 @@ $('#embedcodebtn').popover(
{{ valuedeletebtn(['lectures',lecture.id,'deleted']) }}
</li>
<li>
{{ editacl('lecture', lecture.id, lecture.auth) }}
{{ editacl('lecture', lecture.id, lecture.auth
, global_acls
) }}
</li>
</ul>
</div>
...
...
@@ -182,8 +182,8 @@ $('#embedcodebtn').popover(
{% endif %}
{% endmacro %}
{% macro editacl(type,id,acl) %}
{
{
acls.
app
end(acl)
}
}
{% macro editacl(type,id,acl
,global_acls
) %}
{
% set tmp = global_
acls.
ext
end(acl)
%
}
{% if (not acl) %}
{% if ismod() %}
<button
class=
"btn btn-default modeditacl"
data-type=
"{{ type }}"
data-id=
"{{ id }}"
>
...
...
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