fixes #124: show number of attendees in the list of events
This commit is contained in:
parent
30c14b1046
commit
906d5fbf9c
3 changed files with 26 additions and 2 deletions
|
@ -30,6 +30,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><strong>{{'Event' | translate}}</strong></th>
|
<th><strong>{{'Event' | translate}}</strong></th>
|
||||||
|
<th class="hcenter"><strong>{{'Attendees / Registered' | translate}}</strong></th>
|
||||||
<th><strong>{{'Delete' | translate}}</strong></th>
|
<th><strong>{{'Delete' | translate}}</strong></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -37,9 +38,12 @@
|
||||||
<tr ng-repeat="event in events | splittedFilter:query | orderBy:eventsOrderProp">
|
<tr ng-repeat="event in events | splittedFilter:query | orderBy:eventsOrderProp">
|
||||||
<td>
|
<td>
|
||||||
<span><strong><a ui-sref="event.info({id: event._id})">{{event.title}}</a></strong></span>
|
<span><strong><a ui-sref="event.info({id: event._id})">{{event.title}}</a></strong></span>
|
||||||
<p>{{'Begins:' | translate}} {{event['begin-date'] | date:'fullDate' }} {{event['begin-time'] | date:'HH:mm' }}<br/>
|
<p>{{'Begins:' | translate}} {{event['begin-date'] | date:'fullDate'}} {{event['begin-time'] | date:'HH:mm'}}<br/>
|
||||||
{{'Ends:' | translate}} {{event['end-date'] | date:'fullDate' }} {{event['end-time'] | date:'HH:mm'}}</p>
|
{{'Ends:' | translate}} {{event['end-date'] | date:'fullDate' }} {{event['end-time'] | date:'HH:mm'}}</p>
|
||||||
</td>
|
</td>
|
||||||
|
<td class="hcenter">
|
||||||
|
<p><span ng-init="attendeesNr = (event.persons | attendeesFilter).length">{{attendeesNr}}</span> / {{event.persons.length || 0}}</p>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button ng-click="remove(event._id)" type="button" class="btn btn-link fa fa-trash fa-lg"></button>
|
<button ng-click="remove(event._id)" type="button" class="btn btn-link fa fa-trash fa-lg"></button>
|
||||||
</td>
|
</td>
|
||||||
|
|
16
angular_app/js/filters.js
vendored
16
angular_app/js/filters.js
vendored
|
@ -64,3 +64,19 @@ eventManApp.filter('splittedFilter', ['$filter',
|
||||||
}]
|
}]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/* Filter that returns only the attendees at an event. */
|
||||||
|
eventManApp.filter('attendeesFilter', ['$filter',
|
||||||
|
function($filter) {
|
||||||
|
return function(inputArray) {
|
||||||
|
var returnArray = [];
|
||||||
|
for (var x=0; x < inputArray.length; x++) {
|
||||||
|
if (inputArray[x]['attended']) {
|
||||||
|
returnArray.push(inputArray[x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnArray;
|
||||||
|
};
|
||||||
|
}]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/* nav-bar padding */
|
/* nav-bar padding */
|
||||||
body { padding-top: 70px; }
|
body { padding-top: 70px; }
|
||||||
|
|
||||||
|
@ -37,6 +36,11 @@ body { padding-top: 70px; }
|
||||||
.min200 { min-width: 200px; }
|
.min200 { min-width: 200px; }
|
||||||
.min250 { min-width: 250px; }
|
.min250 { min-width: 250px; }
|
||||||
|
|
||||||
|
/* horizontally center */
|
||||||
|
.hcenter {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
/* vertically center */
|
/* vertically center */
|
||||||
.vcenter {
|
.vcenter {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
Loading…
Reference in a new issue