Merge pull request #24 from alberanid/master
date sorting, company field
This commit is contained in:
commit
45b1691a80
6 changed files with 22 additions and 11 deletions
|
@ -48,15 +48,16 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>{{'Person' | translate}}</th>
|
||||
<th>{{'Email' | translate}}</th>
|
||||
<th>{{'Attended' | translate}}</th>
|
||||
<th>{{'Delete' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="person in event.persons | splittedFilter:query | orderBy:personsOrderProp">
|
||||
<td><strong><a ui-sref="person.info({id: person.person_id})">{{person.name}} {{person.surname}}</a></strong></td>
|
||||
<td>{{person.email}}</td>
|
||||
<td>
|
||||
<span><strong><a ui-sref="person.info({id: person._id})"><span>{{person.name}}</span> <span>{{person.surname}}</span></a></strong></span><span ng-if="person.email"> <{{person.email}}></span>
|
||||
<p ng-if="person.company"><i>{{person.company}}</i></p>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-link" name="switch-attended" ng-click="updateAttendee(person, !person.attended)"><span class="glyphicon {{(person.attended) && 'glyphicon-ok-sign text-success' || 'glyphicon-remove-sign text-danger'}}"></span></button>
|
||||
</td>
|
||||
|
@ -88,6 +89,11 @@
|
|||
<span class="input-group-addon">{{'Email' | translate}}</span>
|
||||
<input type="email" name="email" class="form-control" placeholder="{{'name.surname@example.com' | translate}}" ng-model="newPerson.email">
|
||||
</div>
|
||||
<div class="input-group top5">
|
||||
<span class="input-group-addon">{{'Company' | translate}}</span>
|
||||
<input name="company" class="form-control" placeholder="{{'Acme Corporation' | translate}}" ng-model="newPerson.company">
|
||||
</div>
|
||||
|
||||
<button ng-disabled="!(newPerson.name && newPerson.surname)" ng-click="fastAddPerson(newPerson, true)" class="btn btn-success top5">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
{{'Add' | translate}}
|
||||
|
@ -107,7 +113,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="person in allPersons | filter:newPerson | personRegistered:{event: event, present: false}">
|
||||
<tr ng-repeat="person in allPersons | splittedFilter:query | personRegistered:{event: event, present: false}">
|
||||
<td>
|
||||
<strong><a ui-sref="person.info({id: person._id})">{{person.name}} {{person.surname}}</a></strong>
|
||||
<br />
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
<select id="events-order" class="form-control" ng-model="eventsOrderProp">
|
||||
<option value="title">{{'Title' | translate}}</option>
|
||||
<option value="-title">{{'Title (descending)' | translate}}</option>
|
||||
<option value="begin-date">{{'Date' | translate}}</option>
|
||||
<option value="-begin-date">{{'Date (descending)' | translate}}</option>
|
||||
<option value="'begin-date'">{{'Date' | translate}}</option>
|
||||
<option value="'-begin-date'">{{'Date (descending)' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
|
|
4
angular_app/js/controllers.js
vendored
4
angular_app/js/controllers.js
vendored
|
@ -42,7 +42,7 @@ eventManControllers.controller('EventsListCtrl', ['$scope', 'Event',
|
|||
function ($scope, Event) {
|
||||
$scope.events = Event.all();
|
||||
$scope.personsOrderProp = 'name';
|
||||
$scope.eventsOrderProp = '-begin-date';
|
||||
$scope.eventsOrderProp = "'-begin-date'";
|
||||
|
||||
$scope.remove = function(_id) {
|
||||
Event.remove({'id': _id}, function() {
|
||||
|
@ -228,7 +228,7 @@ eventManControllers.controller('PersonDetailsCtrl', ['$scope', '$stateParams', '
|
|||
var data = angular.copy(person);
|
||||
data._id = evnt._id;
|
||||
data.person_id = person._id;
|
||||
data.attended = true;
|
||||
data.attended = false;
|
||||
Event.addAttendee(data,
|
||||
function(data) {
|
||||
$scope.events = Person.getEvents({_id: $stateParams.id, all: true});
|
||||
|
|
|
@ -27,6 +27,11 @@
|
|||
<input type="email" name="email" class="form-control" placeholder="{{'name.surname@example.com' | translate}}" ng-model="person.email">
|
||||
</div>
|
||||
|
||||
<div class="input-group top5">
|
||||
<span class="input-group-addon">{{'Company' | translate}}</span>
|
||||
<input name="company" class="form-control" placeholder="{{'Acme Corporation' | translate}}" ng-model="person.company">
|
||||
</div>
|
||||
|
||||
<div class="form-group top5">
|
||||
<label for="addToEvent">{{'Add to event:' | translate}}</label>
|
||||
<select class="form-control" id="addToEvent" ng-model="addToEvent">
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<button class="btn btn-link" name="switch-registered" ng-click="switchRegistered(event, person, !event.person_data.person_id)"><span class="glyphicon {{(event.person_data.person_id) && 'glyphicon-ok-sign text-success' || 'glyphicon-remove-sign text-danger'}}"></span></button>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-link" name="switch-attended" ng-click="updateAttendee(event, !event.person_data.attended)"><span class="glyphicon {{(event.person_data.attended) && 'glyphicon-ok-sign text-success' || 'glyphicon-remove-sign text-danger'}}"></span></button>
|
||||
<button ng-disabled="!event.person_data.person_id" class="btn btn-link" name="switch-attended" ng-click="updateAttendee(event, !event.person_data.attended)"><span class="glyphicon {{(event.person_data.attended) && 'glyphicon-ok-sign text-success' || 'glyphicon-remove-sign text-danger'}}"></span></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
<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> <span>{{person.surname}}</span></a></strong></span>
|
||||
<p>{{person.email}}</p>
|
||||
<span><strong><a ui-sref="person.info({id: person._id})"><span>{{person.name}}</span> <span>{{person.surname}}</span></a></strong></span><span ng-if="person.email"> <{{person.email}}></span>
|
||||
<p ng-if="person.company"><i>{{person.company}}</i></p>
|
||||
</td>
|
||||
<td>
|
||||
<button ng-click="remove(person._id)" type="button" class="btn btn-link glyphicon glyphicon-trash"></button>
|
||||
|
|
Loading…
Reference in a new issue