eventman/angular_app/persons-list.html

65 lines
3.6 KiB
HTML
Raw Normal View History

2015-04-05 22:16:11 +02:00
<!-- show the list of Persons -->
2015-03-22 17:08:25 +01:00
<div class="container">
2015-04-05 18:54:51 +02:00
<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>
2015-04-05 20:12:54 +02:00
<button ng-click="$state.go('import.persons')" class="btn btn-success">
<span class="glyphicon glyphicon-plus-sign"></span>
{{'Import persons' | translate}}
</button>
2015-04-05 18:54:51 +02:00
</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>
2015-04-18 15:49:28 +02:00
<input eventman-focus type="text" id="query-persons" class="form-control" placeholder="{{'Name or email' | translate}}" ng-model="query">
2015-04-05 18:54:51 +02:00
</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>
2015-04-05 18:54:51 +02:00
</select>
</div>
</form>
2015-03-14 17:32:16 +01:00
2015-04-05 18:54:51 +02:00
<table class="table table-striped">
<thead>
<tr>
2015-04-19 21:52:41 +02:00
<th><strong>{{'Name' | translate}}</strong></th>
<th ng-repeat="col in customFields">
2015-04-18 17:33:42 +02:00
<strong>{{col.label | translate}}</strong>
2015-04-19 21:52:41 +02:00
</th>
<th><strong>{{'Delete' | translate}}</strong></th>
2015-04-05 18:54:51 +02:00
</tr>
</thead>
<tbody>
<tr ng-repeat="person in persons | splittedFilter:query | orderBy:personsOrderProp">
2015-04-05 18:54:51 +02:00
<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>
2015-04-18 18:26:50 +02:00
<p ng-if="person.company || person.job"><i ng-if="person.job">{{person.job}}</i><span ng-if="person.company && person.job">&nbsp;@&nbsp;</span><i ng-if="person.company">{{person.company}}</i></p>
2015-04-05 18:54:51 +02:00
</td>
2015-04-18 17:33:42 +02:00
<td ng-repeat="col in customFields">
<span ng-if="col.type == 'boolean'">
<button class="btn btn-link" 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>
2015-04-18 17:33:42 +02:00
</span>
<span ng-if="col.type != 'boolean'">
{{person[col.key]}}
</span>
</td>
2015-04-05 18:54:51 +02:00
<td>
<button ng-click="remove(person._id)" type="button" class="btn btn-link glyphicon glyphicon-trash"></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
2015-03-22 17:08:25 +01:00
</div>