-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
360 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Outputs; | ||
|
||
use App\Domains\Outputs\OutputTypeEnum; | ||
use App\Http\Controllers\OutputController; | ||
|
||
class CalendarOutputController extends OutputController | ||
{ | ||
protected OutputTypeEnum $outputTypeEnum = OutputTypeEnum::CalendarOutput; | ||
|
||
protected string $edit_path = 'Outputs/Calendar/Edit'; | ||
|
||
protected string $show_path = 'Outputs/Calendar/Show'; | ||
|
||
protected string $create_path = 'Outputs/Calendar/Create'; | ||
|
||
protected string $info = 'This will use the events in the collection to create a calendar page'; | ||
|
||
protected string $type = 'Calendar Page'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup> | ||
import {Link} from "@inertiajs/vue3"; | ||
import Settings from "@/Pages/Outputs/Components/Settings.vue"; | ||
const props = defineProps({ | ||
output: Object | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="card rounded-none w-96 shadow-xl border border-neutral"> | ||
<div class="card-body"> | ||
<Settings :output="output"/> | ||
|
||
<div class="card-actions justify-between flex items-center"> | ||
<span class="badge badge-default">{{ output.type_formatted}}</span> | ||
<div class="flex justify-end gap-2 items-center"> | ||
<Link class="link" :href="route('calendar.show', { | ||
collection: output.collection_id, | ||
})">visit</Link> | ||
<Link :href="route('collections.outputs.calendar_output.edit', { | ||
collection: output.collection_id, | ||
output: output.id | ||
})" class="btn btn-primary rounded-none">Edit</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
55 changes: 55 additions & 0 deletions
55
resources/js/Pages/Outputs/Calendar/Components/Resources.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<div class="flex flex-col space-y-8 mt-4"> | ||
<div> | ||
<InputLabel value="Title"/> | ||
<input v-model="modelValue.title" type="text" placeholder="Title Here" | ||
class="rounded-none input input-bordered w-full " /> | ||
<InputError :message="modelValue.errors.title" /> | ||
</div> | ||
|
||
<div> | ||
<InputLabel value="Summary"/> | ||
<textarea v-model="modelValue.summary" class="rounded-none textarea textarea-bordered w-full mb-5" | ||
placeholder="This will be shown on the page (optional)" rows="5"></textarea> | ||
<InputError :message="modelValue.errors.summary" /> | ||
</div> | ||
<slot></slot> | ||
|
||
<div class="form-control w-24"> | ||
<label class="label cursor-pointer"> | ||
<span class="label-text">Active</span> | ||
<input type="checkbox" | ||
v-model="modelValue.active" | ||
:checked="modelValue.active" | ||
class="checkbox" /> | ||
</label> | ||
<InputError :message="modelValue.errors.active" /> | ||
</div> | ||
|
||
<div class="form-control w-24"> | ||
<label class="label cursor-pointer"> | ||
<span class="label-text">Public</span> | ||
<input type="checkbox" | ||
v-model="modelValue.public" | ||
:checked="modelValue.public" class="checkbox" /> | ||
</label> | ||
<InputError :message="modelValue.errors.public" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import InputError from "@/Components/InputError.vue"; | ||
import InputLabel from "@/Components/InputLabel.vue"; | ||
import {ref} from "vue"; | ||
const emit = defineEmits(['update:modelValue']) | ||
const props = defineProps({ | ||
modelValue: Object | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<script setup> | ||
import AppLayout from '@/Layouts/AppLayout.vue'; | ||
import PrimaryButton from '@/Components/PrimaryButton.vue'; | ||
import SecondaryButton from '@/Components/SecondaryButton.vue'; | ||
import {ref} from 'vue'; | ||
import Intro from '@/Components/Intro.vue'; | ||
import SecondaryLink from '@/Components/SecondaryLink.vue'; | ||
import Resources from './Components/Resources.vue'; | ||
import {useForm} from '@inertiajs/vue3'; | ||
import Generate from "@/Pages/Outputs/WebPage/Components/Generate.vue"; | ||
import Templates from "@/Components/Templates.vue"; | ||
const props = defineProps({ | ||
collection: { | ||
type: Object, | ||
required: true, | ||
} | ||
}); | ||
const form = useForm({ | ||
title: '', | ||
summary: '', | ||
active: false, | ||
public: false, | ||
}); | ||
const submit = () => { | ||
form.post( | ||
route('collections.outputs.calendar_output.store', { | ||
collection: props.collection.data.id | ||
}), { | ||
preserveScroll: true, | ||
onSuccess: () => { | ||
form.reset(); | ||
} | ||
}); | ||
} | ||
</script> | ||
|
||
<template> | ||
<AppLayout title="Create Web Page"> | ||
|
||
<div class="py-12"> | ||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> | ||
<div class="overflow-hidden shadow-xl rounded-none p-5"> | ||
<Intro></Intro> | ||
|
||
<form @submit.prevent="submit" class="p-10 "> | ||
<div class="flex"> | ||
<div class="w-3/4 border border-secondary rounded-none p-5"> | ||
|
||
<Resources | ||
:collection="collection.data" | ||
v-model="form"> | ||
|
||
</Resources> | ||
|
||
<div class="flex justify-end items-center gap-4"> | ||
<PrimaryButton type="submit"> | ||
Save | ||
</PrimaryButton> | ||
<SecondaryLink :href="route('collections.outputs.index', { | ||
collection: collection.data.id | ||
})"> | ||
Cancel | ||
</SecondaryLink> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</AppLayout> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<script setup> | ||
import AppLayout from '@/Layouts/AppLayout.vue'; | ||
import PrimaryButton from '@/Components/PrimaryButton.vue'; | ||
import SecondaryButton from '@/Components/SecondaryButton.vue'; | ||
import { ref } from 'vue'; | ||
import Intro from '@/Components/Intro.vue'; | ||
import SecondaryLink from '@/Components/SecondaryLink.vue'; | ||
import Resources from './Components/Resources.vue'; | ||
import { useForm } from '@inertiajs/vue3'; | ||
import {useToast} from "vue-toastification"; | ||
import Generate from "@/Pages/Outputs/WebPage/Components/Generate.vue"; | ||
import Delete from "@/Pages/Outputs/Components/Delete.vue"; | ||
import Templates from "@/Components/Templates.vue"; | ||
const toast = useToast(); | ||
const props = defineProps({ | ||
collection: { | ||
type: Object, | ||
required: true, | ||
}, | ||
output: { | ||
type: Object | ||
}, | ||
}); | ||
const form = useForm({ | ||
title: props.output.title, | ||
summary: props.output.summary, | ||
active: props.output.active, | ||
public: props.output.public, | ||
}); | ||
const submit = () => { | ||
form.put( | ||
route('collections.outputs.calendar_output.update', { | ||
collection: props.collection.data.id, | ||
output: props.output.id | ||
}), { | ||
preserveScroll: true, | ||
onSuccess: params => { | ||
toast.info("Updated"); | ||
} | ||
}); | ||
} | ||
</script> | ||
|
||
<template> | ||
<AppLayout title="Edit Web Page"> | ||
<div class="py-12"> | ||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> | ||
<div class="overflow-hidden shadow-xl rounded-none p-5"> | ||
<Intro></Intro> | ||
|
||
<form @submit.prevent="submit" class="p-10 "> | ||
<div class="flex"> | ||
<div class="w-3/4 border border-secondary rounded-none p-5 rounded-lg"> | ||
|
||
<Resources | ||
v-model="form"> | ||
</Resources> | ||
|
||
<div class="flex justify-end items-center gap-4"> | ||
<PrimaryButton type="submit"> | ||
Save | ||
</PrimaryButton> | ||
<SecondaryLink :href="route('collections.outputs.index', { | ||
collection: collection.data.id | ||
})"> | ||
Back | ||
</SecondaryLink> | ||
<Delete :output="output"></Delete> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</AppLayout> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<script setup> | ||
import { useToast } from 'vue-toastification'; | ||
import PageLayout from "@/Layouts/PageLayout.vue"; | ||
import Chat from "@/Pages/Outputs/WebPage/Components/Chat.vue"; | ||
import ChatSlideout from "@/Pages/Outputs/WebPage/Components/ChatSlideout.vue"; | ||
import {ref} from "vue"; | ||
const toast = useToast(); | ||
const props = defineProps({ | ||
output: { | ||
type: Object | ||
}, | ||
messages: Object | ||
}); | ||
const showSlideout = ref(false) | ||
</script> | ||
|
||
<template> | ||
<PageLayout :title="output.title"> | ||
<div class="mx-auto p-10"> | ||
<div class="bg-white rounded-t-lg min-h-screen w-3/4 mx-auto shadow-lg"> | ||
<div class="flex justify-start p-2"> | ||
<button | ||
class="btn btn-primary flex justify-start gap-3 items-center" | ||
type="button" @click="showSlideout = true"> | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z" /> | ||
</svg> | ||
|
||
<span>chat</span> | ||
</button> | ||
</div> | ||
<article class="prose prose-stone p-10"> | ||
<h1>{{ output.data.title }}</h1> | ||
|
||
<div v-html="output.data.summary" class="prose prose-xl"> | ||
</div> | ||
</article> | ||
</div> | ||
</div> | ||
<ChatSlideout | ||
:messages="messages" | ||
:output="output.data" | ||
@close="showSlideout = false" | ||
:show="showSlideout"> | ||
|
||
</ChatSlideout> | ||
</PageLayout> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.