Merge pull request #125 from alberanid/master
show number of attendees in the list of events
This commit is contained in:
commit
a1069f025d
4 changed files with 28 additions and 4 deletions
|
@ -30,6 +30,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th><strong>{{'Event' | translate}}</strong></th>
|
||||
<th class="hcenter"><strong>{{'Attendees / Registered' | translate}}</strong></th>
|
||||
<th><strong>{{'Delete' | translate}}</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -37,9 +38,12 @@
|
|||
<tr ng-repeat="event in events | splittedFilter:query | orderBy:eventsOrderProp">
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td class="hcenter">
|
||||
<p><span ng-init="attendeesNr = (event.persons | attendeesFilter).length">{{attendeesNr}}</span> / {{event.persons.length || 0}}</p>
|
||||
</td>
|
||||
<td>
|
||||
<button ng-click="remove(event._id)" type="button" class="btn btn-link fa fa-trash fa-lg"></button>
|
||||
</td>
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
</div>
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<span ng-if="current_user" class="btn">{{current_user}}</span>
|
||||
<li ng-if="current_user">
|
||||
<span class="btn">{{current_user}}</span>
|
||||
<span class="btn btn-link">
|
||||
<a href="/logout"><span class="fa fa-sign-out vcenter"></span> {{'logout' | translate}}</a>
|
||||
</span>
|
||||
|
|
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 */
|
||||
body { padding-top: 70px; }
|
||||
|
||||
|
@ -37,6 +36,11 @@ body { padding-top: 70px; }
|
|||
.min200 { min-width: 200px; }
|
||||
.min250 { min-width: 250px; }
|
||||
|
||||
/* horizontally center */
|
||||
.hcenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* vertically center */
|
||||
.vcenter {
|
||||
vertical-align: middle;
|
||||
|
|
Loading…
Reference in a new issue