eventman/angular_app/persons-list.html

64 lines
3.5 KiB
HTML

<!-- show the list of Persons -->
<div class="container">
<h1>{{'Persons' | translate}}
<button ng-click="$state.go('person.new')" class="btn btn-success">
<span class="glyphicon glyphicon-plus-sign"></span>
{{'Add person' | translate}}
</button>
<button ng-click="$state.go('import.persons')" class="btn btn-success">
<span class="glyphicon glyphicon-plus-sign"></span>
{{'Import persons' | translate}}
</button>
</h1>
<div class="panel panel-primary table-striped top5">
<div class="panel-heading">{{'Persons' | translate}}</div>
<div class="panel-body">
<form class="form-inline">
<div class="form-group">
<label for="query-persons">{{'Search:' | translate}}</label>
<input eventman-focus type="text" id="query-persons" class="form-control" placeholder="{{'Name or email' | translate}}" ng-model="query">
</div>
<div class="form-group">
<label for="persons-order">{{'Sort by:' | translate}}</label>
<select id="persons-order" class="form-control" ng-model="personsOrderProp">
<option value="name" ng-selected="selected">{{'Name' | translate}}</option>
<option value="-name" ng-selected="selected">{{'Name (descending)' | translate}}</option>
<option value="surname" ng-selected="selected">{{'Surname' | translate}}</option>
<option value="-surname" ng-selected="selected">{{'Surname (descending)' | translate}}</option>
</select>
</div>
</form>
<table class="table table-striped">
<thead>
<tr>
<td><strong>{{'Name' | translate}}</strong></td>
<td ng-repeat="col in customFields">
<strong>{{col.label | translate}}</strong>
</td>
<td><strong>{{'Delete' | translate}}</strong></td>
</tr>
</thead>
<tbody>
<tr ng-repeat="person in persons | splittedFilter:query | orderBy:personsOrderProp">
<td>
<span><strong><a ui-sref="person.info({id: person._id})"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span><span ng-if="person.email">&nbsp;&lt;{{person.email}}&gt;</span>
<p ng-if="person.company"><i>{{person.company}}</i></p>
</td>
<td ng-repeat="col in customFields">
<span ng-if="col.type == 'boolean'">
<button class="btn btn-link" name="switch-attended" ng-click="setAttribute(person, col.key, !person[col.key])"><span class="glyphicon {{(person[col.key]) && 'glyphicon-ok-sign text-success' || 'glyphicon-remove-sign text-danger'}}"></span></button>
</span>
<span ng-if="col.type != 'boolean'">
{{person[col.key]}}
</span>
</td>
<td>
<button ng-click="remove(person._id)" type="button" class="btn btn-link glyphicon glyphicon-trash"></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>