This commit is contained in:
2024-09-28 17:37:29 +02:00
parent 8dfafa9404
commit fb4d566007
64 changed files with 32325 additions and 573 deletions
@@ -2,7 +2,7 @@
{% block component %}
<v-data-table
:headers="items_headers"
:headers="citems_headers"
:items="items"
:items-per-page="50"
:search="search"
@@ -34,17 +34,29 @@
<v-row>
<template v-for="field in editable_fields">
<template v-if="field.field_widget == 'v-select'">
<v-select
v-model="editedItem[field.value]"
:items="items_relations[field.value]"
:label="field.text"
item-text="name"
item-value="id"
persistent-hint>
<template slot="item" slot-scope="data">
[[ data.item.name ]] - [[ data.item.custom_identifier ]]
</template>
</v-select>
<template v-if="field.choices">
<v-select
v-model="editedItem[field.value]"
:items="field.choices"
:label="field.text"
item-text="text"
item-value="value"
persistent-hint>
</v-select>
</template>
<template v-else>
<v-select
v-model="editedItem[field.value]"
:items="items_relations[field.value]"
:label="field.text"
item-text="name"
item-value="id"
persistent-hint>
<template slot="item" slot-scope="data">
[[ data.item.name ]] - [[ data.item.custom_identifier ]]
</template>
</v-select>
</template>
</template>
<template v-else>
<component :is="field.field_widget" v-model="editedItem[field.value]" :label="field.text"></component>
@@ -91,7 +103,23 @@
<template v-slot:item.id="{ item }">
[[ item.id.slice(0, 8) ]]...
</template>
<template v-slot:item.description="{ item }">
<template v-if="item.description && item.description.length > 15">
[[ item.description.slice(0, 15) ]]...
</template>
<template v-else>
[[ item.description ]]
</template>
</template>
<template v-slot:item.last_modified_at="{ item }">
[[ formatDate(item.last_modified_at) ]]
</template>
<template v-slot:item.created_at="{ item }">
[[ formatDate(item.created_at) ]]
</template>
<template v-slot:item.actions="{ item }">
<v-icon v-if="show_url" small class="mr-2" @click="showItem(item)">mdi-eye</v-icon>
<v-icon small class="mr-2" @click="editItem(item)">mdi-pencil</v-icon>
<v-icon small @click="deleteItem(item)">mdi-delete</v-icon>
</template>