diff --git a/CHANGELOG.md b/CHANGELOG.md index 85fe6caf0..1d4a9e2fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ - Updated FederationController, return 404 for invalid webfinger addresses. Fixes ([#2647](https://github.com/pixelfed/pixelfed/issues/2647)). ([deb6f115](https://github.com/pixelfed/pixelfed/commit/deb6f115)) - Updated InboxPipeline, fail earlier for invalid public keys. Fixes ([#2648](https://github.com/pixelfed/pixelfed/issues/2648)). ([d1c5e9b8](https://github.com/pixelfed/pixelfed/commit/d1c5e9b8)) - Updated Status model, refactor liked and shared methods to fix cache invalidation bug. ([f05c3b66](https://github.com/pixelfed/pixelfed/commit/f05c3b66)) +- Updated Timeline component, add inline reports modal. ([e64b4bd3](https://github.com/pixelfed/pixelfed/commit/e64b4bd3)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 2b3f19916..aa434e8d8 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -66,17 +66,14 @@ class AdminController extends Controller public function reports(Request $request) { - $this->validate($request, [ - 'filter' => 'nullable|string|in:all,open,closed' - ]); - $filter = $request->input('filter'); + $filter = $request->input('filter') == 'closed' ? 'closed' : 'open'; $reports = Report::orderBy('created_at','desc') ->when($filter, function($q, $filter) { return $filter == 'open' ? $q->whereNull('admin_seen') : $q->whereNotNull('admin_seen'); }) - ->paginate(4); + ->paginate(6); return view('admin.reports.home', compact('reports')); } diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 1eeb480a4..8791856ec 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -23,7 +23,7 @@ class ReportController extends Controller $this->validate($request, [ 'type' => 'required|alpha_dash', 'id' => 'required|integer|min:1', - ]); + ]); return view('report.form'); } @@ -86,11 +86,11 @@ class ReportController extends Controller public function formStore(Request $request) { $this->validate($request, [ - 'report' => 'required|alpha_dash', - 'type' => 'required|alpha_dash', - 'id' => 'required|integer|min:1', - 'msg' => 'nullable|string|max:150', - ]); + 'report' => 'required|alpha_dash', + 'type' => 'required|alpha_dash', + 'id' => 'required|integer|min:1', + 'msg' => 'nullable|string|max:150', + ]); $profile = Auth::user()->profile; $reportType = $request->input('report'); @@ -98,10 +98,26 @@ class ReportController extends Controller $object_type = $request->input('type'); $msg = $request->input('msg'); $object = null; - $types = ['spam', 'sensitive', 'abusive']; + $types = [ + // original 3 + 'spam', + 'sensitive', + 'abusive', + + // new + 'underage', + 'copyright', + 'impersonation', + 'scam', + 'terrorism' + ]; if (!in_array($reportType, $types)) { - return redirect('/timeline')->with('error', 'Invalid report type'); + if($request->wantsJson()) { + return abort(400, 'Invalid report type'); + } else { + return redirect('/timeline')->with('error', 'Invalid report type'); + } } switch ($object_type) { @@ -115,16 +131,28 @@ class ReportController extends Controller break; default: - return redirect('/timeline')->with('error', 'Invalid report type'); + if($request->wantsJson()) { + return abort(400, 'Invalid report type'); + } else { + return redirect('/timeline')->with('error', 'Invalid report type'); + } break; } if ($exists !== 0) { - return redirect('/timeline')->with('error', 'You have already reported this!'); + if($request->wantsJson()) { + return response()->json(200); + } else { + return redirect('/timeline')->with('error', 'You have already reported this!'); + } } if ($object->profile_id == $profile->id) { - return redirect('/timeline')->with('error', 'You cannot report your own content!'); + if($request->wantsJson()) { + return response()->json(200); + } else { + return redirect('/timeline')->with('error', 'You cannot report your own content!'); + } } $report = new Report(); @@ -134,9 +162,13 @@ class ReportController extends Controller $report->object_type = $object_type; $report->reported_profile_id = $object->profile_id; $report->type = $request->input('report'); - $report->message = $request->input('msg'); + $report->message = e($request->input('msg')); $report->save(); - return redirect('/timeline')->with('status', 'Report successfully sent!'); + if($request->wantsJson()) { + return response()->json(200); + } else { + return redirect('/timeline')->with('status', 'Report successfully sent!'); + } } } diff --git a/app/Util/Lexer/RestrictedNames.php b/app/Util/Lexer/RestrictedNames.php index 0309a6b9d..e2968036f 100644 --- a/app/Util/Lexer/RestrictedNames.php +++ b/app/Util/Lexer/RestrictedNames.php @@ -203,6 +203,10 @@ class RestrictedNames 'k', 'key', 'l', + 'lang', + 'language', + '_lang', + '_language', 'lab', 'labs', 'legal', @@ -255,6 +259,8 @@ class RestrictedNames 'quote', 'query', 'r', + 'redirect', + 'redirects', 'register', 'registers', 'review', diff --git a/public/js/activity.js b/public/js/activity.js index 4fdce4aea..3c93e0378 100644 Binary files a/public/js/activity.js and b/public/js/activity.js differ diff --git a/public/js/collectioncompose.js b/public/js/collectioncompose.js index ad65223e1..fca253b9a 100644 Binary files a/public/js/collectioncompose.js and b/public/js/collectioncompose.js differ diff --git a/public/js/collections.js b/public/js/collections.js index e15addb32..373da2b0c 100644 Binary files a/public/js/collections.js and b/public/js/collections.js differ diff --git a/public/js/components.js b/public/js/components.js index 94d407808..611acbe78 100644 Binary files a/public/js/components.js and b/public/js/components.js differ diff --git a/public/js/compose-classic.js b/public/js/compose-classic.js index 143ef3f48..19f28a7d7 100644 Binary files a/public/js/compose-classic.js and b/public/js/compose-classic.js differ diff --git a/public/js/compose.js b/public/js/compose.js index 6da03b4a7..eaf9b1b50 100644 Binary files a/public/js/compose.js and b/public/js/compose.js differ diff --git a/public/js/developers.js b/public/js/developers.js index 6e3921e04..971792301 100644 Binary files a/public/js/developers.js and b/public/js/developers.js differ diff --git a/public/js/direct.js b/public/js/direct.js index 8887f2dd7..a44c1b5bc 100644 Binary files a/public/js/direct.js and b/public/js/direct.js differ diff --git a/public/js/discover.js b/public/js/discover.js index c3ecedaf4..2850656fa 100644 Binary files a/public/js/discover.js and b/public/js/discover.js differ diff --git a/public/js/hashtag.js b/public/js/hashtag.js index 374b06b42..c50c68be7 100644 Binary files a/public/js/hashtag.js and b/public/js/hashtag.js differ diff --git a/public/js/loops.js b/public/js/loops.js index ca4e21ff7..8e36593ae 100644 Binary files a/public/js/loops.js and b/public/js/loops.js differ diff --git a/public/js/memoryprofile.js b/public/js/memoryprofile.js index 03cad8a2b..5e1299c2a 100644 Binary files a/public/js/memoryprofile.js and b/public/js/memoryprofile.js differ diff --git a/public/js/my2020.js b/public/js/my2020.js index 012bf3c58..0d23717f5 100644 Binary files a/public/js/my2020.js and b/public/js/my2020.js differ diff --git a/public/js/profile-directory.js b/public/js/profile-directory.js index 088c14b9f..ec442eacf 100644 Binary files a/public/js/profile-directory.js and b/public/js/profile-directory.js differ diff --git a/public/js/profile.js b/public/js/profile.js index 093fe50cc..e7a1361d3 100644 Binary files a/public/js/profile.js and b/public/js/profile.js differ diff --git a/public/js/rempos.js b/public/js/rempos.js index 951e773bf..a5cd7c1ba 100644 Binary files a/public/js/rempos.js and b/public/js/rempos.js differ diff --git a/public/js/rempro.js b/public/js/rempro.js index e1263debb..dec7b851c 100644 Binary files a/public/js/rempro.js and b/public/js/rempro.js differ diff --git a/public/js/search.js b/public/js/search.js index adffbe81a..d0c96a5d6 100644 Binary files a/public/js/search.js and b/public/js/search.js differ diff --git a/public/js/status.js b/public/js/status.js index 7cee12597..78d2c8efe 100644 Binary files a/public/js/status.js and b/public/js/status.js differ diff --git a/public/js/story-compose.js b/public/js/story-compose.js index 4e8dcfd16..1fcbde913 100644 Binary files a/public/js/story-compose.js and b/public/js/story-compose.js differ diff --git a/public/js/timeline.js b/public/js/timeline.js index 472cfa91e..f6c7c2080 100644 Binary files a/public/js/timeline.js and b/public/js/timeline.js differ diff --git a/public/js/vendor.js b/public/js/vendor.js index b7bebbf2f..d76fb694c 100644 Binary files a/public/js/vendor.js and b/public/js/vendor.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index cd79457ab..167da845a 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components.js b/resources/assets/js/components.js index d2e79dc59..2ed522818 100644 --- a/resources/assets/js/components.js +++ b/resources/assets/js/components.js @@ -27,8 +27,8 @@ pixelfed.readmore = () => { el.readmore({ collapsedHeight: 45, heightMargin: 48, - moreLink: 'Read more ...', - lessLink: 'Hide', + moreLink: 'Show more', + lessLink: 'Show less', }); }); }; diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 83418090b..7525db9c9 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -601,17 +601,17 @@ size="sm" body-class="list-group-flush p-0 rounded">
+
+
+
+
{{$ai}}
- Appeal {{$ai == 1 ? 'Request' : 'Requests'}} - - -{{$spam}}
- Flagged {{$ai == 1 ? 'Post' : 'Posts'}} - -{{$report->type}}
- @if($report->reporter && $report->status) -{{$report->reporter->username}} reported this post
- @else -- @if(!$report->reporter) - Deleted user - @else - {{$report->reporter->username}} - @endif - reported this - @if(!$report->status) - deleted post - @else - post - @endif +
{{$ai}}
+ Appeal {{$ai == 1 ? 'Request' : 'Requests'}} + + +{{$spam}}
+ Flagged {{$ai == 1 ? 'Post' : 'Posts'}} + +{{$report->type}}
+ @if($report->reporter && $report->status) +{{$report->reporter->username}} reported this post
+ @else ++ @if(!$report->reporter) + Deleted user + @else + {{$report->reporter->username}} + @endif + reported this + @if(!$report->status) + deleted post + @else + post + @endif -
+ - @endif -No reports found
-No reports found
++ Report #{{$report->id}} - + {{ucfirst($report->type)}} +
++ Reported {{$report->created_at->diffForHumans()}} by @{{$report->reporter->username}}. +
+- Message: - {{$report->message ?? 'No message provided.'}} -
++ {{$report->status->media()->count() ? 'Caption' : 'Comment'}}: {{$report->status->caption}} +
+ @endif ++ Like Count: {{$report->status->likes_count}} +
++ Share Count: {{$report->status->reblogs_count}} +
++ Timestamp: {{now()->parse($report->status->created_at)->format('r')}} +
++ URL: {{$report->status->url()}} +
+Resolved {{$report->admin_seen->diffForHumans()}}
- @endif -+ Total Reports: {{App\Report::whereReportedProfileId($report->reportedUser->id)->count()}} +
++ Total Warnings: {{App\AccountInterstitial::whereUserId($report->reportedUser->user_id)->count()}} +
++ Status Count: {{$report->reportedUser->status_count}} +
++ Follower Count: {{$report->reportedUser->followers_count}} +
++ Joined: {{$report->reportedUser->created_at->diffForHumans(null, null, false)}} +
++ Status Count: {{$report->reporter->status_count}} +
++ Follower Count: {{$report->reporter->followers_count}} +
++ Joined: {{$report->reporter->created_at->diffForHumans(null, null, false)}} +
+