fedi-feed-router/resources/views/pages/channels/edit.blade.php

104 lines
No EOL
6.2 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="max-w-2xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="px-4 py-6 sm:px-0">
<div class="mb-6">
<h1 class="text-2xl font-semibold text-gray-900">Edit Channel</h1>
<p class="mt-1 text-sm text-gray-600">Update channel details</p>
</div>
<div class="bg-white shadow sm:rounded-lg">
<form action="{{ route('channels.update', $channel) }}" method="POST" class="px-4 py-5 sm:p-6">
@csrf
@method('PUT')
<div class="grid grid-cols-1 gap-6">
<div>
<label for="platform_instance_id" class="block text-sm font-medium text-gray-700">Platform</label>
<select name="platform_instance_id" id="platform_instance_id" required
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('platform_instance_id') border-red-300 @enderror">
@foreach($instances as $instance)
<option value="{{ $instance->id }}" {{ old('platform_instance_id', $channel->platform_instance_id) == $instance->id ? 'selected' : '' }}>
{{ $instance->name }}
</option>
@endforeach
</select>
@error('platform_instance_id')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<div>
<label for="name" class="block text-sm font-medium text-gray-700">Channel Name</label>
<input type="text" name="name" id="name" required
value="{{ old('name', $channel->name) }}"
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('name') border-red-300 @enderror">
@error('name')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<div>
<label for="display_name" class="block text-sm font-medium text-gray-700">Display Name</label>
<input type="text" name="display_name" id="display_name"
value="{{ old('display_name', $channel->display_name) }}"
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('display_name') border-red-300 @enderror">
@error('display_name')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<div>
<label for="channel_id" class="block text-sm font-medium text-gray-700">Channel ID</label>
<input type="text" name="channel_id" id="channel_id"
value="{{ old('channel_id', $channel->channel_id) }}"
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('channel_id') border-red-300 @enderror">
@error('channel_id')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<div>
<label for="description" class="block text-sm font-medium text-gray-700">Description</label>
<textarea name="description" id="description" rows="3"
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('description') border-red-300 @enderror">{{ old('description', $channel->description) }}</textarea>
@error('description')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<div class="flex items-center">
<input type="checkbox" name="is_active" id="is_active" value="1"
{{ old('is_active', $channel->is_active) ? 'checked' : '' }}
class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
<label for="is_active" class="ml-2 block text-sm text-gray-900">
Active (channel can receive published content)
</label>
</div>
</div>
<div class="mt-6 flex items-center justify-between">
<form action="{{ route('channels.destroy', $channel) }}" method="POST" class="inline"
onsubmit="return confirm('Are you sure you want to delete this channel?')">
@csrf
@method('DELETE')
<button type="submit" class="bg-red-600 py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white hover:bg-red-700">
Delete Channel
</button>
</form>
<div class="flex items-center space-x-3">
<a href="{{ route('channels.show', $channel) }}" class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50">
Cancel
</a>
<button type="submit" class="bg-indigo-600 py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white hover:bg-indigo-700">
Update Channel
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection