adrema/resources/js/views/activity/VIndex.vue

64 lines
2.2 KiB
Vue
Raw Normal View History

2023-02-23 22:43:13 +01:00
<template>
2023-04-29 23:41:26 +02:00
<page-layout page-class="pb-6">
2023-05-20 02:38:38 +02:00
<template #toolbar>
2023-05-19 01:06:46 +02:00
<page-toolbar-button :href="data.meta.links.create" color="primary" icon="plus">Tätigkeit erstellen</page-toolbar-button>
2023-05-20 02:38:38 +02:00
</template>
2023-05-19 01:06:46 +02:00
<ui-popup heading="Bitte bestätigen" v-if="deleting !== null">
2023-02-25 19:12:07 +01:00
<div>
2023-04-29 23:41:26 +02:00
<p class="mt-4">Diese Aktivität löschen?</p>
2023-02-25 19:12:07 +01:00
<div class="grid grid-cols-2 gap-3 mt-6">
<a href="#" @click.prevent="remove" class="text-center btn btn-danger">Löschen</a>
<a href="#" @click.prevent="deleting = null" class="text-center btn btn-primary">Abbrechen</a>
</div>
</div>
2023-05-19 01:06:46 +02:00
</ui-popup>
<table cellspacing="0" cellpadding="0" border="0" class="custom-table custom-table-sm table">
2023-02-23 22:43:13 +01:00
<thead>
2023-02-25 17:19:17 +01:00
<th>Name</th>
2023-02-23 22:43:13 +01:00
<th></th>
</thead>
2023-02-25 17:19:17 +01:00
<tr v-for="(activity, index) in inner.data" :key="index">
<td v-text="activity.name"></td>
2023-02-23 22:43:13 +01:00
<td>
2023-02-25 17:19:17 +01:00
<div class="flex space-x-1">
<i-link :href="activity.links.edit" class="inline-flex btn btn-warning btn-sm" v-tooltip="`bearbeiten`"><svg-sprite src="pencil"></svg-sprite></i-link>
2023-04-29 23:41:26 +02:00
<i-link href="#" @click.prevent="deleting = activity" class="inline-flex btn btn-danger btn-sm" v-tooltip="`Entfernen`"><svg-sprite src="trash"></svg-sprite></i-link>
2023-02-25 17:19:17 +01:00
</div>
2023-02-23 22:43:13 +01:00
</td>
</tr>
</table>
<div class="px-6">
2023-05-19 01:06:46 +02:00
<ui-pagination class="mt-4" :value="data.meta" :only="['data']"></ui-pagination>
2023-02-23 22:43:13 +01:00
</div>
2023-04-29 23:41:26 +02:00
</page-layout>
2023-02-23 22:43:13 +01:00
</template>
<script>
2023-02-25 17:19:17 +01:00
import indexHelpers from '../../mixins/indexHelpers';
2023-02-23 22:43:13 +01:00
export default {
2023-04-29 23:41:26 +02:00
data: function () {
2023-02-25 19:12:07 +01:00
return {
deleting: null,
};
},
methods: {
remove() {
var _self = this;
this.$inertia.delete(this.deleting.links.destroy, {
preserveState: true,
onSuccess(page) {
_self.inner = page.props.data;
_self.deleting = null;
2023-04-29 23:41:26 +02:00
},
2023-02-25 19:12:07 +01:00
});
2023-04-29 23:41:26 +02:00
},
2023-02-25 19:12:07 +01:00
},
2023-02-23 22:43:13 +01:00
2023-02-25 19:12:07 +01:00
mixins: [indexHelpers],
2023-02-23 22:43:13 +01:00
};
</script>