47 lines
1.5 KiB
HTML
47 lines
1.5 KiB
HTML
<vn-crud-model
|
|
vn-id="model"
|
|
url="/worker/api/departments/getLeaves"
|
|
auto-load="false">
|
|
</vn-crud-model>
|
|
<div class="content-block" compact>
|
|
<form name="form" compact>
|
|
<vn-card margin-medium-v pad-medium>
|
|
<vn-treeview vn-id="treeview" root-label="Departments" read-only="false"
|
|
fetch-func="$ctrl.onFetch($item)"
|
|
remove-func="$ctrl.onRemove($item)"
|
|
create-func="$ctrl.onCreate($parent)"
|
|
sort-func="$ctrl.onSort($a, $b)">
|
|
{{::item.name}}
|
|
</vn-treeview>
|
|
</vn-card>
|
|
<vn-button-bar>
|
|
<vn-button ui-sref="worker.index" label="Back"></vn-button>
|
|
</vn-button-bar>
|
|
</form>
|
|
</div>
|
|
<vn-confirm
|
|
vn-id="deleteNode"
|
|
on-response="$ctrl.onRemoveResponse(response)"
|
|
question="Delete department"
|
|
message="Are you sure you want to delete it?">
|
|
</vn-confirm>
|
|
|
|
<!-- Create department dialog -->
|
|
<vn-dialog
|
|
vn-id="createNode"
|
|
on-open="$ctrl.onCreateDialogOpen()"
|
|
on-response="$ctrl.onCreateResponse(response)">
|
|
<tpl-body>
|
|
<h5 pad-small-v translate>New department</h5>
|
|
<vn-horizontal>
|
|
<vn-textfield vn-one
|
|
label="Name"
|
|
model="$ctrl.newChild.name">
|
|
</vn-textfield>
|
|
</vn-horizontal>
|
|
</tpl-body>
|
|
<tpl-buttons>
|
|
<input type="button" response="CANCEL" translate-attr="{value: 'Cancel'}"/>
|
|
<button response="ACCEPT" translate>Create</button>
|
|
</tpl-buttons>
|
|
</vn-dialog> |