<div ng-controller="GroupAttendanceController">
    <form class="form-horizontal well">
        <api-validate></api-validate>
        <fieldset>
            <legend>{{'label.heading.attendance' | translate}}</legend>
            <div class="form-group">
                <label class="control-label col-sm-2">{{'label.input.meetingdate' | translate}}<span
                        class="required">*</span></label>

                <div class="col-sm-3">
                    <input type="text" datepicker-pop="dd MMMM yyyy" ng-model="first.date" is-open="opened"
                           min="minDate" max="'2020-06-22'" class="form-control"/>{{'label.nextmettingon' |
                    translate}}:{{meeting.nextTenRecurringDates[0] | DateFormat}}
                </div>
                <div class="col-sm-5">
                    <table class="table table-striped" width="100%">
		                <thead>
		                <tr class="graybg">
		                    <th>{{ 'label.heading.name' | translate }}</th>
		                    <th>{{ 'label.heading.attendance' | translate }}</th>
		                </tr>
		                </thead>
		                <tbody>
		                <tr ng-repeat="client in clients">
		                    <td>{{client.displayName}}<span class="required">*</span></td>
		                    <td>
		                        <div>
		                            <select ng-model="client.attendanceType"
		                                    ng-options="attendance.id as attendance.value for attendance in attendanceOptions"
		                                    value="{{attendance.id}}" class="form-control">
		                            </select>
		                        </div>
		                    </td>
		                </tr>
		                </tbody>
		            </table>
                </div>
            </div>
            <div class="col-md-offset-5">
                <a id="cancel" href="#/viewgroup/{{group.id}}" class="btn btn-default">{{'label.button.cancel' | translate}}</a>
                <button id="save" type="button" class="btn btn-primary" data-ng-click="attendanceUpdate(meeting.id)" has-permission='SAVEORUPDATEATTENDANCE_MEETING'> {{'label.button.save' | translate}} </button>
            </div>
        </fieldset>
    </form>
</div>