split extra screens from dynamic single
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
<script setup lang="ts">
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { route } from 'ziggy-js';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
dynamic: {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
}>();
|
||||
|
||||
const form = useForm({
|
||||
email: '',
|
||||
role: 'participant',
|
||||
});
|
||||
|
||||
const breadcrumbs = [
|
||||
{
|
||||
name: 'Dynamics',
|
||||
href: route('dynamics.index'),
|
||||
},
|
||||
{
|
||||
name: props.dynamic.name,
|
||||
href: route('dynamics.show', props.dynamic.id),
|
||||
},
|
||||
{
|
||||
name: 'Invite User',
|
||||
href: route('dynamics.invitations.create', props.dynamic.id),
|
||||
},
|
||||
];
|
||||
|
||||
function submit() {
|
||||
form.post(route('dynamics.invitations.store', props.dynamic.id), {
|
||||
onSuccess: () => form.reset(),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Invite User" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="c-invite-user">
|
||||
<div class="c-invite-user__container">
|
||||
<div class="c-invite-user__card">
|
||||
<div class="c-invite-user__body">
|
||||
<h3 class="c-invite-user__title">
|
||||
Invite User to {{ dynamic.name }}
|
||||
</h3>
|
||||
|
||||
<form
|
||||
@submit.prevent="submit"
|
||||
class="c-invite-user__form"
|
||||
>
|
||||
<div class="c-invite-user__field">
|
||||
<label
|
||||
for="email"
|
||||
class="c-invite-user__label"
|
||||
>Email Address</label
|
||||
>
|
||||
<input
|
||||
v-model="form.email"
|
||||
id="email"
|
||||
type="email"
|
||||
required
|
||||
class="c-invite-user__input"
|
||||
/>
|
||||
<div
|
||||
v-if="form.errors.email"
|
||||
class="c-invite-user__error"
|
||||
>
|
||||
{{ form.errors.email }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="c-invite-user__field">
|
||||
<label
|
||||
for="role"
|
||||
class="c-invite-user__label"
|
||||
>Role</label
|
||||
>
|
||||
<select
|
||||
v-model="form.role"
|
||||
id="role"
|
||||
class="c-invite-user__select"
|
||||
>
|
||||
<option value="owner">Owner (Full Control)</option>
|
||||
<option value="participant">Participant</option>
|
||||
<option value="editor">Editor</option>
|
||||
<option value="viewer">Viewer</option>
|
||||
</select>
|
||||
<div
|
||||
v-if="form.errors.role"
|
||||
class="c-invite-user__error"
|
||||
>
|
||||
{{ form.errors.role }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="c-invite-user__actions">
|
||||
<button
|
||||
type="submit"
|
||||
:disabled="form.processing"
|
||||
class="c-invite-user__submit-btn"
|
||||
>
|
||||
Send Invitation
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@reference "../../../css/app.css";
|
||||
|
||||
.c-invite-user {
|
||||
@apply py-12;
|
||||
}
|
||||
|
||||
.c-invite-user__container {
|
||||
@apply mx-auto max-w-7xl sm:px-6 lg:px-8;
|
||||
}
|
||||
|
||||
.c-invite-user__card {
|
||||
@apply overflow-hidden bg-white shadow-sm sm:rounded-lg dark:bg-gray-800;
|
||||
}
|
||||
|
||||
.c-invite-user__body {
|
||||
@apply p-6 text-gray-900 dark:text-gray-100;
|
||||
}
|
||||
|
||||
.c-invite-user__title {
|
||||
@apply text-lg font-medium;
|
||||
}
|
||||
|
||||
.c-invite-user__form {
|
||||
@apply mt-6 space-y-6;
|
||||
}
|
||||
|
||||
.c-invite-user__field {
|
||||
@apply block;
|
||||
}
|
||||
|
||||
.c-invite-user__label {
|
||||
@apply block text-sm font-medium text-gray-700 dark:text-gray-300;
|
||||
}
|
||||
|
||||
.c-invite-user__input {
|
||||
@apply mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 dark:focus:border-indigo-600 dark:focus:ring-indigo-600;
|
||||
}
|
||||
|
||||
.c-invite-user__select {
|
||||
@apply mt-1 block w-full rounded-md border-gray-300 bg-white p-2 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 dark:focus:border-indigo-600 dark:focus:ring-indigo-600;
|
||||
}
|
||||
|
||||
.c-invite-user__error {
|
||||
@apply text-sm text-red-600;
|
||||
}
|
||||
|
||||
.c-invite-user__actions {
|
||||
@apply flex items-center gap-4;
|
||||
}
|
||||
|
||||
.c-invite-user__submit-btn {
|
||||
@apply inline-flex items-center rounded-md border border-transparent bg-gray-800 px-4 py-2 text-xs font-semibold tracking-widest text-white uppercase transition duration-150 ease-in-out hover:bg-gray-700 focus:bg-gray-700 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-none active:bg-gray-900 dark:bg-gray-200 dark:text-gray-800 dark:hover:bg-white dark:focus:bg-white dark:focus:ring-offset-gray-800 dark:active:bg-gray-300;
|
||||
}
|
||||
</style>
|
||||
@@ -77,82 +77,13 @@ function submitInvite() {
|
||||
<!-- Ledgers List Component -->
|
||||
<LedgerList :dynamic-id="dynamic.id" :ledgers="dynamic.ledgers" />
|
||||
|
||||
<!-- Create Ledger Form Component -->
|
||||
<CreateLedgerForm :dynamic-id="dynamic.id" />
|
||||
|
||||
<!-- Invite Participant Form (Owners only) -->
|
||||
<div v-if="isOwner" class="c-invite-form">
|
||||
<div class="c-invite-form__card">
|
||||
<div class="c-invite-form__body">
|
||||
<h3 class="c-invite-form__title">
|
||||
Invite User to Dynamic
|
||||
</h3>
|
||||
|
||||
<form
|
||||
@submit.prevent="submitInvite"
|
||||
class="c-invite-form__form"
|
||||
>
|
||||
<div class="c-invite-form__field">
|
||||
<label
|
||||
for="invite_email"
|
||||
class="c-invite-form__label"
|
||||
>Email Address</label
|
||||
>
|
||||
<input
|
||||
v-model="inviteForm.email"
|
||||
id="invite_email"
|
||||
type="email"
|
||||
required
|
||||
class="c-invite-form__input"
|
||||
/>
|
||||
<div
|
||||
v-if="inviteForm.errors.email"
|
||||
class="c-invite-form__error"
|
||||
>
|
||||
{{ inviteForm.errors.email }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="c-invite-form__field">
|
||||
<label
|
||||
for="invite_role"
|
||||
class="c-invite-form__label"
|
||||
>Role</label
|
||||
>
|
||||
<select
|
||||
v-model="inviteForm.role"
|
||||
id="invite_role"
|
||||
class="c-invite-form__select"
|
||||
>
|
||||
<option value="owner">
|
||||
Owner (Full Access & Approvals)
|
||||
</option>
|
||||
<option value="participant">
|
||||
Participant (Add Suggestions)
|
||||
</option>
|
||||
<option value="editor">Editor</option>
|
||||
<option value="viewer">Viewer</option>
|
||||
</select>
|
||||
<div
|
||||
v-if="inviteForm.errors.role"
|
||||
class="c-invite-form__error"
|
||||
>
|
||||
{{ inviteForm.errors.role }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="c-invite-form__actions">
|
||||
<button
|
||||
type="submit"
|
||||
:disabled="inviteForm.processing"
|
||||
class="c-invite-form__submit-btn"
|
||||
>
|
||||
Send Invitation
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="isOwner" class="mt-8 flex gap-4">
|
||||
<Link :href="route('dynamics.invitations.create', dynamic.id)" class="c-dynamic-show__action-btn">
|
||||
Invite User
|
||||
</Link>
|
||||
<Link :href="route('dynamics.ledgers.create', dynamic.id)" class="c-dynamic-show__action-btn">
|
||||
Create Ledger
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,4 +124,8 @@ function submitInvite() {
|
||||
.c-dynamic-show__settings-btn {
|
||||
@apply inline-flex items-center rounded-md border border-transparent bg-gray-800 px-4 py-2 text-xs font-semibold tracking-widest text-white uppercase transition duration-150 ease-in-out hover:bg-gray-700 focus:bg-gray-700 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-none active:bg-gray-900 dark:bg-gray-200 dark:text-gray-800 dark:hover:bg-white dark:focus:bg-white dark:focus:ring-offset-gray-800 dark:active:bg-gray-300;
|
||||
}
|
||||
|
||||
.c-dynamic-show__action-btn {
|
||||
@apply inline-flex items-center rounded-md border border-transparent bg-gray-800 px-4 py-2 text-xs font-semibold tracking-widest text-white uppercase transition duration-150 ease-in-out hover:bg-gray-700 focus:bg-gray-700 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-none active:bg-gray-900 dark:bg-gray-200 dark:text-gray-800 dark:hover:bg-white dark:focus:bg-white dark:focus:ring-offset-gray-800 dark:active:bg-gray-300;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user