建设相关的路由,及大部分提交的验证,及视频对应的真·节目单

This commit is contained in:
2022-08-01 13:45:36 +08:00
parent fb78d7facb
commit 9ed3db42f2
18 changed files with 452 additions and 16 deletions

View File

@ -0,0 +1,163 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/
'accepted' => 'The :attribute must be accepted.',
'accepted_if' => 'The :attribute must be accepted when :other is :value.',
'active_url' => 'The :attribute is not a valid URL.',
'after' => 'The :attribute must be a date after :date.',
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
'alpha' => 'The :attribute must only contain letters.',
'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
'alpha_num' => 'The :attribute must only contain letters and numbers.',
'array' => 'The :attribute must be an array.',
'before' => 'The :attribute must be a date before :date.',
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
'between' => [
'numeric' => 'The :attribute must be between :min and :max.',
'file' => 'The :attribute must be between :min and :max kilobytes.',
'string' => 'The :attribute must be between :min and :max characters.',
'array' => 'The :attribute must have between :min and :max items.',
],
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
'current_password' => 'The password is incorrect.',
'date' => 'The :attribute is not a valid date.',
'date_equals' => 'The :attribute must be a date equal to :date.',
'date_format' => 'The :attribute does not match the format :format.',
'declined' => 'The :attribute must be declined.',
'declined_if' => 'The :attribute must be declined when :other is :value.',
'different' => 'The :attribute and :other must be different.',
'digits' => 'The :attribute must be :digits digits.',
'digits_between' => 'The :attribute must be between :min and :max digits.',
'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.',
'ends_with' => 'The :attribute must end with one of the following: :values.',
'enum' => 'The selected :attribute is invalid.',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',
'gt' => [
'numeric' => 'The :attribute must be greater than :value.',
'file' => 'The :attribute must be greater than :value kilobytes.',
'string' => 'The :attribute must be greater than :value characters.',
'array' => 'The :attribute must have more than :value items.',
],
'gte' => [
'numeric' => 'The :attribute must be greater than or equal to :value.',
'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
'string' => 'The :attribute must be greater than or equal to :value characters.',
'array' => 'The :attribute must have :value items or more.',
],
'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
'in_array' => 'The :attribute field does not exist in :other.',
'integer' => 'The :attribute must be an integer.',
'ip' => 'The :attribute must be a valid IP address.',
'ipv4' => 'The :attribute must be a valid IPv4 address.',
'ipv6' => 'The :attribute must be a valid IPv6 address.',
'json' => 'The :attribute must be a valid JSON string.',
'lt' => [
'numeric' => 'The :attribute must be less than :value.',
'file' => 'The :attribute must be less than :value kilobytes.',
'string' => 'The :attribute must be less than :value characters.',
'array' => 'The :attribute must have less than :value items.',
],
'lte' => [
'numeric' => 'The :attribute must be less than or equal to :value.',
'file' => 'The :attribute must be less than or equal to :value kilobytes.',
'string' => 'The :attribute must be less than or equal to :value characters.',
'array' => 'The :attribute must not have more than :value items.',
],
'mac_address' => 'The :attribute must be a valid MAC address.',
'max' => [
'numeric' => 'The :attribute must not be greater than :max.',
'file' => 'The :attribute must not be greater than :max kilobytes.',
'string' => 'The :attribute must not be greater than :max characters.',
'array' => 'The :attribute must not have more than :max items.',
],
'mimes' => 'The :attribute must be a file of type: :values.',
'mimetypes' => 'The :attribute must be a file of type: :values.',
'min' => [
'numeric' => 'The :attribute must be at least :min.',
'file' => 'The :attribute must be at least :min kilobytes.',
'string' => 'The :attribute must be at least :min characters.',
'array' => 'The :attribute must have at least :min items.',
],
'multiple_of' => 'The :attribute must be a multiple of :value.',
'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.',
'password' => 'The password is incorrect.',
'present' => 'The :attribute field must be present.',
'prohibited' => 'The :attribute field is prohibited.',
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
'prohibits' => 'The :attribute field prohibits :other from being present.',
'regex' => '字段 :attribute 格式不匹配。',
'required' => '字段 :attribute 为必填字段。',
'required_array_keys' => 'The :attribute field must contain entries for: :values.',
'required_if' => 'The :attribute field is required when :other is :value.',
'required_unless' => 'The :attribute field is required unless :other is in :values.',
'required_with' => 'The :attribute field is required when :values is present.',
'required_with_all' => 'The :attribute field is required when :values are present.',
'required_without' => 'The :attribute field is required when :values is not present.',
'required_without_all' => 'The :attribute field is required when none of :values are present.',
'same' => 'The :attribute and :other must match.',
'size' => [
'numeric' => 'The :attribute must be :size.',
'file' => 'The :attribute must be :size kilobytes.',
'string' => 'The :attribute must be :size characters.',
'array' => 'The :attribute must contain :size items.',
],
'starts_with' => 'The :attribute must start with one of the following: :values.',
'string' => 'The :attribute must be a string.',
'timezone' => 'The :attribute must be a valid timezone.',
'unique' => 'The :attribute has already been taken.',
'uploaded' => 'The :attribute failed to upload.',
'url' => 'The :attribute must be a valid URL.',
'uuid' => 'The :attribute must be a valid UUID.',
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/
'custom' => [
'attribute-name' => [
'rule-name' => 'custom-message',
],
],
/*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap our attribute placeholder
| with something more reader friendly such as "E-Mail Address" instead
| of "email". This simply helps us make our message more expressive.
|
*/
'attributes' => [],
];

