diff --git a/server.py b/server.py index 15d66792aef9676823077c01259dedd29ae86d24..e1613b1ff3954ee996d19ec783c67c8983439dda 100644 --- a/server.py +++ b/server.py @@ -119,7 +119,7 @@ def permdescr(perms): elif perm['type'] == 'password': password = True elif perm['type'] == 'l2p': - l2p_courses.append(perm['param']) + l2p_courses.append(perm['param1']) elif perm['type'] == 'rwth': rwth_intern = True if public or not perms: @@ -287,6 +287,7 @@ def course(id=None, handle=None): lectures = query('SELECT * FROM lectures WHERE course_id = ? AND (? OR visible) ORDER BY time, duration DESC', course['id'], ismod()) for lecture in lectures: lecture['perm'] = [] + lecture['perm'] += course['perm'] lecture['course'] = course for perm in perms: if perm['lecture_id'] == lecture['id']: diff --git a/static/l2p-logo.gif b/static/l2p-logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..a864af5ee9d30aa4b23cd62b061bddfe287e007a Binary files /dev/null and b/static/l2p-logo.gif differ diff --git a/static/rwth.png b/static/rwth.png new file mode 100644 index 0000000000000000000000000000000000000000..5c9168c5968474dad9bd119f24d980383eeeb736 Binary files /dev/null and b/static/rwth.png differ diff --git a/templates/macros.html b/templates/macros.html index 8f9381c103802106aa5b7a952625b9475a5a0262..fc6285d72a99ce11dbdf8807116db96013277642 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -186,24 +186,34 @@ $('#embedcodebtn').popover( {% macro moderator_acleditor(type,id,acl,global_acls) %} {% set tmp = global_acls.extend(acl) %} - {% if (not acl) %} - {% if ismod() %} + {% set permdescription = acl|permdescr %} + {% set permlogos = '' %} + + {% if permdescription[0] == 'public' %} + {% set permlogos = '<span class="fa fa-globe" aria-hidden="true"></span>' %} + {% endif %} + {% if permdescription[0] == 'password' %} + {% set permlogos = '<span class="fa fa-lock" aria-hidden="true"></span>' %} + {% endif %} + {% if permdescription[0] == 'l2p' %} + {% set permlogos %} + <span class="fa" aria-hidden="true" style="width: 12px; height: 14px; background-size: cover; background-image: url('/static/l2p-logo.gif');"></span> + {% endset %} + {% endif %} + {% if permdescription[0] == 'rwth' %} + {% set permlogos %} + <span class="fa" aria-hidden="true" style="width: 25px; height: 20px; background-size: cover; background-image: url('/static/rwth.png');"></span> + {% endset %} + {% endif %} + + {% if ismod() %} <button class="btn btn-default modmoderator_acleditor" data-type="{{ type }}" data-id="{{ id }}"> - <span class="fa fa-unlock" aria-hidden="true" style="color: green;"></span> + {{ permlogos|safe }} </button> - {% endif %} {% else %} - {% if ismod() %} - <button class="btn btn-default modmoderator_acleditor" data-type="{{ type }}" data-id="{{ id }}" onclick=""> - {% else %} - <a> - {% endif %} - <span class="fa fa-lock" aria-hidden="true" style="color: red;"></span> - {% if ismod() %} - </button> - {% else %} - </a> - {% endif %} + <a> + {{ permlogos|safe }} + </a> {% endif %} {% endmacro %}