OpenSlides/openslides/users/static/templates/users/user-list.html
Emanuel Schuetze fac45fbf2a Added multiselection delete mode for users list view.
Fix users import: Allows multiple groups.
2015-10-15 21:09:49 +02:00

131 lines
5.6 KiB
HTML

<h1 translate>Participants</h1>
<div id="submenu">
<a ui-sref="users.user.create" os-perms="users.can_manage" class="btn btn-primary btn-sm">
<i class="fa fa-user-plus fa-lg"></i>
<translate>New</translate>
</a>
<a ui-sref="users.group.list" os-perms="users.can_manage" class="btn btn-default btn-sm">
<i class="fa fa-group fa-lg"></i>
<translate>Groups</translate>
</a>
<a ui-sref="users.user.import" os-perms="users.can_manage" class="btn btn-default btn-sm">
<i class="fa fa-download fa-lg"></i>
<translate>Import</translate>
</a>
<div class="btn-group">
<a ui-sref="user_print" class="btn btn-default btn-sm" target="_blank">
<i class="fa fa-file-pdf-o fa-lg"></i>
<translate>PDF</translate>
</a>
<button os-perms="users.can_manage" class="btn btn-default btn-sm dropdown-toggle"
data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a ui-sref="user_listpdf" target="_blank">
<i class="fa fa-list fa-fw"></i>
<translate>List of participants</translate>
</a>
<li os-perms="users.can_manage">
<a ui-sref="user_passwordspdf" target="_blank">
<i class="fa fa-qrcode fa-fw"></i>
<translate>List of access data</translate>
</a>
</ul>
</div>
</div>
<div class="row form-group">
<div class="col-sm-8">
<form class="form-inline">
<!-- delete mode -->
<div os-perms-lite="agenda.can_manage" class="form-group">
<label for="deleteSwitcher" translate>Delete mode</label>
<switch id="deleteSwitcher" ng-model="isDeleteMode" ng-change="uncheckAll()"
on="{{'On'|translate}}" off="{{'Off'|translate}}"
class="green wide form-control">
</switch>
</div>
<!-- delete button -->
<a ng-show="isDeleteMode && (users|filter:{selected:true}).length > 0"
os-perms="users.can_manage" ng-click="delete()"
class="btn btn-primary btn-sm form-control">
<i class="fa fa-trash fa-lg"></i>
<translate>Delete selected users</translate>
</a>
<!-- isPresent filter -->
<input type="checkbox" ng-model="filterPresent" ng-false-value="''">
<translate>Is present</translate>
</form>
</div>
<div class="col-sm-4">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-filter"></i></div>
<input type="text" os-focus-me ng-model="filter.search" class="form-control"
placeholder="{{ 'Filter' | translate}}">
</div>
</div>
</div>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<!-- projector column -->
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="firstColumn">
<!-- delete selection column -->
<th ng-show="isDeleteMode" os-perms-lite="users.can_manage" class="firstColumn deleteColumn"
ng-click="$event.stopPropagation();">
<input type="checkbox" ng-model="selectedAll" ng-change="checkAll()">
<th ng-click="toggleSort('first_name')" class="sortable">
<translate>Name</translate>
<!-- TODO: sort by first OR last name -->
<i class="pull-right fa" ng-show="sortColumn === 'first_name' && header.sortable != false"
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
</i>
<th ng-click="toggleSort('structure_level')" class="sortable optional">
<translate>Structure level</translate>
<i class="pull-right fa" ng-show="sortColumn === 'structure_level' && header.sortable != false"
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
</i>
<th ng-click="toggleSort('groups')" class="sortable optional">
<translate>Groups</translate>
<i class="pull-right fa" ng-show="sortColumn === 'groups' && header.sortable != false"
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
</i>
<th ng-click="toggleSort('is_present')" class="sortable minimum">
<translate>Present</translate>
<i class="pull-right fa" ng-show="sortColumn === 'is_present' && header.sortable != false"
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
</i>
<tbody>
<tr ng-repeat="user in users | filter: filter.search | filter: {is_present: filterPresent} |
orderBy: sortColumn:reverse"
ng-click="openDetail(user.id)"
ng-class="{ 'activeline': user.isProjected() }"
class="pointer">
<!-- projector column -->
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
<a class="btn btn-default btn-sm"
ng-class="{ 'btn-primary': user.isProjected() }"
ng-click="user.project(); $event.stopPropagation();"
title="{{ 'Project user' | translate }}">
<i class="fa fa-video-camera"></i>
</a>
<!-- delete selection column -->
<td ng-show="isDeleteMode" os-perms="users.can_manage" class="deleteColumn"
ng-click="$event.stopPropagation();">
<input type="checkbox" ng-model="user.selected">
<!-- user data colums -->
<td>{{ user.get_short_name() }}
<div ng-if="user.comment">
<small><i class="fa fa-info-circle"></i> {{ user.comment }}</small>
</div>
<td class="optional">{{ user.structure_level }}
<td class="optional">
<div ng-repeat="group in user.groups">
{{ (groups | filter: {id: group})[0].name }}
</div>
<td><input type="checkbox" ng-model="user.is_present" ng-click="togglePresent(user)">
</table>