View File

@ -3,7 +3,7 @@
<div class="text-l font-bold">有任何意见或建议可以直接联系我</div>
<div>
导航:
<a class="text-blue-600 underline" href="/">节目单查询</a>
<a class="text-blue-600 underline" href="/comments">节目单查询</a>
<a class="text-blue-600 underline" href="/danmakus">直播弹幕查询</a>
<a class="text-blue-600 underline" href="/programs" title="数据不全,待补充">节目查询</a>
</div>

View File

@ -25,7 +25,7 @@
@foreach($comments as $comment)
<tr>
<td class="border text-center text-base lg:text-lg">
<a class="text-blue-600 lg:text-current underline lg:no-underline break-all" target="_blank" href="https://www.bilibili.com/video/{{$comment->video->bvid}}">
<a class="text-blue-600 lg:text-current underline lg:no-underline break-all" href="/video/{{$comment->video->id}}">
{{$comment->video->title}}
</a>
</td>

View File

@ -18,11 +18,11 @@
@endif
<label class="block my-2">
追加内容(点播可不填)
<input class="form-input border-0 border-b-2 w-full" type="text" name="name" value="{{$append->name}}">
<input class="form-input border-0 border-b-2 w-full" type="text" name="name" value="{{ old('name') || $append->name }}">
</label>
<label class="block my-2">
点播老板
<input class="form-input border-0 border-b-2 w-full" type="text" name="from" value="{{$append->from}}">
<input class="form-input border-0 border-b-2 w-full" type="text" name="from" value="{{ old('from') || $append->from }}">
</label>
<label class="block my-2">
是否点播(不是追加)
@ -30,12 +30,17 @@
</label>
<label class="block my-2">
<input class="form-input border-0 border-b-2 w-full" type="number" step="0.5" name="price" value="{{$append->price}}">
<input class="form-input border-0 border-b-2 w-full" type="number" step="0.5" name="price" value="{{ old('price') || $append->price }}">
</label>
<label class="block my-2">
补充说明
<input class="form-input border-0 border-b-2 w-full" type="text" name="append" value="{{$append->append}}">
<input class="form-input border-0 border-b-2 w-full" type="text" name="append" value="{{ old('append') || $append->append }}">
</label>
@if($errors->any())
@foreach ($errors->all() as $error)
<div class="bg-red-600 text-white">错误:{{ $error }}</div>
@endforeach
@endif
<div class="block my-2 text-center">
<input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit">
</div>

View File

@ -22,7 +22,7 @@
@foreach($appends as $append)
<tr>
<td>
<a href="{{route("program.construct.append.edit", ["program"=>$append->program_id, "append"=>$append->id])}}">编辑</a>
<a href="{{route("program.construct.append.edit", ["append"=>$append->id])}}">编辑</a>
@switch($append->platform_id)
@case(1)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/bilibili.ico" alt="B站">

View File

@ -0,0 +1,38 @@
<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>
@include("common.header")
<form class="w-full lg:w-1/2 lg:ml-6 border-2" action="" method="post" enctype="multipart/form-data">
@csrf
<label class="block my-2">
节目单内容
<textarea class="form-input border-0 border-b-2 w-full" rows="5" name="content" required>{{ old('content') }}</textarea>
</label>
<label class="block my-2">
BVID
<input class="form-input border-0 border-b-2 w-full" type="text" name="bvid" required value="{{ old('bvid') }}">
</label>
@if($errors->any())
@foreach ($errors->all() as $error)
<div class="bg-red-600 text-white">错误:{{ $error }}</div>
@endforeach
@endif
@isset($message)
<div class="bg-red-600 text-white">提示:{{ $message }}</div>
@endisset
<div class="block my-2 text-center">
<input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit">
</div>
<div class="block my-2">
<a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white"
href="{{ route("program.construct.list") }}">返回列表</a>
</div>
</form>
@include("common.footer")
</body>
</html>

View File

