Commit d71c3368 authored by Andreas Valder's avatar Andreas Valder
Browse files

added "fsmpi" permission, closes #143

parent c4dc313a
......@@ -140,6 +140,7 @@ def permdescr(perms):
password = False
l2p_courses = []
rwth_intern = False
fsmpi_intern = False
for perm in perms:
if perm['type'] == 'public':
public = True
......@@ -149,12 +150,16 @@ def permdescr(perms):
l2p_courses.append(perm['param1'])
elif perm['type'] == 'rwth':
rwth_intern = True
elif perm['type'] == 'fsmpi':
fsmpi_intern = True
if public or not perms:
return 'public', 'Öffentlich verfügbar'
if rwth_intern:
if password:
return 'rwth', 'Nur für RWTH-Angehörige und Nutzer mit Passwort verfügbar'
return 'rwth', 'Nur für RWTH-Angehörige verfügbar'
if fsmpi_intern:
return 'fsmpi', 'Nur für Fachschaftler verfügbar'
if l2p_courses:
if password:
return 'l2p', 'Nur für Teilnehmer der Veranstaltung und Nutzer mit Passwort verfügbar'
......
......@@ -165,6 +165,9 @@ var moderator = {
case 'rwth':
permstring = '(rwth intern)'
break;
case 'fsmpi':
permstring = '(fsmpi intern)'
break;
case 'l2p':
permstring = '(' + perm.param1 + ')'
break;
......@@ -177,6 +180,7 @@ var moderator = {
html += '<option value="public">Öffentlich</option>';
html += '<option selected value="password">Passwort</option>';
html += '<option value="rwth">RWTH intern</option>';
html += '<option value="fsmpi">FSMPI intern</option>';
html += '<option value="l2p">L2P Lernraum</option>';
html += '</select>';
html += '<input class="col-xs-12 passwordinput authuser" type="text" placeholder="Benutzername">';
......
......@@ -203,6 +203,9 @@ $('#embedcodebtn').popover(
{% 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>' %}
{% endif %}
{% if permdescription[0] == 'fsmpi' %}
{% set permlogos = '<span class="fa" aria-hidden="true" style="width: 25px; height: 20px; background-size: cover; background-image: url(\'/static/fsmpi.png\');"></span>' %}
{% endif %}
{% if ismod() %}
<button class="btn btn-default modmoderator_permissioneditor" data-type="{{ type }}" data-id="{{ id }}">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment