2019-05-17 11:27:51 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
|
|
|
url="/worker/api/WorkerTimeControls/filter"
|
|
|
|
filter="::$ctrl.filter"
|
|
|
|
data="$ctrl.hours">
|
|
|
|
</vn-crud-model>
|
|
|
|
<div class="main-with-right-menu">
|
2019-10-04 22:16:57 +00:00
|
|
|
<vn-card class="compact vn-pa-lg">
|
2019-05-17 11:27:51 +00:00
|
|
|
<vn-horizontal>
|
|
|
|
<vn-table model="model" auto-load="false" vn-one>
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" center>
|
|
|
|
<div translate>{{::$ctrl.weekdayNames[$index].name}}</div>
|
2019-05-21 10:56:29 +00:00
|
|
|
<span>{{::weekday.dated | date: 'dd'}}</span>
|
|
|
|
<span title="{{::weekday.dated | date: 'MMMM' | translate}}" translate>
|
|
|
|
{{::weekday.dated | date: 'MMMM'}}
|
|
|
|
</span>
|
2019-05-17 11:27:51 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
|
|
|
<vn-tr>
|
2019-10-04 22:16:57 +00:00
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" center>
|
2019-05-21 10:56:29 +00:00
|
|
|
<section ng-repeat="hour in weekday.hours" center>
|
|
|
|
<vn-icon
|
|
|
|
icon="arrow_{{($index % 2) == 0 ? 'forward' : 'back'}}"
|
|
|
|
title="{{(($index % 2) == 0 ? 'In' : 'Out') | translate}}">
|
|
|
|
</vn-icon>
|
2019-08-06 10:25:53 +00:00
|
|
|
<span class="chip {{$ctrl.hourColor(hour)}}">{{hour.timed | dateTime: 'HH:mm'}}</span>
|
2019-05-21 10:56:29 +00:00
|
|
|
</section>
|
2019-05-17 11:27:51 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
<vn-tfoot>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-td center ng-repeat="weekday in $ctrl.weekDays">
|
2019-05-21 10:56:29 +00:00
|
|
|
{{$ctrl.getWeekdayTotalHours(weekday)}} h.
|
2019-05-17 11:27:51 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-td center ng-repeat="weekday in $ctrl.weekDays">
|
|
|
|
<vn-icon-button icon="add_circle"
|
|
|
|
vn-tooltip="Add time"
|
|
|
|
ng-click="$ctrl.showAddTimeDialog(weekday)">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tfoot>
|
|
|
|
</vn-table>
|
|
|
|
</vn-horizontal>
|
|
|
|
</vn-card>
|
|
|
|
<vn-side-menu side="right">
|
2019-10-04 22:16:57 +00:00
|
|
|
<vn-vertical class="vn-pa-sm">
|
2019-05-17 11:27:51 +00:00
|
|
|
<vn-vertical class="totalBox">
|
|
|
|
<h6 translate>Hours</h6>
|
|
|
|
<vn-label-value
|
|
|
|
label="Week total"
|
|
|
|
value="{{$ctrl.weekTotalHours}} {{'Hours' | translate}}">
|
|
|
|
</vn-label-value>
|
|
|
|
</vn-vertical>
|
|
|
|
</vn-vertical>
|
2019-10-04 22:16:57 +00:00
|
|
|
<vn-calendar class="vn-pa-sm"
|
2019-05-17 11:27:51 +00:00
|
|
|
data="$ctrl.currentWeek"
|
|
|
|
default-date="$ctrl.defaultDate"
|
2019-10-01 11:45:43 +00:00
|
|
|
on-selection="$ctrl.onSelection($days)"
|
2019-05-17 11:27:51 +00:00
|
|
|
on-move-next="$ctrl.onMoveNext()"
|
|
|
|
on-move-previous="$ctrl.onMovePrevious()">
|
|
|
|
</vn-calendar>
|
|
|
|
</vn-side-menu>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<vn-dialog vn-id="addTimeDialog"
|
|
|
|
on-response="$ctrl.addTime(response)">
|
|
|
|
<tpl-body>
|
|
|
|
<div>
|
|
|
|
<h5 style="text-align: center">
|
|
|
|
<span translate>Add time</span>
|
|
|
|
</h5>
|
2019-10-08 21:57:02 +00:00
|
|
|
<vn-input-time
|
|
|
|
vn-one
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.newTime"
|
2019-10-08 21:57:02 +00:00
|
|
|
label="Hour"
|
|
|
|
vn-focus>
|
|
|
|
</vn-input-time>
|
2019-05-17 11:27:51 +00:00
|
|
|
</div>
|
|
|
|
</tpl-body>
|
|
|
|
<tpl-buttons>
|
|
|
|
<input type="button" response="CANCEL" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="ACCEPT" translate>Save</button>
|
|
|
|
</tpl-buttons>
|
|
|
|
</vn-dialog>
|