@ -25,9 +25,15 @@
是否结束维护
<input class="form-checkbox" type="checkbox" name="status" value="1" @if($program->status == 1) checked @endif>
</label>
@if($errors->any())
@foreach ($errors->all() as $error)
<div class="bg-red-600 text-white">错误:{{ $error }}</div>
@endforeach
@endif
<div class="block my-2 text-center">
<input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit">
</div>
@if($program->id)
<div class="block my-2">
<a href="{{route("program.construct.video.list", ["program"=>$program->id])}}"
class="block px-6 py-2 inline-block rounded-full bg-cyan-600 text-white">
@ -38,11 +44,14 @@
关联点播老板列表
</a>
</div>
@endif
</form>
@if($program->id)
<div class="w-full lg:w-1/2 lg:ml-6 flex justify-between px-4">
<a class="block px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" href="{{route("program.construct.edit", ["program"=>$program->id - 1])}}">上一个</a>
<a class="block px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" href="{{route("program.construct.edit", ["program"=>$program->id + 1])}}">下一个</a>
</div>
@endif
@include("common.footer")
</body>
</html>

View File

@ -7,6 +7,12 @@
</head>
<body>
@include("common.header")
<div class="block my-2">
<a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white"
href="{{ route("program.construct.add") }}">添加</a>
<a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white"
href="{{ route("program.construct.batch_add") }}">节目单导入</a>
</div>
<table class="table-auto border-collapse w-full lg:border lg:border-black">
<thead>
<tr class="border border-black sticky bg-white lg:static top-0 left-0 right-0">

View File

@ -11,7 +11,7 @@
<input type="hidden" name="id" value="{{$program_video->id}}">
<label class="block my-2">
BVID
<input class="form-input border-0 border-b-2 w-full" disabled type="text" name="video_bvid" value="{{$program_video->video_bvid}}">
<input class="form-input border-0 border-b-2 w-full" @if($program_video->video_bvid) disabled @endif type="text" name="video_bvid" value="{{$program_video->video_bvid}}">
</label>
<label class="block my-2">
开始P数
@ -50,6 +50,7 @@
<div class="block my-2 text-center">
<input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit">
</div>
@if($program_video->video_bvid)
<div class="block my-2">
<a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" target="_blank"
href="https://www.bilibili.com/video/{{$program_video->video_bvid}}?p={{$program_video->start_part}}&t={{$program_video->start_sec}}"
@ -60,6 +61,7 @@
title="P{{$program_video->stop_part}}#{{$program_video->stop_time}}"
>打开至结束位置</a>
</div>
@endif
</form>
@include("common.footer")
</body>

View File

@ -7,6 +7,10 @@
</head>
<body>
@include("common.header")
<div class="block my-2">
<a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white"
href="{{ route("program.construct.video.add", ["program"=>$program->id]) }}">添加</a>
</div>
<table class="table-auto border-collapse w-full lg:border lg:border-black">
<thead>
<tr class="border border-black sticky bg-white lg:static top-0 left-0 right-0">

View File

@ -0,0 +1,66 @@
<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>
@include("common.header")
<div>
<h3 class="text-2xl font-bold">
<a class="text-blue-600" href="https://www.bilibili.com/video/{{$video->bvid}}">{{$video->title}}</a>
</h3>
</div>
<table class="table-auto border-collapse w-full lg:border lg:border-black">
<thead>
<tr class="border border-black sticky bg-white lg:static top-0 left-0 right-0">
<th class="border border-black">节目名称</th>
<th class="border border-black">点播及追加</th>
<th class="border border-black hidden lg:table-cell">节目开始</th>
<th class="border border-black hidden lg:table-cell">节目结束</th>
</tr>
</thead>
<tbody>
@foreach($video_pivots as $video_pivot)
<tr>
<td class="border align-top w-1/2 lg:w-1/4">
<div class="block lg:hidden">{{$video_pivot->created_at}}</div>
<a class="text-blue-600 lg:text-current underline lg:no-underline" href="/programs/{{ $video_pivot->program->id }}/video">
<span title="节目">{{$video_pivot->program->name}}</span>
<span title="难度">{{$video_pivot->program->difficulty}}</span>
<span title="要求">{{$video_pivot->program->desc}}</span>
</a>
</td>
<td class="border align-top w-1/2 lg:w-1/4">
@foreach($video_pivot->program->appends as $append)
<x-append :append="$append"></x-append>
@endforeach
</td>
<td class="border align-top hidden lg:table-cell lg:w-1/4">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time">
<div>{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面">
@else
节目开始位置
@endif
</x-links.video_link>
</td>
<td class="border align-top hidden lg:table-cell lg:w-1/4">
<x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time">
<div>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
@if($video_pivot->start_image)
<img loading="lazy" width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面">
@else
节目结束位置
@endif
</x-links.video_link>
</td>
</tr>
@endforeach
</tbody>
</table>
@include("common.footer")
</body>
</html>