2026-01-22 23:38:00 +01:00
|
|
|
<div class="p-6">
|
2026-07-25 20:08:19 +02:00
|
|
|
<x-page-header title="Feeds" subtitle="Manage your news feed sources">
|
|
|
|
|
<button
|
|
|
|
|
wire:click="openCreateModal"
|
|
|
|
|
class="inline-flex items-center px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
|
|
|
|
>
|
|
|
|
|
<svg class="h-4 w-4 mr-1.5" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
|
|
|
|
</svg>
|
|
|
|
|
Add Feed
|
|
|
|
|
</button>
|
|
|
|
|
</x-page-header>
|
2026-01-22 23:38:00 +01:00
|
|
|
|
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
|
|
|
@forelse ($feeds as $feed)
|
|
|
|
|
<div class="bg-white rounded-lg shadow p-6" wire:key="feed-{{ $feed->id }}">
|
|
|
|
|
<div class="flex items-start justify-between">
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
<div class="shrink-0">
|
|
|
|
|
@if ($feed->type === 'rss')
|
|
|
|
|
<svg class="h-8 w-8 text-orange-500" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-.75a7.5 7.5 0 0 0-7.5-7.5H4.5m0-6.75h.75c7.87 0 14.25 6.38 14.25 14.25v.75M6 18.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z" />
|
|
|
|
|
</svg>
|
|
|
|
|
@else
|
|
|
|
|
<svg class="h-8 w-8 text-blue-500" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418" />
|
|
|
|
|
</svg>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ml-4 flex-1 min-w-0">
|
|
|
|
|
<h3 class="text-lg font-medium text-gray-900 truncate">
|
|
|
|
|
{{ $feed->name }}
|
|
|
|
|
</h3>
|
|
|
|
|
@if ($feed->description)
|
|
|
|
|
<p class="text-sm text-gray-500 line-clamp-2">
|
|
|
|
|
{{ $feed->description }}
|
|
|
|
|
</p>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button
|
|
|
|
|
wire:click="toggle({{ $feed->id }})"
|
|
|
|
|
class="p-1 rounded-full {{ $feed->is_active ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-400' }}"
|
|
|
|
|
title="{{ $feed->is_active ? 'Active - Click to disable' : 'Inactive - Click to enable' }}"
|
|
|
|
|
>
|
|
|
|
|
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
|
|
|
|
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mt-4 flex items-center justify-between">
|
|
|
|
|
<div class="flex items-center space-x-2">
|
|
|
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {{ $feed->is_active ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800' }}">
|
|
|
|
|
{{ $feed->is_active ? 'Active' : 'Inactive' }}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
|
|
|
|
{{ strtoupper($feed->type) }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
@if ($feed->url)
|
|
|
|
|
<a
|
|
|
|
|
href="{{ $feed->url }}"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
class="text-gray-400 hover:text-gray-600"
|
|
|
|
|
title="Open feed URL"
|
|
|
|
|
>
|
|
|
|
|
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25" />
|
|
|
|
|
</svg>
|
|
|
|
|
</a>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mt-3 text-xs text-gray-500">
|
|
|
|
|
Created {{ $feed->created_at->format('M d, Y') }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@empty
|
|
|
|
|
<div class="col-span-full text-center py-12">
|
|
|
|
|
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-.75a7.5 7.5 0 0 0-7.5-7.5H4.5m0-6.75h.75c7.87 0 14.25 6.38 14.25 14.25v.75M6 18.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z" />
|
|
|
|
|
</svg>
|
|
|
|
|
<h3 class="mt-2 text-sm font-medium text-gray-900">No feeds</h3>
|
|
|
|
|
<p class="mt-1 text-sm text-gray-500">
|
|
|
|
|
No feeds have been configured yet.
|
|
|
|
|
</p>
|
2026-07-25 20:08:19 +02:00
|
|
|
<div class="mt-6">
|
|
|
|
|
<button
|
|
|
|
|
wire:click="openCreateModal"
|
|
|
|
|
class="inline-flex items-center px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
|
|
|
|
>
|
|
|
|
|
<svg class="h-4 w-4 mr-1.5" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
|
|
|
|
</svg>
|
|
|
|
|
Add Feed
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-01-22 23:38:00 +01:00
|
|
|
</div>
|
|
|
|
|
@endforelse
|
|
|
|
|
</div>
|
2026-07-25 20:08:19 +02:00
|
|
|
|
|
|
|
|
<!-- Create Feed Modal -->
|
|
|
|
|
@if ($showCreateModal)
|
|
|
|
|
<div class="fixed inset-0 z-50 overflow-y-auto" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
|
|
|
|
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
|
|
|
|
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" wire:click="closeCreateModal"></div>
|
|
|
|
|
|
|
|
|
|
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
|
|
|
|
|
|
|
|
|
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6">
|
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
|
|
|
<h3 class="text-lg font-medium text-gray-900">Add Feed</h3>
|
|
|
|
|
<button wire:click="closeCreateModal" class="text-gray-400 hover:text-gray-600">
|
|
|
|
|
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form wire:submit="createFeed" class="space-y-4">
|
|
|
|
|
<div>
|
|
|
|
|
<label for="new-feed-name" class="block text-sm font-medium text-gray-700">Name</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="new-feed-name"
|
|
|
|
|
wire:model="newName"
|
|
|
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm"
|
|
|
|
|
/>
|
|
|
|
|
@error('newName') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<label for="new-feed-provider" class="block text-sm font-medium text-gray-700">Provider</label>
|
|
|
|
|
<select
|
|
|
|
|
id="new-feed-provider"
|
|
|
|
|
wire:model="newProvider"
|
|
|
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm"
|
|
|
|
|
>
|
|
|
|
|
<option value="">Select a provider</option>
|
|
|
|
|
@foreach ($providers as $code => $provider)
|
|
|
|
|
<option value="{{ $code }}">{{ $provider['name'] }}</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
@error('newProvider') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<label for="new-feed-language" class="block text-sm font-medium text-gray-700">Language</label>
|
|
|
|
|
<select
|
|
|
|
|
id="new-feed-language"
|
|
|
|
|
wire:model="newLanguageId"
|
|
|
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm"
|
|
|
|
|
>
|
|
|
|
|
<option value="">Select a language</option>
|
|
|
|
|
@foreach ($languages as $language)
|
|
|
|
|
<option value="{{ $language->id }}">{{ $language->name }}</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
@error('newLanguageId') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<label for="new-feed-description" class="block text-sm font-medium text-gray-700">Description <span class="text-gray-400">(optional)</span></label>
|
|
|
|
|
<textarea
|
|
|
|
|
id="new-feed-description"
|
|
|
|
|
wire:model="newDescription"
|
|
|
|
|
rows="2"
|
|
|
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm"
|
|
|
|
|
></textarea>
|
|
|
|
|
@error('newDescription') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mt-6 flex justify-end space-x-3">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
wire:click="closeCreateModal"
|
|
|
|
|
class="inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
|
|
|
|
>
|
|
|
|
|
Cancel
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
type="submit"
|
|
|
|
|
wire:loading.attr="disabled"
|
|
|
|
|
wire:target="createFeed"
|
|
|
|
|
class="inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
|
|
|
>
|
|
|
|
|
Create
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
2026-01-22 23:38:00 +01:00
|
|
|
</div>
|