salix/modules/worker/front/time-control/index.html

89 lines
3.3 KiB
HTML
Raw Normal View History

2019-05-17 11:27:51 +00:00
<vn-crud-model
vn-id="model"
2019-10-23 15:38:35 +00:00
url="api/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-10-23 15:38:35 +00:00
<vn-card class="vn-pa-lg vn-w-md">
<vn-table model="model" auto-load="false">
<vn-thead>
2019-05-17 11:27:51 +00:00
<vn-tr>
2019-10-23 15:38:35 +00:00
<vn-td ng-repeat="weekday in $ctrl.weekDays" center>
<div translate>{{::$ctrl.weekdayNames[$index].name}}</div>
<span>{{::weekday.dated | date: 'dd'}}</span>
<span title="{{::weekday.dated | date: 'MMMM' | translate}}" translate>
{{::weekday.dated | date: 'MMMM'}}
</span>
</vn-td>
</vn-tr>
</vn-thead>
<vn-tbody>
<vn-tr>
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" center>
<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>
<span class="chip {{$ctrl.hourColor(hour)}}">{{hour.timed | date: 'HH:mm'}}</span>
</section>
</vn-td>
</vn-tr>
</vn-tbody>
<vn-tfoot>
<vn-tr>
<vn-td ng-repeat="weekday in $ctrl.weekDays" center>
2019-05-21 10:56:29 +00:00
{{$ctrl.getWeekdayTotalHours(weekday)}} 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">
<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-05-17 11:27:51 +00:00
on-response="$ctrl.addTime(response)">
<tpl-body>
<div>
<h5 style="text-align: center">
<span translate>Add time</span>
</h5>
<vn-input-time
vn-one
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.newTime"
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>