141 lines
No EOL
7 KiB
PHP
141 lines
No EOL
7 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="max-w-4xl mx-auto py-6 sm:px-6 lg:px-8">
|
|
<div class="px-4 py-6 sm:px-0">
|
|
<div class="mb-6">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<h1 class="text-2xl font-semibold text-gray-900">{{ $feed->name }}</h1>
|
|
<p class="mt-1 text-sm text-gray-600">{{ $feed->type_display }} • {{ strtoupper($feed->language) }}</p>
|
|
</div>
|
|
<div class="flex items-center space-x-3">
|
|
<!-- Toggle Switch -->
|
|
<form action="{{ route('feeds.toggle', $feed) }}" method="POST" class="inline">
|
|
@csrf
|
|
<label class="inline-flex items-center cursor-pointer">
|
|
<span class="text-sm text-gray-700 mr-3">{{ $feed->is_active ? 'Active' : 'Inactive' }}</span>
|
|
<button type="submit" class="relative inline-flex h-6 w-11 items-center rounded-full transition-colors {{ $feed->is_active ? 'bg-green-600' : 'bg-gray-200' }}">
|
|
<span class="inline-block h-4 w-4 transform rounded-full bg-white transition-transform {{ $feed->is_active ? 'translate-x-6' : 'translate-x-1' }}"></span>
|
|
</button>
|
|
</label>
|
|
</form>
|
|
|
|
<a href="{{ route('feeds.edit', $feed) }}" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded">
|
|
Edit Feed
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-6">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
@if(!$feed->is_active)
|
|
<div class="mb-6 bg-yellow-50 border border-yellow-200 rounded-md p-4">
|
|
<div class="flex">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-exclamation-triangle class="w-5 h-5 text-yellow-400" />
|
|
</div>
|
|
<div class="ml-3">
|
|
<p class="text-sm text-yellow-800">
|
|
This feed is inactive. No articles will be fetched or published from this feed until reactivated.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:px-6">
|
|
<h3 class="text-lg leading-6 font-medium text-gray-900">Feed Details</h3>
|
|
<p class="mt-1 max-w-2xl text-sm text-gray-500">Information about this content feed.</p>
|
|
</div>
|
|
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
|
<dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2">
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500">Name</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">{{ $feed->name }}</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500">Type</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">
|
|
<div class="flex items-center">
|
|
@if($feed->type === 'rss')
|
|
<x-heroicon-o-rss class="w-4 h-4 text-orange-500 mr-2" />
|
|
@else
|
|
<x-heroicon-o-globe-alt class="w-4 h-4 text-blue-500 mr-2" />
|
|
@endif
|
|
{{ $feed->type_display }}
|
|
</div>
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500">URL</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">
|
|
<a href="{{ $feed->url }}" target="_blank" class="text-indigo-600 hover:text-indigo-500">
|
|
{{ $feed->url }}
|
|
<x-heroicon-o-arrow-top-right-on-square class="w-3 h-3 ml-1" />
|
|
</a>
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500">Language</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">{{ strtoupper($feed->language) }}</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500">Status</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">{{ $feed->status }}</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500">Created</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">{{ $feed->created_at->format('M j, Y g:i A') }}</dd>
|
|
</div>
|
|
|
|
@if($feed->last_fetched_at)
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500">Last Fetched</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">{{ $feed->last_fetched_at->format('M j, Y g:i A') }}</dd>
|
|
</div>
|
|
@endif
|
|
|
|
@if($feed->description)
|
|
<div class="sm:col-span-2">
|
|
<dt class="text-sm font-medium text-gray-500">Description</dt>
|
|
<dd class="mt-1 text-sm text-gray-900">{{ $feed->description }}</dd>
|
|
</div>
|
|
@endif
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-6 flex items-center justify-between">
|
|
<a href="{{ route('feeds.index') }}" class="text-indigo-600 hover:text-indigo-500 font-medium">
|
|
← Back to Feeds
|
|
</a>
|
|
|
|
<div class="flex items-center space-x-3">
|
|
<a href="{{ route('feeds.edit', $feed) }}" 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">
|
|
Edit
|
|
</a>
|
|
<form action="{{ route('feeds.destroy', $feed) }}" method="POST" class="inline"
|
|
onsubmit="return confirm('Are you sure you want to delete this feed?')">
|
|
@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 Feed
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection |