Remove "3rd-party comment" from core

This commit is contained in:
Pig Fang 2019-12-25 17:33:57 +08:00
parent c868b05232
commit 71543da2f7
8 changed files with 2 additions and 34 deletions

View File

@ -313,8 +313,6 @@ class AdminController extends Controller
$form->text('texture_name_regexp')->hint()->placeholder();
$form->textarea('content_policy')->rows(3)->description();
$form->textarea('comment_script')->rows(6)->description();
})->handle(function () {
Option::set('site_name_'.config('app.locale'), request('site_name'));
Option::set('site_description_'.config('app.locale'), request('site_description'));

View File

@ -143,19 +143,9 @@ class SkinlibController extends Controller
$badges = $filter->apply('user_badges', $badges, [$uploader]);
}
$commentScript = get_string_replaced(
option('comment_script'),
[
'{tid}' => $texture->tid,
'{name}' => $texture->name,
'{url}' => request()->url(),
]
);
$grid = [
'layout' => [
['md-8', 'md-4'],
['md-12'],
],
'widgets' => [
[
@ -165,16 +155,12 @@ class SkinlibController extends Controller
'skinlib.widgets.show.operations',
],
],
[
['skinlib.widgets.show.comment'],
],
],
];
$grid = $filter->apply('grid:skinlib.show', $grid);
return view('skinlib.show')
->with('texture', $texture)
->with('comment_script', $commentScript)
->with('grid', $grid)
->with('extra', [
'download' => option('allow_downloading_texture'),

View File

@ -17,7 +17,6 @@ return [
'custom_player_name_regexp' => '',
'player_name_length_min' => '3',
'player_name_length_max' => '16',
'comment_script' => '',
'user_initial_score' => '1000',
'sign_gap_time' => '24',
'sign_score' => '10,100',

View File

@ -143,9 +143,6 @@ general:
content_policy:
title: Content Policy
description: Display content policy at texture uploading page, supporting Markdown. To edit a specific language's corresponding content policy, please switch to that language and submit your edit.
comment_script:
title: Comment Script
description: Placeholder is available, <code>{tid}</code> will be replaced with texture id, <code>{name}</code> will be replaced with texture name, <code>{url}</code> will be replaced with current URL.
announ:
title: Announcement

View File

@ -54,6 +54,7 @@
- Removed Element UI.
- Removed restriction of texture name and nickname.
- Removed settings of "Method of Retrieving IP".
- Removed "3rd-party comment", and please install separated plugin if you need it.
## Internal Changes

View File

@ -54,6 +54,7 @@
- 移除 Element UI
- 移除对材质名和用户昵称的要求
- 移除「IP 获取方法」的设置
- 移除「第三方评论」功能,如有需要请安装独立插件
## 内部更改

View File

@ -1,12 +0,0 @@
{% if comment_script %}
<div class="container-fluid p-0">
<div class="card">
<div class="card-header">
<h3 class="card-title">{{ trans('skinlib.show.comment') }}</h3>
</div>
<div class="card-body">
{{ comment_script|raw }}
</div>
</div>
</div>
{% endif %}

View File

@ -123,7 +123,6 @@ class AdminFormsTest extends BrowserKitTestCase
->select('404', 'status_code_for_private')
->type('abc', 'texture_name_regexp')
->type('policy', 'content_policy')
->type('code', 'comment_script')
->press('submit_general');
$this->assertEquals('My Site', option_localized('site_name'));
$this->assertEquals('hi', option_localized('site_description'));
@ -139,7 +138,6 @@ class AdminFormsTest extends BrowserKitTestCase
$this->assertEquals('404', option('status_code_for_private'));
$this->assertEquals('abc', option('texture_name_regexp'));
$this->assertEquals('policy', option_localized('content_policy'));
$this->assertEquals('code', option('comment_script'));
$this->visit('/admin/options')
->type('http://blessing.skin/index.php', 'site_url')