Skip to content
Snippets Groups Projects
Commit 843f2dcc authored by Andreas Valder's avatar Andreas Valder
Browse files

made ui for permissions look better

parent eea3af2c
No related branches found
No related tags found
No related merge requests found
...@@ -119,7 +119,7 @@ def permdescr(perms): ...@@ -119,7 +119,7 @@ def permdescr(perms):
elif perm['type'] == 'password': elif perm['type'] == 'password':
password = True password = True
elif perm['type'] == 'l2p': elif perm['type'] == 'l2p':
l2p_courses.append(perm['param']) l2p_courses.append(perm['param1'])
elif perm['type'] == 'rwth': elif perm['type'] == 'rwth':
rwth_intern = True rwth_intern = True
if public or not perms: if public or not perms:
...@@ -287,6 +287,7 @@ def course(id=None, handle=None): ...@@ -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()) lectures = query('SELECT * FROM lectures WHERE course_id = ? AND (? OR visible) ORDER BY time, duration DESC', course['id'], ismod())
for lecture in lectures: for lecture in lectures:
lecture['perm'] = [] lecture['perm'] = []
lecture['perm'] += course['perm']
lecture['course'] = course lecture['course'] = course
for perm in perms: for perm in perms:
if perm['lecture_id'] == lecture['id']: if perm['lecture_id'] == lecture['id']:
......
static/l2p-logo.gif

271 B

static/rwth.png

630 B

...@@ -186,25 +186,35 @@ $('#embedcodebtn').popover( ...@@ -186,25 +186,35 @@ $('#embedcodebtn').popover(
{% macro moderator_acleditor(type,id,acl,global_acls) %} {% macro moderator_acleditor(type,id,acl,global_acls) %}
{% set tmp = global_acls.extend(acl) %} {% set tmp = global_acls.extend(acl) %}
{% if (not acl) %} {% set permdescription = acl|permdescr %}
{% if ismod() %} {% set permlogos = '' %}
<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> {% if permdescription[0] == 'public' %}
</button> {% set permlogos = '<span class="fa fa-globe" aria-hidden="true"></span>' %}
{% endif %} {% endif %}
{% else %} {% if permdescription[0] == 'password' %}
{% if ismod() %} {% set permlogos = '<span class="fa fa-lock" aria-hidden="true"></span>' %}
<button class="btn btn-default modmoderator_acleditor" data-type="{{ type }}" data-id="{{ id }}" onclick=""> {% endif %}
{% else %} {% if permdescription[0] == 'l2p' %}
<a> {% 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 %} {% endif %}
<span class="fa fa-lock" aria-hidden="true" style="color: red;"></span> {% 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() %} {% if ismod() %}
<button class="btn btn-default modmoderator_acleditor" data-type="{{ type }}" data-id="{{ id }}">
{{ permlogos|safe }}
</button> </button>
{% else %} {% else %}
<a>
{{ permlogos|safe }}
</a> </a>
{% endif %} {% endif %}
{% endif %}
{% endmacro %} {% endmacro %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment