104 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			104 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<x-app-layout>
 | 
						|
    <x-slot name="header">
 | 
						|
        <div class="flex items-center justify-between">
 | 
						|
            <h2 class="text-xl font-semibold leading-tight">
 | 
						|
                {{ $event->exists ? __('Edit Event') : __('Create Event') }}
 | 
						|
            </h2>
 | 
						|
 | 
						|
            {{-- “Back” breadcrumb --}}
 | 
						|
            <a href="{{ route('calendars.show', $calendar) }}"
 | 
						|
               class="text-sm text-gray-500 hover:text-gray-700">
 | 
						|
                ← {{ $calendar->name }}
 | 
						|
            </a>
 | 
						|
        </div>
 | 
						|
    </x-slot>
 | 
						|
 | 
						|
    <div class="py-6">
 | 
						|
        <div class="max-w-2xl mx-auto sm:px-6 lg:px-8">
 | 
						|
            <div class="bg-white shadow sm:rounded-lg p-6">
 | 
						|
                <form method="POST"
 | 
						|
                      action="{{ $event->exists
 | 
						|
                                ? route('calendars.events.update', [$calendar, $event])
 | 
						|
                                : route('calendars.events.store',  $calendar) }}">
 | 
						|
 | 
						|
                    @csrf
 | 
						|
                    @if($event->exists)
 | 
						|
                        @method('PUT')
 | 
						|
                    @endif
 | 
						|
 | 
						|
                    {{-- Title --}}
 | 
						|
                    <div class="mb-6">
 | 
						|
                        <x-input-label for="title" :value="__('Title')" />
 | 
						|
                        <x-text-input id="title" name="title" type="text" class="mt-1 block w-full"
 | 
						|
                                      :value="old('title', $event->meta->title)" required autofocus />
 | 
						|
                        <x-input-error class="mt-2" :messages="$errors->get('title')" />
 | 
						|
                    </div>
 | 
						|
 | 
						|
                    {{-- Description --}}
 | 
						|
                    <div class="mb-6">
 | 
						|
                        <x-input-label for="description" :value="__('Description')" />
 | 
						|
                        <textarea id="description" name="description" rows="3"
 | 
						|
                                  class="mt-1 block w-full rounded-md shadow-sm border-gray-300 focus:border-indigo-300 focus:ring">{{ old('description', $event->meta->description) }}</textarea>
 | 
						|
                        <x-input-error class="mt-2" :messages="$errors->get('description')" />
 | 
						|
                    </div>
 | 
						|
 | 
						|
                    {{-- Location --}}
 | 
						|
                    <div class="mb-6">
 | 
						|
                        <x-input-label for="location" :value="__('Location')" />
 | 
						|
                        <x-text-input id="location" name="location" type="text" class="mt-1 block w-full"
 | 
						|
                                      :value="old('location', $event->meta->location)" />
 | 
						|
                        <x-input-error class="mt-2" :messages="$errors->get('location')" />
 | 
						|
                    </div>
 | 
						|
 | 
						|
                    {{-- Start / End --}}
 | 
						|
                    <div class="grid grid-cols-1 sm:grid-cols-2 gap-6 mb-6">
 | 
						|
 | 
						|
                        <div>
 | 
						|
                            <x-input-label for="start_at" :value="__('Starts')" />
 | 
						|
                            <x-text-input id="start_at" name="start_at" type="datetime-local"
 | 
						|
                                          class="mt-1 block w-full"
 | 
						|
                                          :value="old('start_at', $event->meta->start_at
 | 
						|
                                              ? $event->meta->start_at->format('Y-m-d\TH:i')
 | 
						|
                                              : '')" required />
 | 
						|
                            <x-input-error class="mt-2" :messages="$errors->get('start_at')" />
 | 
						|
                        </div>
 | 
						|
 | 
						|
                        <div>
 | 
						|
                            <x-input-label for="end_at" :value="__('Ends')" />
 | 
						|
                            <x-text-input id="end_at" name="end_at" type="datetime-local"
 | 
						|
                                          class="mt-1 block w-full"
 | 
						|
                                          :value="old('end_at', $event->meta->end_at
 | 
						|
                                              ? $event->meta->end_at->format('Y-m-d\TH:i')
 | 
						|
                                              : '')" required />
 | 
						|
                            <x-input-error class="mt-2" :messages="$errors->get('end_at')" />
 | 
						|
                        </div>
 | 
						|
 | 
						|
                    </div>
 | 
						|
 | 
						|
                    {{-- All-day --}}
 | 
						|
                    <div class="flex items-center mb-6">
 | 
						|
                        <input id="all_day" name="all_day" type="checkbox" value="1"
 | 
						|
                               @checked(old('all_day', $event->meta->all_day)) />
 | 
						|
                        <label for="all_day" class="ms-2 text-sm text-gray-700">
 | 
						|
                            {{ __('All day event') }}
 | 
						|
                        </label>
 | 
						|
                    </div>
 | 
						|
 | 
						|
                    {{-- Submit --}}
 | 
						|
                    <div class="flex justify-end space-x-2">
 | 
						|
                        <a href="{{ route('calendars.show', $calendar) }}"
 | 
						|
                           class="inline-flex items-center px-4 py-2 bg-gray-200 rounded-md">
 | 
						|
                            {{ __('Cancel') }}
 | 
						|
                        </a>
 | 
						|
 | 
						|
                        <x-primary-button>
 | 
						|
                            {{ $event->exists ? __('Save') : __('Create') }}
 | 
						|
                        </x-primary-button>
 | 
						|
                    </div>
 | 
						|
 | 
						|
                </form>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
</x-app-layout>
 |