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

99 lines
No EOL
6.1 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="px-4 py-6 sm:px-0">
<div class="flex justify-between items-center mb-6">
<div>
<h1 class="text-2xl font-semibold text-gray-900">Platform Channels</h1>
<p class="mt-1 text-sm text-gray-600">Manage channels for publishing content</p>
</div>
<a href="{{ route('channels.create') }}" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Add New Channel
</a>
</div>
@if(session('success'))
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4">
{{ session('success') }}
</div>
@endif
<div class="bg-white shadow overflow-hidden sm:rounded-md">
@if($channels->count() > 0)
<ul class="divide-y divide-gray-200">
@foreach($channels as $channel)
<li>
<div class="px-4 py-4 flex items-center justify-between">
<div class="flex items-center">
<div class="flex-shrink-0">
<x-heroicon-o-hashtag class="w-5 h-5 text-gray-400" />
</div>
<div class="ml-4">
<div class="flex items-center">
<div class="text-sm font-medium text-gray-900">{{ $channel->display_name ?? $channel->name }}</div>
@if(!$channel->is_active)
<span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
Inactive
</span>
@else
<span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
Active
</span>
@endif
<span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
{{ $channel->platformInstance->name }}
</span>
</div>
<div class="text-sm text-gray-500">{{ $channel->name }}</div>
@if($channel->description)
<div class="text-sm text-gray-500 mt-1">{{ Str::limit($channel->description, 100) }}</div>
@endif
</div>
</div>
<div class="flex items-center space-x-3">
<!-- Toggle Switch -->
<form action="{{ route('channels.toggle', $channel) }}" method="POST" class="inline">
@csrf
<label class="inline-flex items-center cursor-pointer">
<span class="text-xs text-gray-600 mr-2">{{ $channel->is_active ? 'Active' : 'Inactive' }}</span>
<button type="submit" class="relative inline-flex h-6 w-11 items-center rounded-full transition-colors {{ $channel->is_active ? 'bg-green-600' : 'bg-gray-200' }}">
<span class="inline-block h-4 w-4 transform rounded-full bg-white transition-transform {{ $channel->is_active ? 'translate-x-6' : 'translate-x-1' }}"></span>
</button>
</label>
</form>
<!-- Action Buttons -->
<a href="{{ route('channels.show', $channel) }}" class="text-indigo-600 hover:text-indigo-900 text-sm font-medium">
View
</a>
<a href="{{ route('channels.edit', $channel) }}" class="text-indigo-600 hover:text-indigo-900 text-sm font-medium">
Edit
</a>
<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="text-red-600 hover:text-red-900 text-sm font-medium">
Delete
</button>
</form>
</div>
</div>
</li>
@endforeach
</ul>
@else
<div class="text-center py-12">
<x-heroicon-o-hashtag class="w-24 h-24 text-gray-400 mb-4" />
<h3 class="text-lg font-medium text-gray-900 mb-2">No channels yet</h3>
<p class="text-gray-500 mb-4">Get started by adding your first publishing channel.</p>
<a href="{{ route('channels.create') }}" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Add New Channel
</a>
</div>
@endif
</div>
</div>
</div>
@endsection