Fixed permissions in list views.

This commit is contained in:
Emanuel Schuetze 2016-01-10 00:52:37 +01:00
parent 4ee2b85b76
commit 071b0a76be
6 changed files with 29 additions and 25 deletions

View File

@ -69,7 +69,7 @@
<div ui-tree="treeOptions" class="col-sm-6"> <div ui-tree="treeOptions" class="col-sm-6">
<ol ui-tree-nodes="" ng-model="speakers"> <ol ui-tree-nodes="" ng-model="speakers">
<li ng-repeat="speaker in speakers | filter: {begin_time: null}" ui-tree-node> <li ng-repeat="speaker in speakers | filter: {begin_time: null}" ui-tree-node>
<i ui-tree-handle="" class="fa fa-arrows-v"></i> <i os-perms="agenda.can_manage" ui-tree-handle="" class="fa fa-arrows-v"></i>
{{ $index + 1 }}. {{ $index + 1 }}.
{{ speaker.user.get_full_name() }} {{ speaker.user.get_full_name() }}
<button os-perms="agenda.can_manage" ng-click="removeSpeaker(speaker.id)" <button os-perms="agenda.can_manage" ng-click="removeSpeaker(speaker.id)"

View File

@ -31,8 +31,8 @@
<div class="col-sm-6"> <div class="col-sm-6">
<form class="form-inline"> <form class="form-inline">
<!-- delete mode --> <!-- delete mode -->
<button os-perms-lite="agenda.can_manage" class="btn btn-default" <button os-perms="agenda.can_manage" class="btn btn-default"
ng-click="isDeleteMode = !isDeleteMode; uncheckAll()"> ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
<i class="fa fa-check-square-o"></i> <i class="fa fa-check-square-o"></i>
<translate>Select ...</translate> <translate>Select ...</translate>
</button> </button>
@ -104,13 +104,13 @@
<!-- projector column --> <!-- projector column -->
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="minimum"></th> <th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="minimum"></th>
<!-- delete selection column --> <!-- delete selection column -->
<th ng-show="isDeleteMode" os-perms-lite="agenda.can_manage" class="minimum deleteColumn" <th ng-show="isDeleteMode" os-perms="agenda.can_manage" class="minimum deleteColumn"
ng-click="$event.stopPropagation();"> ng-click="$event.stopPropagation();">
<input type="checkbox" ng-model="selectedAll" ng-change="checkAll()"> <input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
<!-- agenda item column --> <!-- agenda item column -->
<th> <th>
<translate>Agenda item</translate> <translate>Agenda item</translate>
<th os-perms="agenda.can_manage"> <th os-perms="agenda.can_see_hidden_items">
<translate>Duration</translate> <translate>Duration</translate>
<th class="minimum"> <th class="minimum">
<translate>Done</translate> <translate>Done</translate>
@ -153,13 +153,13 @@
ng-bootbox-confirm-action="deleteRelatedItem(item)" translate>Delete</a> ng-bootbox-confirm-action="deleteRelatedItem(item)" translate>Delete</a>
</span> </span>
</div> </div>
<td ng-if="!item.quickEdit" class="optional"> <td ng-show="!item.quickEdit" os-perms="agenda.can_see_hidden_items" class="optional">
{{ item.duration }} {{ item.duration }}
<span ng-if="item.duration" translate-comment="'h' means time in hours" translate>h</span> <span ng-if="item.duration" translate-comment="'h' means time in hours" translate>h</span>
<td ng-if="!item.quickEdit"> <td ng-if="!item.quickEdit">
<input type="checkbox" ng-model="item.closed" ng-change="save(item.id);"> <input type="checkbox" ng-model="item.closed" ng-change="save(item.id);">
<!-- quickEdit columns --> <!-- quickEdit columns -->
<td ng-if="item.quickEdit" os-perms-lite="agenda.can_manage" colspan="3"> <td ng-if="$parent.item.quickEdit" os-perms="agenda.can_manage" colspan="3">
<form ng-submit="save(item)"> <form ng-submit="save(item)">
<h4>{{ item.getTitle() }} <span class="text-muted">&ndash; QuickEdit</span></h4> <h4>{{ item.getTitle() }} <span class="text-muted">&ndash; QuickEdit</span></h4>
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}"> <alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">

View File

@ -23,8 +23,8 @@
<div class="col-sm-6"> <div class="col-sm-6">
<form class="form-inline"> <form class="form-inline">
<!-- delete mode --> <!-- delete mode -->
<button os-perms-lite="assignments.can_manage" class="btn btn-default" <button os-perms="assignments.can_manage" class="btn btn-default"
ng-click="isDeleteMode = !isDeleteMode; uncheckAll()"> ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
<i class="fa fa-check-square-o"></i> <i class="fa fa-check-square-o"></i>
<translate>Select ...</translate> <translate>Select ...</translate>
</button> </button>
@ -78,8 +78,8 @@
<!-- projector column --> <!-- projector column -->
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="minimum"> <th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="minimum">
<!-- delete selection column --> <!-- delete selection column -->
<th ng-show="isDeleteMode" os-perms-lite="assignments.can_manage" class="minimum deleteColumn"> <th ng-show="isDeleteMode" os-perms="assignments.can_manage" class="minimum deleteColumn">
<input type="checkbox" ng-model="selectedAll" ng-change="checkAll()"> <input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
<th ng-click="toggleSort('title')" class="sortable"> <th ng-click="toggleSort('title')" class="sortable">
<translate>Title</translate> <translate>Title</translate>
<i class="pull-right fa" ng-show="sortColumn === 'title' && header.sortable != false" <i class="pull-right fa" ng-show="sortColumn === 'title' && header.sortable != false"
@ -101,7 +101,7 @@
class="animate-item" class="animate-item"
ng-class="{ 'activeline': assignment.isProjected(), 'selected': assignment.selected }"> ng-class="{ 'activeline': assignment.isProjected(), 'selected': assignment.selected }">
<!-- projector column --> <!-- projector column -->
<td ng-show="!isDeleteMode" os-perms-lite="core.can_manage_projector"> <td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
<a class="btn btn-default btn-sm" <a class="btn btn-default btn-sm"
ng-class="{ 'btn-primary': assignment.isProjected() }" ng-class="{ 'btn-primary': assignment.isProjected() }"
ng-click="assignment.project()" ng-click="assignment.project()"

