diff options
author | Christian Hofmaier | 2018-01-02 16:37:40 +0100 |
---|---|---|
committer | Christian Hofmaier | 2018-01-02 16:37:40 +0100 |
commit | 4a20d8b28d6f24f604634f75f95b19dff33f8e0a (patch) | |
tree | fbfb2ef034a6dbb332ce8daf7216808a7bdd4510 /modules-available/exams/templates | |
parent | [statistics] added permissions to view client statistics, delete clients and ... (diff) | |
download | slx-admin-4a20d8b28d6f24f604634f75f95b19dff33f8e0a.tar.gz slx-admin-4a20d8b28d6f24f604634f75f95b19dff33f8e0a.tar.xz slx-admin-4a20d8b28d6f24f604634f75f95b19dff33f8e0a.zip |
[exams] reworked permission system from "click and you get error" to "button is disabled due to lack of permission". you now can only add/delete/edit based on locations you have permission for. you need permission for all locations of an exam to edit/delete it, but you can see it if you have at least permission for one of the locations.
Diffstat (limited to 'modules-available/exams/templates')
3 files changed, 5 insertions, 6 deletions
diff --git a/modules-available/exams/templates/page-add-edit-exam.html b/modules-available/exams/templates/page-add-edit-exam.html index 58c61b11..11bffed8 100644 --- a/modules-available/exams/templates/page-add-edit-exam.html +++ b/modules-available/exams/templates/page-add-edit-exam.html @@ -19,7 +19,7 @@ </div> <select id="locations" multiple name="locations[]"> {{#locations}} - <option value="{{locationid}}" {{#selected}}selected{{/selected}}>{{locationpad}} {{locationname}}</option> + <option value="{{locationid}}" {{disabled}} {{#selected}}selected{{/selected}}>{{locationpad}} {{locationname}}</option> {{/locations}} </select> </div> diff --git a/modules-available/exams/templates/page-exams.html b/modules-available/exams/templates/page-exams.html index 29b8c319..bb6cbd0a 100644 --- a/modules-available/exams/templates/page-exams.html +++ b/modules-available/exams/templates/page-exams.html @@ -43,10 +43,9 @@ {{^liesInPast}} <a onclick="slxShow({{starttime}}, {{endtime}})" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-eye-open"></span></a> {{/liesInPast}} - <a href="?do=exams&action=edit&examid={{examid}}" class="btn btn-default btn-sm" >{{lang_edit}}</a> - <input type="hidden" name="token" value="{{token}}"> + <a href="?do=exams&action=edit&examid={{examid}}" class="btn btn-default btn-sm {{^allowedEdit}}disabled{{/allowedEdit}}"><span class="glyphicon glyphicon-edit"></span></a> <input type="hidden" name="token" value="{{token}}"> <input type="hidden" name="examid" value="{{examid}}"> - <button class="btn {{btnClass}} btn-sm">{{lang_delete}}</button> + <button {{^allowedDelete}}disabled{{/allowedDelete}} class="btn {{btnClass}} btn-sm"><span class="glyphicon glyphicon-trash"></span></button> </form> </td> </tr> @@ -56,7 +55,7 @@ </div> <div class="text-right"> <div class="btn-group" role="group"> - <a href="?do=exams&action=add" class="btn btn-success"><span class="glyphicon glyphicon-plus-sign"></span> {{lang_addExam}}</a> + <a href="?do=exams&action=add" class="btn btn-success {{^allowedToAdd}}disabled{{/allowedToAdd}}"><span class="glyphicon glyphicon-plus-sign"></span> {{lang_addExam}}</a> </div> </div> </div> diff --git a/modules-available/exams/templates/page-upcoming-lectures.html b/modules-available/exams/templates/page-upcoming-lectures.html index 8ff8143e..074aa42d 100644 --- a/modules-available/exams/templates/page-upcoming-lectures.html +++ b/modules-available/exams/templates/page-upcoming-lectures.html @@ -31,7 +31,7 @@ <td width="20%"> <div class="pull-right text-nowrap"> <a class="btn btn-sm btn-default" role="button" onclick="slxShow({{starttime}}, {{endtime}})"><span class="glyphicon glyphicon-eye-open"></span></a> - <a href="?do=exams&action=add&lectureid={{lectureid}}" class="btn btn-sm btn-success" role="button"> + <a href="?do=exams&action=add&lectureid={{lectureid}}" class="btn btn-sm btn-success {{^allowedToAdd}}disabled{{/allowedToAdd}}" role="button"> <span class="glyphicon glyphicon-plus-sign"></span> <span class="hidden-sm">{{lang_addExam}}</span> </a> |