2019-05-17 11:27:51 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="WorkerTimeControls/filter"
|
2019-05-17 11:27:51 +00:00
|
|
|
filter="::$ctrl.filter"
|
|
|
|
data="$ctrl.hours">
|
|
|
|
</vn-crud-model>
|
|
|
|
<div class="main-with-right-menu">
|
2019-11-05 07:59:48 +00:00
|
|
|
<vn-card class="vn-pa-lg vn-w-lg">
|
2019-10-23 15:38:35 +00:00
|
|
|
<vn-table model="model" auto-load="false">
|
|
|
|
<vn-thead>
|
2019-05-17 11:27:51 +00:00
|
|
|
<vn-tr>
|
2019-11-05 07:59:48 +00:00
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" center>
|
|
|
|
<div class="weekday" translate>{{::$ctrl.weekdayNames[$index].name}}</div>
|
|
|
|
<div>
|
|
|
|
<span>{{::weekday.dated | date: 'dd'}}</span>
|
|
|
|
<span title="{{::weekday.dated | date: 'MMMM' | translate}}" translate>
|
|
|
|
{{::weekday.dated | date: 'MMMM'}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<vn-chip
|
|
|
|
title="{{::weekday.event.name}}"
|
|
|
|
ng-class="{invisible: !weekday.event}">
|
|
|
|
<vn-avatar
|
|
|
|
ng-style="::{backgroundColor: weekday.event.color}">
|
|
|
|
</vn-avatar>
|
|
|
|
<div>
|
|
|
|
{{::weekday.event.name}}
|
|
|
|
</div>
|
|
|
|
</vn-chip>
|
2019-10-23 15:38:35 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
|
|
|
<vn-tr>
|
2019-11-05 07:59:48 +00:00
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" expand center>
|
2019-10-23 15:38:35 +00:00
|
|
|
<section ng-repeat="hour in weekday.hours" center>
|
|
|
|
<vn-icon
|
2019-11-05 07:59:48 +00:00
|
|
|
icon="{{
|
|
|
|
::hour.direction == 'in' ? 'arrow_forward'
|
|
|
|
: hour.direction == 'out' ? 'arrow_back'
|
|
|
|
: 'arrow_forward'
|
|
|
|
}}"
|
|
|
|
title="{{
|
|
|
|
::(hour.direction == 'in' ? 'In'
|
|
|
|
: hour.direction == 'out' ? 'Out'
|
|
|
|
: '') | translate
|
|
|
|
}}"
|
|
|
|
ng-class="::{'invisible': hour.direction == 'middle'}">
|
2019-10-23 15:38:35 +00:00
|
|
|
</vn-icon>
|
2019-11-05 07:59:48 +00:00
|
|
|
<vn-chip
|
|
|
|
ng-class="::{'colored': hour.manual}"
|
|
|
|
removable="::hour.manual"
|
|
|
|
translate-attr="{title: 'Category'}"
|
|
|
|
on-remove="$ctrl.showDeleteDialog(hour)">
|
|
|
|
{{::hour.timed | date: 'HH:mm'}}
|
|
|
|
</vn-chip>
|
2019-10-23 15:38:35 +00:00
|
|
|
</section>
|
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
<vn-tfoot>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" center>
|
2019-11-05 07:59:48 +00:00
|
|
|
{{$ctrl.formatHours(weekday.workedHours)}} h.
|
2019-05-17 11:27:51 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
2019-10-23 15:38:35 +00:00
|
|
|
<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>
|
2019-05-17 11:27:51 +00:00
|
|
|
</vn-card>
|
|
|
|
<vn-side-menu side="right">
|
2019-10-23 15:38:35 +00:00
|
|
|
<div class="vn-pa-md">
|
2019-11-05 07:59:48 +00:00
|
|
|
<div style="text-align: center;">
|
|
|
|
<vn-label-value
|
|
|
|
label="Finish at"
|
|
|
|
value="{{$ctrl.getFinishTime()}}">
|
|
|
|
</vn-label-value>
|
|
|
|
</div>
|
2019-10-23 15:38:35 +00:00
|
|
|
<div class="totalBox" style="text-align: center;">
|
2019-05-17 11:27:51 +00:00
|
|
|
<h6 translate>Hours</h6>
|
|
|
|
<vn-label-value
|
|
|
|
label="Week total"
|
2019-10-23 15:38:35 +00:00
|
|
|
value="{{$ctrl.weekTotalHours}} h.">
|
2019-05-17 11:27:51 +00:00
|
|
|
</vn-label-value>
|
2019-10-23 15:38:35 +00:00
|
|
|
</div>
|
|
|
|
<vn-calendar
|
|
|
|
class="vn-pt-md"
|
|
|
|
ng-model="$ctrl.date"
|
|
|
|
has-events="$ctrl.hasEvents($day)">
|
|
|
|
</vn-calendar>
|
|
|
|
</div>
|
2019-05-17 11:27:51 +00:00
|
|
|
</vn-side-menu>
|
|
|
|
</div>
|
2019-10-23 15:38:35 +00:00
|
|
|
<vn-dialog
|
|
|
|
vn-id="addTimeDialog"
|
2019-10-30 15:57:14 +00:00
|
|
|
on-response="$ctrl.addTime($response)">
|
2019-05-17 11:27:51 +00:00
|
|
|
<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>
|
2019-10-30 15:57:14 +00:00
|
|
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="accept" translate>Save</button>
|
2019-05-17 11:27:51 +00:00
|
|
|
</tpl-buttons>
|
2019-11-05 07:59:48 +00:00
|
|
|
</vn-dialog>
|
|
|
|
<vn-confirm
|
|
|
|
vn-id="delete-entry-dialog"
|
|
|
|
on-response="$ctrl.deleteTimeEntry(response)"
|
|
|
|
message="This time entry will be deleted"
|
|
|
|
question="Are you sure you want to delete this entry?">
|
|
|
|
</vn-confirm>
|