diff --git a/app/Models/Torrent.php b/app/Models/Torrent.php index a17e7cc8..25bc139d 100644 --- a/app/Models/Torrent.php +++ b/app/Models/Torrent.php @@ -15,7 +15,7 @@ class Torrent extends NexusModel 'size', 'added', 'type', 'numfiles', 'owner', 'nfo', 'sp_state', 'promotion_time_type', 'promotion_until', 'anonymous', 'url', 'pos_state', 'cache_stamp', 'picktype', 'picktime', 'last_reseed', 'pt_gen', 'technical_info', 'leechers', 'seeders', 'cover', 'last_action', - 'times_completed', 'approval_status' + 'times_completed', 'approval_status', 'banned', 'visible', ]; private static $globalPromotionState; @@ -132,19 +132,19 @@ class Torrent extends NexusModel const BONUS_REWARD_VALUES = [50, 100, 200, 500, 1000]; const APPROVAL_STATUS_NONE = 0; - const APPROVAL_STATUS_YES = 1; - const APPROVAL_STATUS_NO = 2; + const APPROVAL_STATUS_ALLOW = 1; + const APPROVAL_STATUS_DENY = 2; public static array $approvalStatus = [ self::APPROVAL_STATUS_NONE => [ 'text' => 'None', 'icon' => '', ], - self::APPROVAL_STATUS_YES => [ + self::APPROVAL_STATUS_ALLOW => [ 'text' => 'Allow', 'icon' => '', ], - self::APPROVAL_STATUS_NO => [ + self::APPROVAL_STATUS_DENY => [ 'text' => 'Deny', 'icon' => '', ], @@ -401,4 +401,9 @@ class Torrent extends NexusModel { return $this->hasMany(Reward::class, 'torrentid'); } + + public function operationLogs(): \Illuminate\Database\Eloquent\Relations\HasMany + { + return $this->hasMany(TorrentOperationLog::class, 'torrent_id'); + } } diff --git a/app/Models/TorrentOperationLog.php b/app/Models/TorrentOperationLog.php index 392ad0f2..79dc1e91 100644 --- a/app/Models/TorrentOperationLog.php +++ b/app/Models/TorrentOperationLog.php @@ -2,6 +2,8 @@ namespace App\Models; +use Nexus\Database\NexusDB; + class TorrentOperationLog extends NexusModel { protected $table = 'torrent_operation_logs'; @@ -10,12 +12,14 @@ class TorrentOperationLog extends NexusModel protected $fillable = ['uid', 'torrent_id', 'action_type', 'comment']; - const ACTION_TYPE_BAN = 'ban'; - const ACTION_TYPE_CANCEL_BAN = 'cancel_ban'; + const ACTION_TYPE_APPROVAL_NONE = 'approval_none'; + const ACTION_TYPE_APPROVAL_ALLOW = 'approval_allow'; + const ACTION_TYPE_APPROVAL_DENY = 'approval_deny'; public static array $actionTypes = [ - self::ACTION_TYPE_BAN => ['text' => 'Ban'], - self::ACTION_TYPE_CANCEL_BAN => ['text' => 'Cancel ban'], + self::ACTION_TYPE_APPROVAL_NONE => ['text' => 'Approval none'], + self::ACTION_TYPE_APPROVAL_ALLOW => ['text' => 'Approval allow'], + self::ACTION_TYPE_APPROVAL_DENY => ['text' => 'Approval deny'], ]; public function user() @@ -32,7 +36,7 @@ class TorrentOperationLog extends NexusModel public static function add(array $params) { $log = self::query()->create($params); - if (!in_array($params['action_type'], [self::ACTION_TYPE_CANCEL_BAN, self::ACTION_TYPE_BAN])) { + if (!in_array($params['action_type'], [self::ACTION_TYPE_APPROVAL_ALLOW, self::ACTION_TYPE_APPROVAL_DENY])) { do_log("actionType: {$params['action_type']}, do not notify"); return $log; } @@ -60,5 +64,6 @@ class TorrentOperationLog extends NexusModel 'added' => now(), ]; Message::query()->insert($message); + NexusDB::cache_del("user_{$receiver->id}_inbox_count"); } } diff --git a/app/Repositories/BaseRepository.php b/app/Repositories/BaseRepository.php index 8491fa5e..04d8ba36 100644 --- a/app/Repositories/BaseRepository.php +++ b/app/Repositories/BaseRepository.php @@ -36,4 +36,20 @@ class BaseRepository } } + /** + * @param $user + * @param null $fields + * @return User + */ + protected function getUser($user, $fields = null): User + { + if ($user instanceof User) { + return $user; + } + if ($fields === null) { + $fields = User::$commonFields; + } + return User::query()->findOrFail(intval($user), $fields); + } + } diff --git a/app/Repositories/TorrentRepository.php b/app/Repositories/TorrentRepository.php index b49f9bb0..a0e1498f 100644 --- a/app/Repositories/TorrentRepository.php +++ b/app/Repositories/TorrentRepository.php @@ -16,9 +16,11 @@ use App\Models\SearchBox; use App\Models\Setting; use App\Models\Snatch; use App\Models\Source; +use App\Models\StaffMessage; use App\Models\Standard; use App\Models\Team; use App\Models\Torrent; +use App\Models\TorrentOperationLog; use App\Models\TorrentSecret; use App\Models\User; use Carbon\Carbon; @@ -422,5 +424,117 @@ class TorrentRepository extends BaseRepository } + public function buildApprovalModal($user, $torrentId) + { + $user = $this->getUser($user); + if ($user->class < Setting::get('authority.torrentmanage')) { + throw new \RuntimeException("No permission !"); + } + $torrent = Torrent::query()->findOrFail($torrentId, ['id', 'approval_status', 'banned']); + $radios = []; + foreach (Torrent::$approvalStatus as $key => $value) { + if ($torrent->approval_status == $key) { + $checked = " checked"; + } else { + $checked = ""; + } + $radios[] = sprintf( + '', + $key, $checked, nexus_trans("torrent.approval.status_text.$key") + ); + } + $id = "torrent-approval"; + $rows = []; + $rowStyle = "display: flex; padding: 10px; align-items: center"; + $labelStyle = "width: 80px"; + $formId = "$id-form"; + $rows[] = sprintf( + '
%s:
%s
', + $id, $rowStyle, $labelStyle,nexus_trans('torrent.approval.status_label'), implode('', $radios) + ); + $rows[] = sprintf( + '
%s:
', + $id, $rowStyle, $labelStyle, nexus_trans('torrent.approval.comment_label') + ); + $rows[] = sprintf('', $torrent->id); + + $html = sprintf('
%s
', $id, $formId, implode('', $rows)); + + return [ + 'id' => $id, + 'form_id' => $formId, + 'title' => nexus_trans('torrent.approval.modal_title'), + 'content' => $html, + ]; + + } + + public function approval($user, array $params): array + { + $user = $this->getUser($user); + $torrent = Torrent::query()->findOrFail($params['torrent_id'], ['id', 'banned', 'approval_status', 'visible', 'owner']); + if ($torrent->approval_status == $params['approval_status']) { + //No change + return $params; + } + $torrentUpdate = $torrentOperationLog = $staffMsg = []; + $torrentUpdate['approval_status'] = $params['approval_status']; + if ($params['approval_status'] == Torrent::APPROVAL_STATUS_ALLOW) { + $torrentUpdate['banned'] = 'no'; + $torrentUpdate['visible'] = 'yes'; + if ($torrent->approval_status != $params['approval_status']) { + $torrentOperationLog['action_type'] = TorrentOperationLog::ACTION_TYPE_APPROVAL_ALLOW; + } + } elseif ($params['approval_status'] == Torrent::APPROVAL_STATUS_DENY) { + $torrentUpdate['banned'] = 'yes'; + $torrentUpdate['visible'] = 'no'; + if ($torrent->approval_status != $params['approval_status']) { + $torrentOperationLog['action_type'] = TorrentOperationLog::ACTION_TYPE_APPROVAL_DENY; + } + } elseif ($params['approval_status'] == Torrent::APPROVAL_STATUS_NONE) { + if ($torrent->approval_status != $params['approval_status']) { + $torrentOperationLog['action_type'] = TorrentOperationLog::ACTION_TYPE_APPROVAL_NONE; + } + } else { + throw new \InvalidArgumentException("Invalid approval_status: " . $params['approval_status']); + } + if (isset($torrentOperationLog['action_type'])) { + $torrentOperationLog['uid'] = $user->id; + $torrentOperationLog['torrent_id'] = $torrent->id; + $torrentOperationLog['comment'] = $params['comment'] ?? ''; + } + + if ($torrent->banned == 'yes' && $torrent->owner == $user->id) { + $torrentUrl = sprintf('%s/details.php?id=%s', getSchemeAndHttpHost(), $torrent->id); + $staffMsg = [ + 'sender' => $user->id, + 'subject' => nexus_trans('torrent.owner_update_torrent_subject', ['detail_url' => $torrentUrl, 'torrent_name' => $_POST['name']]), + 'msg' => nexus_trans('torrent.owner_update_torrent_msg', ['detail_url' => $torrentUrl, 'torrent_name' => $_POST['name']]), + 'added' => now(), + ]; + } + + NexusDB::transaction(function () use ($torrent, $torrentOperationLog, $torrentUpdate, $staffMsg) { + $log = ""; + if (!empty($torrentUpdate)) { + $log .= "[UPDATE_TORRENT]: " . nexus_json_encode($torrentUpdate); + $torrent->update($torrentUpdate); + } + if (!empty($torrentOperationLog)) { + $log .= "[ADD_TORRENT_OPERATION_LOG]: " . nexus_json_encode($torrentOperationLog); + TorrentOperationLog::add($torrentOperationLog); + } + if (!empty($staffMsg)) { + $log .= "[INSERT_STAFF_MESSAGE]: " . nexus_json_encode($staffMsg); + StaffMessage::query()->insert($staffMsg); + NexusDB::cache_del('staff_new_message_count'); + } + do_log($log); + }); + + return $params; + + } + } diff --git a/include/constants.php b/include/constants.php index 9b885e8e..902eea38 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ + diff --git a/lang/chs/lang_details.php b/lang/chs/lang_details.php index a144efe5..e1f5d9ed 100644 --- a/lang/chs/lang_details.php +++ b/lang/chs/lang_details.php @@ -237,6 +237,7 @@ $lang_details = array 'claim_detail' => '认领详情', 'claim_label' => '认领种子', 'claim_confirm' => '确定要认领此种子吗?', + 'action_approval' => '审核', ); ?> diff --git a/public/ajax.php b/public/ajax.php index 21090651..6fd4d44a 100644 --- a/public/ajax.php +++ b/public/ajax.php @@ -74,3 +74,22 @@ function getOffer($params) return $offer->toArray(); } +function approvalModal($params) +{ + global $CURUSER; + $rep = new \App\Repositories\TorrentRepository(); + return $rep->buildApprovalModal($CURUSER['id'], $params['torrent_id']); +} + +function approval($params) +{ + global $CURUSER; + foreach (['torrent_id', 'approval_status',] as $field) { + if (!isset($params[$field])) { + throw new \InvalidArgumentException("Require $field"); + } + } + $rep = new \App\Repositories\TorrentRepository(); + return $rep->approval($CURUSER['id'], $params); +} + diff --git a/public/details.php b/public/details.php index 6f60f0bc..063d904e 100644 --- a/public/details.php +++ b/public/details.php @@ -10,7 +10,7 @@ int_check($id); if (!isset($id) || !$id) die(); -$res = sql_query("SELECT torrents.cache_stamp, torrents.sp_state, torrents.url, torrents.small_descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, nfo, LENGTH(torrents.nfo) AS nfosz, torrents.last_action, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, torrents.anonymous, torrents.pt_gen, torrents.technical_info, torrents.hr, torrents.promotion_until, torrents.promotion_time_type, +$res = sql_query("SELECT torrents.cache_stamp, torrents.sp_state, torrents.url, torrents.small_descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, nfo, LENGTH(torrents.nfo) AS nfosz, torrents.last_action, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, torrents.anonymous, torrents.pt_gen, torrents.technical_info, torrents.hr, torrents.promotion_until, torrents.promotion_time_type, torrents.approval_status, categories.name AS cat_name, categories.mode as search_box_id, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name, teams.name AS team_name, audiocodecs.name AS audiocodec_name FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN sources ON torrents.source = sources.id @@ -55,7 +55,6 @@ if (!$row) { if (!isset($_GET["cmtpage"])) { stdhead($lang_details['head_details_for_torrent']. "\"" . $row["name"] . "\""); - if (!empty($_GET["uploaded"])) { print("

".$lang_details['text_successfully_uploaded']."

"); @@ -74,6 +73,23 @@ if (!$row) { $hrImg = get_hr_img($row); $s=htmlspecialchars($row["name"]).$banned_torrent.($sp_torrent ? "   ".$sp_torrent : "").($sp_torrent_sub) . $hrImg; print("

".$s."

\n"); + + //Banned reason + if ($row['approval_status'] == \App\Models\Torrent::APPROVAL_STATUS_DENY) { + $torrentOperationLog = \App\Models\TorrentOperationLog::query() + ->where('torrent_id', $row['id']) + ->where('action_type', \App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_DENY) + ->orderBy('id', 'desc') + ->first(); + if ($torrentOperationLog) { + $dangerIcon = ''; + printf( + '
%s %s
', + $dangerIcon, nexus_trans('torrent.approval.deny_comment_show', ['reason' => $torrentOperationLog->comment]) + ); + } + } + print("
\n"); $url = "edit.php?id=" . $row["id"]; @@ -139,8 +155,57 @@ if (!$row) { if (get_user_class() >= $askreseed_class && $row['seeders'] == 0) { $actions[] = "\"reseed\" ".$lang_details['text_ask_for_reseed'] .""; } - $actions[] = "\"report\" ".$lang_details['text_report_torrent'].""; + if (get_user_class() >= $torrentmanage_class) { + $approvalIcon = ''; + $actions[] = sprintf( + '%s %s', + $row['id'], $approvalIcon, $lang_details['action_approval'] + ); + $js = <<\"report\" ".$lang_details['text_report_torrent'].""; tr($lang_details['row_action'], implode(' | ', $actions), 1); // ------------- start claim block ------------------// diff --git a/public/edit.php b/public/edit.php index f409ae5b..5ea3b9f7 100644 --- a/public/edit.php +++ b/public/edit.php @@ -155,48 +155,6 @@ else { } if (get_user_class() >= $torrentmanage_class) { array_unshift($rowChecks, ""); - $approvalStatusRadio = []; - foreach (\App\Models\Torrent::$approvalStatus as $key => $value) { - if ($row['approval_status'] == $key) { - $checked = " checked"; - } else { - $checked = ""; - } - $approvalStatusRadio[] = sprintf( - '', - $key, $checked, nexus_trans("torrent.approval_status.$key") - ); - } - $rowChecks[] = sprintf('审核:%s', implode('', $approvalStatusRadio)); -// $rowChecks[] = ""; - $banLog = \App\Models\TorrentOperationLog::query()->where('torrent_id', $row['id'])->where('action_type', \App\Models\TorrentOperationLog::ACTION_TYPE_BAN)->orderBy('id', 'desc')->first(); - $banReasonDisplay = "hidden"; - $banReasonReadonly = ""; - if ($row['banned'] == 'yes') { - $banReasonDisplay = 'visible'; - $banReasonReadonly = " readonly disabled"; - } - $rowChecks[] = sprintf( - '%s:', - $banReasonDisplay, $lang_edit['ban_reason_label'], $row['banned'] == 'yes' && $banLog ? $banLog->comment : '', $banReasonReadonly - ); - $js = <<= $torrentmanage_class && isset($_POST['approval_status']) && isset(\App\Models\Torrent::$approvalStatus[$_POST['approval_status']])) { - $approvalStatus = $_POST['approval_status']; - if ($approvalStatus == \App\Models\Torrent::APPROVAL_STATUS_YES) { - $updateset[] = "banned = 'no'"; - if ($row['banned'] == 'yes') { - $torrentOperationLog['action_type'] = \App\Models\TorrentOperationLog::ACTION_TYPE_CANCEL_BAN; - } - } elseif ($approvalStatus == \App\Models\Torrent::APPROVAL_STATUS_NO) { - $updateset[] = "banned = 'yes'"; - $_POST['visible'] = 0; - if ($row['banned'] == 'no') { - $torrentOperationLog['action_type'] = \App\Models\TorrentOperationLog::ACTION_TYPE_BAN; - } - } - if ($row['owner'] != $CURUSER['id'] && get_user_class() >= $staffmem_class) { - $updateset[] = "approval_status = $approvalStatus"; - } -} $updateset[] = "visible = '" . (isset($_POST["visible"]) && $_POST["visible"] ? "yes" : "no") . "'"; if(get_user_class()>=$torrentonpromotion_class) { @@ -269,22 +251,6 @@ else $searchRep = new \App\Repositories\SearchRepository(); $searchRep->updateTorrent($id); -if (!empty($torrentOperationLog['action_type'])) { - $torrentOperationLog['uid'] = $CURUSER['id']; - $torrentOperationLog['torrent_id'] = $row['id']; - $torrentOperationLog['comment'] = $_POST['ban_reason'] ?? ''; - \App\Models\TorrentOperationLog::add($torrentOperationLog); -} -if ($row['banned'] == 'yes' && $row['owner'] == $CURUSER['id']) { - $torrentUrl = sprintf('%s/details.php?id=%s', getSchemeAndHttpHost(), $row['id']); - \App\Models\StaffMessage::query()->insert([ - 'sender' => $CURUSER['id'], - 'subject' => nexus_trans('torrent.owner_update_torrent_subject', ['detail_url' => $torrentUrl, 'torrent_name' => $_POST['name']]), - 'msg' => nexus_trans('torrent.owner_update_torrent_msg', ['detail_url' => $torrentUrl, 'torrent_name' => $_POST['name']]), - 'added' => now(), - ]); -} - $returl = "details.php?id=$id&edited=1"; if (isset($_POST["returnto"])) $returl = $_POST["returnto"]; diff --git a/resources/lang/en/torrent.php b/resources/lang/en/torrent.php index 73dc46d4..fc6f5731 100644 --- a/resources/lang/en/torrent.php +++ b/resources/lang/en/torrent.php @@ -45,12 +45,12 @@ return [ 'claim_number_reach_torrent_maximum' => 'The maximum number of torrent is reached', 'claim_disabled' => 'Claim is disabled', 'operation_log' => [ - \App\Models\TorrentOperationLog::ACTION_TYPE_BAN => [ + \App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_DENY => [ 'type_text' => 'Banned', 'notify_subject' => 'Torrent was banned', 'notify_msg' => 'Your torrent:[url=:detail_url]:torrent_name[/url] was banned by :operator, Reason: :reason', ], - \App\Models\TorrentOperationLog::ACTION_TYPE_CANCEL_BAN => [ + \App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_ALLOW => [ 'type_text' => 'Cancel banned', 'notify_subject' => 'Torrent was unbanned', 'notify_msg' => 'Your torrent: [url=:detail_url]:torrent_name[/url] unbanned by :operator', @@ -58,9 +58,15 @@ return [ ], 'owner_update_torrent_subject' => 'Banned torrent have been updated', 'owner_update_torrent_msg' => 'Torrent:[url=:detail_url]:torrent_name[/url] has been updated by the owner, you can check if it meets the requirements and cancel the ban', - 'approval_status' => [ - \App\Models\Torrent::APPROVAL_STATUS_NONE => 'None', - \App\Models\Torrent::APPROVAL_STATUS_YES => 'Allow', - \App\Models\Torrent::APPROVAL_STATUS_NO => 'Deny', + 'approval' => [ + 'modal_title' => 'Torrent approval', + 'status_label' => 'Approval status', + 'comment_label' => 'Comment(optional)', + 'status_text' => [ + \App\Models\Torrent::APPROVAL_STATUS_NONE => 'None', + \App\Models\Torrent::APPROVAL_STATUS_ALLOW => 'Allow', + \App\Models\Torrent::APPROVAL_STATUS_DENY => 'Deny', + ], + 'deny_comment_show' => 'Denied, reason: reason', ], ]; diff --git a/resources/lang/zh_CN/torrent.php b/resources/lang/zh_CN/torrent.php index 4c65e664..ac67265f 100644 --- a/resources/lang/zh_CN/torrent.php +++ b/resources/lang/zh_CN/torrent.php @@ -45,12 +45,12 @@ return [ 'claim_number_reach_torrent_maximum' => '认领达到种子数上限', 'claim_disabled' => '认领未启用', 'operation_log' => [ - \App\Models\TorrentOperationLog::ACTION_TYPE_BAN => [ + \App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_DENY => [ 'type_text' => '禁止', 'notify_subject' => '种子被禁止', 'notify_msg' => '你的种子:[url=:detail_url]:torrent_name[/url] 被 :operator 禁止,原因::reason', ], - \App\Models\TorrentOperationLog::ACTION_TYPE_CANCEL_BAN => [ + \App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_ALLOW => [ 'type_text' => '取消禁止', 'notify_subject' => '种子取消禁止', 'notify_msg' => '你的种子:[url=:detail_url]:torrent_name[/url] 被 :operator 取消禁止', @@ -58,9 +58,15 @@ return [ ], 'owner_update_torrent_subject' => '被禁种子已更新', 'owner_update_torrent_msg' => '种子:[url=:detail_url]:torrent_name[/url] 已被作者更新,可以检查是否符合要求并取消禁止', - 'approval_status' => [ - \App\Models\Torrent::APPROVAL_STATUS_NONE => '未审', - \App\Models\Torrent::APPROVAL_STATUS_YES => '通过', - \App\Models\Torrent::APPROVAL_STATUS_NO => '拒绝', + 'approval' => [ + 'modal_title' => '种子审核', + 'status_label' => '审核状态', + 'comment_label' => '备注(可选)', + 'status_text' => [ + \App\Models\Torrent::APPROVAL_STATUS_NONE => '未审', + \App\Models\Torrent::APPROVAL_STATUS_ALLOW => '通过', + \App\Models\Torrent::APPROVAL_STATUS_DENY => '拒绝', + ], + 'deny_comment_show' => '审核不通过,原因::reason', ], ]; diff --git a/resources/lang/zh_TW/torrent.php b/resources/lang/zh_TW/torrent.php index dbb27a99..8e8a59bd 100644 --- a/resources/lang/zh_TW/torrent.php +++ b/resources/lang/zh_TW/torrent.php @@ -45,12 +45,12 @@ return [ 'claim_number_reach_torrent_maximum' => '認領達到種子數上限', 'claim_disabled' => '認領未啟用', 'operation_log' => [ - \App\Models\TorrentOperationLog::ACTION_TYPE_BAN => [ + \App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_DENY => [ 'type_text' => '禁止', 'notify_subject' => '種子被禁止', 'notify_msg' => '你的種子:[url=:detail_url]:torrent_name[/url] 被 :operator 禁止,原因::reason', ], - \App\Models\TorrentOperationLog::ACTION_TYPE_CANCEL_BAN => [ + \App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_ALLOW => [ 'type_text' => '取消禁止', 'notify_subject' => '種子取消禁止', 'notify_msg' => '你的種子:[url=:detail_url]:torrent_name[/url] 被 :operator 取消禁止', @@ -58,9 +58,15 @@ return [ ], 'owner_update_torrent_subject' => '被禁種子已更新', 'owner_update_torrent_msg' => '種子:[url=:detail_url]:torrent_name[/url] 已被作者更新,可以檢查是否符合要求並取消禁止', - 'approval_status' => [ - \App\Models\Torrent::APPROVAL_STATUS_NONE => '未審', - \App\Models\Torrent::APPROVAL_STATUS_YES => '通過', - \App\Models\Torrent::APPROVAL_STATUS_NO => '拒絕', + 'approval' => [ + 'modal_title' => '種子審核', + 'status_label' => '審核狀態', + 'comment_label' => '備註(可選)', + 'status_text' => [ + \App\Models\Torrent::APPROVAL_STATUS_NONE => '未審', + \App\Models\Torrent::APPROVAL_STATUS_ALLOW => '通過', + \App\Models\Torrent::APPROVAL_STATUS_DENY => '拒絕', + ], + 'deny_comment_show' => '審核不通過,原因::reason', ], ];