Add toolbars
This commit is contained in:
parent
3c64dee689
commit
f523362b90
|
@ -104,6 +104,7 @@ class MemberResource extends JsonResource
|
||||||
'comment' => $this->comment,
|
'comment' => $this->comment,
|
||||||
'links' => [
|
'links' => [
|
||||||
'show' => route('member.show', ['member' => $this->getModel()]),
|
'show' => route('member.show', ['member' => $this->getModel()]),
|
||||||
|
'edit' => route('member.edit', ['member' => $this->getModel()]),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.btn-warning {
|
&.btn-warning {
|
||||||
@apply bg-yellow-700;
|
@apply bg-yellow-700 text-yellow-300;
|
||||||
&:not(.disabled):hover {
|
&:not(.disabled):hover {
|
||||||
@apply bg-yellow-500;
|
@apply bg-yellow-500 text-yellow-100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.btn-info {
|
&.btn-info {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<i-link :href="href" class="btn label mr-2" :class="`btn-${color}`" v-tooltip="menuStore.tooltipsVisible ? $slots.default[0].text : ''">
|
<i-link :href="href" class="btn label mr-2" :class="colors[color]" v-tooltip="menuStore.tooltipsVisible ? $slots.default[0].text : ''">
|
||||||
<svg-sprite v-show="icon" class="w-3 h-3 xl:mr-2" :src="icon"></svg-sprite>
|
<svg-sprite v-show="icon" class="w-3 h-3 xl:mr-2" :src="icon"></svg-sprite>
|
||||||
<span class="hidden xl:inline"><slot></slot></span>
|
<span class="hidden xl:inline"><slot></slot></span>
|
||||||
</i-link>
|
</i-link>
|
||||||
|
@ -12,6 +12,11 @@ export default {
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
menuStore: menuStore(),
|
menuStore: menuStore(),
|
||||||
|
colors: {
|
||||||
|
primary: 'btn-primary',
|
||||||
|
warning: 'btn-warning',
|
||||||
|
info: 'btn-info',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<page-layout>
|
<page-layout>
|
||||||
<div class="flex" slot="toolbar">
|
<div class="flex" slot="toolbar">
|
||||||
<toolbar-button :href="meta.links.index" color="primary" icon="undo">zurück</toolbar-button>
|
<toolbar-button :href="meta.links.index" color="primary" icon="undo">zurück</toolbar-button>
|
||||||
|
<toolbar-button :href="data.links.edit" color="warning" icon="pencil">bearbeiten</toolbar-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-3 grid gap-3 this-grid grow">
|
<div class="p-3 grid gap-3 this-grid grow">
|
||||||
<box heading="Stammdaten" class="area-stamm hidden xl:block">
|
<box heading="Stammdaten" class="area-stamm hidden xl:block">
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<page-layout>
|
<page-layout>
|
||||||
<div class="flex" slot="toolbar">
|
<div class="flex" slot="toolbar">
|
||||||
<toolbar-button :href="meta.links.index" color="primary" icon="undo">zurück</toolbar-button>
|
<toolbar-button :href="meta.links.index" color="primary" icon="undo">zurück</toolbar-button>
|
||||||
|
<toolbar-button :href="data.links.show" color="primary" icon="eye">anschauen</toolbar-button>
|
||||||
</div>
|
</div>
|
||||||
<form class="flex grow relative" id="memberedit" @submit.prevent="submit">
|
<form class="flex grow relative" id="memberedit" @submit.prevent="submit">
|
||||||
<save-button form="memberedit"></save-button>
|
<save-button form="memberedit"></save-button>
|
||||||
|
|
Loading…
Reference in New Issue