From 71543da2f7988c690b634728f79033b054266ff5 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 25 Dec 2019 17:33:57 +0800 Subject: [PATCH] Remove "3rd-party comment" from core --- app/Http/Controllers/AdminController.php | 2 -- app/Http/Controllers/SkinlibController.php | 14 -------------- config/options.php | 1 - resources/lang/en/options.yml | 3 --- resources/misc/changelogs/en/5.0.0.md | 1 + resources/misc/changelogs/zh_CN/5.0.0.md | 1 + resources/views/skinlib/widgets/show/comment.twig | 12 ------------ tests/BrowserKitTests/AdminFormsTest.php | 2 -- 8 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 resources/views/skinlib/widgets/show/comment.twig diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 2843831d..94337db8 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -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')); diff --git a/app/Http/Controllers/SkinlibController.php b/app/Http/Controllers/SkinlibController.php index 10ee6d3c..017e48f4 100644 --- a/app/Http/Controllers/SkinlibController.php +++ b/app/Http/Controllers/SkinlibController.php @@ -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'), diff --git a/config/options.php b/config/options.php index a5d98c6f..028b3683 100644 --- a/config/options.php +++ b/config/options.php @@ -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', diff --git a/resources/lang/en/options.yml b/resources/lang/en/options.yml index f40716f3..e1bc445b 100644 --- a/resources/lang/en/options.yml +++ b/resources/lang/en/options.yml @@ -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, {tid} will be replaced with texture id, {name} will be replaced with texture name, {url} will be replaced with current URL. announ: title: Announcement diff --git a/resources/misc/changelogs/en/5.0.0.md b/resources/misc/changelogs/en/5.0.0.md index 24b41ec4..4e0302e8 100644 --- a/resources/misc/changelogs/en/5.0.0.md +++ b/resources/misc/changelogs/en/5.0.0.md @@ -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 diff --git a/resources/misc/changelogs/zh_CN/5.0.0.md b/resources/misc/changelogs/zh_CN/5.0.0.md index 9da4e279..5046ab13 100644 --- a/resources/misc/changelogs/zh_CN/5.0.0.md +++ b/resources/misc/changelogs/zh_CN/5.0.0.md @@ -54,6 +54,7 @@ - 移除 Element UI - 移除对材质名和用户昵称的要求 - 移除「IP 获取方法」的设置 +- 移除「第三方评论」功能,如有需要请安装独立插件 ## 内部更改 diff --git a/resources/views/skinlib/widgets/show/comment.twig b/resources/views/skinlib/widgets/show/comment.twig deleted file mode 100644 index 17834de7..00000000 --- a/resources/views/skinlib/widgets/show/comment.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% if comment_script %} -
-
-
-

{{ trans('skinlib.show.comment') }}

-
-
- {{ comment_script|raw }} -
-
-
-{% endif %} diff --git a/tests/BrowserKitTests/AdminFormsTest.php b/tests/BrowserKitTests/AdminFormsTest.php index 624d176b..0b60e1d8 100644 --- a/tests/BrowserKitTests/AdminFormsTest.php +++ b/tests/BrowserKitTests/AdminFormsTest.php @@ -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')