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

68 lines
2.3 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-02 23:13:00 +02:00
<div class="flex" slot="toolbar">
<toolbar-button :href="data.meta.links.create" color="primary" icon="plus">Tätigkeit erstellen</toolbar-button>
</div>
2023-02-25 19:12:07 +01:00
<popup heading="Bitte bestätigen" v-if="deleting !== null">
<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>
</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">
<v-pages class="mt-4" :value="data.meta" :only="['data']"></v-pages>
</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
components: {
2023-05-09 01:34:19 +02:00
popup: () => import(/* webpackChunkName: "ui" */ '../../components/Ui/Popup.vue'),
2023-02-25 19:12:07 +01:00
},
mixins: [indexHelpers],
2023-02-23 22:43:13 +01:00
};
</script>