fixes #9: number of attendees counter

This commit is contained in:
Davide Alberani 2017-01-17 19:25:56 +01:00
parent 47d34f805a
commit a6a4deff70

View file

@ -4,7 +4,7 @@
<md-card-header class="group-header">
<md-layout md-row>
<div class="md-title">
<md-icon class="group-icon">folder_open</md-icon>&nbsp;Group: {{ group.group }}
<md-icon class="group-icon">folder_open</md-icon>&nbsp;Group: {{ group.group }}&nbsp;<span class="counter">{{ counter }}</span>
</div>
</md-layout>
</md-card-header>
@ -54,6 +54,12 @@ export default {
return { newAttendee: '', newGroup: '' }
},
computed: {
counter: function() {
return (this.group.attendees || []).length;
}
},
beforeCreate: function() {
this.attendeesUrl = this.$resource('attendees{/id}');
},
@ -127,4 +133,17 @@ export default {
.new-group-header i:after {
background-color: initial !important;
}
.counter {
margin-left: 4px;
position: relative;
bottom: 12px;
background-color: #eee;
color: #666;
padding: 2px 5px;
border-radius: 20px;
font-size: 12px;
font-weight: 200;
line-height: 1;
}
</style>