View File

@ -56,7 +56,7 @@
</div> </div>
<!-- countdowns --> <!-- countdowns -->
<div class="section" os-perms-lite="core.can_manage_projector"> <div class="section" os-perms="core.can_manage_projector">
<a href="#" ng-click="isCountdowns = !isCountdowns"> <a href="#" ng-click="isCountdowns = !isCountdowns">
<i class="fa toggle-icon" ng-class="isCountdowns ? 'fa-angle-up' : 'fa-angle-down'"></i> <i class="fa toggle-icon" ng-class="isCountdowns ? 'fa-angle-up' : 'fa-angle-down'"></i>
<h4 translate>Countdowns</h4> <h4 translate>Countdowns</h4>

View File

@ -30,8 +30,8 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<!-- delete mode --> <!-- delete mode -->
<button os-perms-lite="motions.can_manage" class="btn btn-default" <button os-perms="motions.can_manage" class="btn btn-default"
ng-click="isDeleteMode = !isDeleteMode; uncheckAll()"> ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
<i class="fa fa-check-square-o"></i> <i class="fa fa-check-square-o"></i>
<translate>Select ...</translate> <translate>Select ...</translate>
</button> </button>
@ -82,10 +82,10 @@
<thead> <thead>
<tr> <tr>
<!-- projector column --> <!-- projector column -->
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="firstColumn"> <th ng-show="!$parent.isDeleteMode" os-perms="core.can_manage_projector" class="firstColumn">
<!-- delete selection column --> <!-- delete selection column -->
<th ng-show="isDeleteMode" os-perms-lite="motions.can_manage" class="firstColumn deleteColumn"> <th ng-show="$parent.isDeleteMode" os-perms="motions.can_manage" class="firstColumn deleteColumn">
<input type="checkbox" ng-model="selectedAll" ng-change="checkAll()"> <input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
<th ng-click="toggleSort('identifier')" class="sortable minimum"> <th ng-click="toggleSort('identifier')" class="sortable minimum">
<translate>Identifier</translate> <translate>Identifier</translate>
<i class="pull-right fa" ng-show="sortColumn === 'identifier' && header.sortable != false" <i class="pull-right fa" ng-show="sortColumn === 'identifier' && header.sortable != false"
@ -117,7 +117,7 @@
class="animate-item" class="animate-item"
ng-class="{ 'activeline': motion.isProjected(), 'selected': motion.selected }"> ng-class="{ 'activeline': motion.isProjected(), 'selected': motion.selected }">
<!-- projector column --> <!-- projector column -->
<td ng-show="!isDeleteMode" os-perms-lite="core.can_manage_projector"> <td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
<a class="btn btn-default btn-sm" <a class="btn btn-default btn-sm"
ng-class="{ 'btn-primary': motion.isProjected() }" ng-class="{ 'btn-primary': motion.isProjected() }"
ng-click="motion.project()" ng-click="motion.project()"

View File

@ -40,8 +40,8 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<!-- delete mode --> <!-- delete mode -->
<button os-perms-lite="users.can_manage" class="btn btn-default" <button os-perms="users.can_manage" class="btn btn-default"
ng-click="isDeleteMode = !isDeleteMode; uncheckAll()"> ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
<i class="fa fa-check-square-o"></i> <i class="fa fa-check-square-o"></i>
<translate>Select ...</translate> <translate>Select ...</translate>
</button> </button>
@ -92,8 +92,8 @@
<!-- projector column --> <!-- projector column -->
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="firstColumn"> <th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="firstColumn">
<!-- delete selection column --> <!-- delete selection column -->
<th ng-show="isDeleteMode" os-perms-lite="users.can_manage" class="firstColumn deleteColumn"> <th ng-show="isDeleteMode" os-perms="users.can_manage" class="firstColumn deleteColumn">
<input type="checkbox" ng-model="selectedAll" ng-change="checkAll()"> <input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
<th ng-click="toggleSort('first_name')" class="sortable"> <th ng-click="toggleSort('first_name')" class="sortable">
<translate>Name</translate> <translate>Name</translate>
<!-- TODO: sort by first OR last name --> <!-- TODO: sort by first OR last name -->
@ -148,6 +148,10 @@
<div ng-repeat="group in user.groups"> <div ng-repeat="group in user.groups">
{{ (groups | filter: {id: group})[0].name }} {{ (groups | filter: {id: group})[0].name }}
</div> </div>
<td><input type="checkbox" ng-model="user.is_present" ng-click="save(user)"> <td>
<span os-perms="!users.can_manage">
<i ng-if="user.is_present" class="fa fa-check-square-o"></i>
</span>
<input os-perms="users.can_manage" type="checkbox" ng-model="user.is_present" ng-click="save(user)">
</table> </table>
</div> </div>