Files
lubo_comment_query/resources/views/program/index.blade.php
2025-12-09 11:40:16 +08:00

186 lines
12 KiB
PHP

<html lang="zh">
<head>
<meta charset="UTF-8">
<title>录播节目查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ mix('/css/app.css') }}" rel="stylesheet"/>
</head>
<body class="bg-gray-50 dark:bg-gray-900 min-h-screen flex flex-col text-gray-900 dark:text-gray-100">
@include("common.header")
<div class="bg-red-500 text-white" id="_notice">
<div class="container mx-auto px-4 py-3 flex items-center justify-between">
<div class="flex items-center">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"></path></svg>
<span class="text-sm font-medium">数据待补充完整,需要查较为久远的节目,请先点击上方节目单查询</span>
</div>
<button type="button" class="text-white hover:text-red-100 focus:outline-none" onclick="document.getElementById('_notice').remove()">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
</button>
</div>
</div>
<main class="flex-grow container mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="max-w-7xl mx-auto">
<!-- Search Form -->
<form class="bg-white dark:bg-gray-800 p-6 rounded-xl shadow-sm mb-8 transition-colors duration-200" action="">
<label for="keyword" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">查找节目关键词</label>
<div class="relative flex items-center">
<input type="text" name="keyword" id="keyword" value="{{$keyword}}"
class="block w-full rounded-l-lg border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm py-3"
placeholder="支持通过点播老板或追加内容搜索...">
<button type="submit" class="inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-r-lg shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200">
搜索
</button>
</div>
</form>
<!-- Desktop Table -->
<div class="hidden lg:block bg-white dark:bg-gray-800 shadow overflow-hidden rounded-lg">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
<thead class="bg-gray-50 dark:bg-gray-700">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-1/4">节目名称</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-1/4">点播及追加</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-1/4">节目开始</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-1/4">节目结束</th>
</tr>
</thead>
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
@foreach($programs as $program)
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
<td class="px-6 py-4 align-top">
@auth("web")
<a href="{{route("program.construct.edit", ["program"=>$program->id])}}" class="text-indigo-600 hover:text-indigo-900 text-xs mb-1 block">编辑</a>
@endauth
<a href="/programs/{{ $program->id }}/video" class="block group">
<div class="text-sm font-medium text-gray-900 dark:text-white group-hover:text-indigo-600 transition-colors">{{$program->name}}</div>
@if($program->difficulty)
<div class="text-xs text-gray-500 mt-1">难度: {{$program->difficulty}}</div>
@endif
@if($program->desc)
<div class="text-xs text-gray-500 mt-1">{{$program->desc}}</div>
@endif
</a>
</td>
<td class="px-6 py-4 align-top text-sm text-gray-500 dark:text-gray-400">
@foreach($program->appends as $append)
<div class="mb-2">
<x-append :append="$append"></x-append>
</div>
@endforeach
</td>
<td class="px-6 py-4 align-top text-sm">
@foreach($program->video_pivots as $video_pivot)
<div class="mb-4">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time">
<div class="text-xs text-gray-500 mb-1">{{$video_pivot->created_at}}</div>
<div class="text-indigo-600 hover:text-indigo-800">P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" class="mt-1 rounded border border-gray-200 w-32" src="{{$video_pivot->start_image}}" alt="开始画面">
@else
<span class="text-xs text-gray-400">无预览</span>
@endif
</x-links.video_link>
</div>
@endforeach
</td>
<td class="px-6 py-4 align-top text-sm">
@foreach($program->video_pivots as $video_pivot)
<div class="mb-4">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time">
<div class="text-indigo-600 hover:text-indigo-800">P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" class="mt-1 rounded border border-gray-200 w-32" src="{{$video_pivot->stop_image}}" alt="结束画面">
@else
<span class="text-xs text-gray-400">无预览</span>
@endif
</x-links.video_link>
</div>
@endforeach
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- Mobile Cards -->
<div class="space-y-6 lg:hidden">
@foreach($programs as $program)
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-100 dark:border-gray-700 overflow-hidden">
<div class="p-4 border-b dark:border-gray-700 bg-gray-50 dark:bg-gray-700/50">
<div class="flex justify-between items-start">
<div>
@auth("web")
<a href="{{route("program.construct.edit", ["program"=>$program->id])}}" class="text-xs text-indigo-600 mb-1 inline-block">编辑</a>
@endauth
<h3 class="text-lg font-bold text-gray-900 dark:text-white">{{$program->name}}</h3>
<div class="text-sm text-gray-500 mt-1">
<span class="mr-2">{{$program->difficulty}}</span>
<span>{{$program->desc}}</span>
</div>
</div>
@if(sizeof($program->video_pivots) > 0)
<span class="text-xs text-gray-400">{{$program->created_at}}</span>
@endif
</div>
</div>
@if(count($program->appends) > 0)
<div class="p-4 border-b dark:border-gray-700">
<h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">点播及追加</h4>
<div class="space-y-2">
@foreach($program->appends as $append)
<x-append :append="$append"></x-append>
@endforeach
</div>
</div>
@endif
<div class="p-4 grid grid-cols-2 gap-4">
<div>
<h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">开始</h4>
@foreach($program->video_pivots as $video_pivot)
<div class="mb-3">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time">
<div class="text-sm text-indigo-600">P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" class="mt-1 rounded w-full" src="{{$video_pivot->start_image}}" alt="Start">
@endif
</x-links.video_link>
</div>
@endforeach
</div>
<div>
<h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">结束</h4>
@foreach($program->video_pivots as $video_pivot)
<div class="mb-3">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time">
<div class="text-sm text-indigo-600">P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" class="mt-1 rounded w-full" src="{{$video_pivot->stop_image}}" alt="End">
@endif
</x-links.video_link>
</div>
@endforeach
</div>
</div>
<div class="px-4 py-3 bg-gray-50 dark:bg-gray-700/30 border-t dark:border-gray-700 text-center">
<a href="/programs/{{ $program->id }}/video" class="text-sm text-indigo-600 font-medium hover:text-indigo-800">
查看详情 &rarr;
</a>
</div>
</div>
@endforeach
</div>
<div class="mt-8">
{{$programs->onEachSide(1)->links()}}
</div>
</div>
</main>
@include("common.footer")
</body>
</html>