diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ca01467..b3eb5a14d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Update Direct Messages, fix api endpoint ([fe8728c0](https://github.com/pixelfed/pixelfed/commit/fe8728c0)) - Update nginx config ([fbdc6358](https://github.com/pixelfed/pixelfed/commit/fbdc6358)) - Update api routes, add DeprecatedEndpoint middleware. For more info, visit [pixelfed.org/kb/10404](https://pixelfed.org/kb/10404) ([a8453e77](https://github.com/pixelfed/pixelfed/commit/a8453e77)) +- Update admin dashboard, improve users section ([36b6bf48](https://github.com/pixelfed/pixelfed/commit/36b6bf48)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8) diff --git a/app/Http/Controllers/Admin/AdminUserController.php b/app/Http/Controllers/Admin/AdminUserController.php index 766299097..441f5b305 100644 --- a/app/Http/Controllers/Admin/AdminUserController.php +++ b/app/Http/Controllers/Admin/AdminUserController.php @@ -11,6 +11,7 @@ use App\Mail\AdminMessage; use Illuminate\Support\Facades\Mail; use App\Services\ModLogService; use App\Jobs\DeletePipeline\DeleteAccountPipeline; +use App\Services\AccountService; trait AdminUserController { @@ -25,7 +26,7 @@ trait AdminUserController 'next' => $offset + 1, 'query' => $search ? '&a=search&q=' . $search : null ]; - $users = User::select('id', 'username', 'status', 'profile_id') + $users = User::select('id', 'username', 'status', 'profile_id', 'is_admin') ->orderBy($col, $dir) ->when($search, function($q, $search) { return $q->where('username', 'like', "%{$search}%"); @@ -34,7 +35,11 @@ trait AdminUserController return $q->offset(($offset * 10)); }) ->limit(10) - ->get(); + ->get() + ->map(function($u) { + $u['account'] = AccountService::get($u->profile_id, true); + return $u; + }); return view('admin.users.home', compact('users', 'pagination')); } diff --git a/resources/views/admin/users/home.blade.php b/resources/views/admin/users/home.blade.php index 973d45367..cd75062a4 100644 --- a/resources/views/admin/users/home.blade.php +++ b/resources/views/admin/users/home.blade.php @@ -20,29 +20,51 @@
+ | --}}ID | -+ | Username | +
+ Status Count + |
+
+ Followers Count + |
+
+ Following Count + |
Actions |
---|---|---|---|---|---|---|---|
+
+
+
+
+ | --}}
{{$user->id}} | + + {{$user->username}} | +0 | +0 | +0 | Account Deleted @@ -51,10 +73,19 @@ | |
+
+
+
+
+ | --}}
{{$user->id}} | -+ | + @if($user->account) + + @endif {{$user->username}} @if($user->is_admin) @@ -62,6 +93,27 @@ @endif | ++ @if($user->account) + {{$user->account['statuses_count']}} + @else + 0 + @endif + | ++ @if($user->account) + {{$user->account['followers_count']}} + @else + 0 + @endif + | ++ @if($user->account) + {{$user->account['following_count']}} + @else + 0 + @endif + | @@ -75,6 +127,11 @@ Mod Tools + @if($user->status !== 'deleted' && !$user->is_admin) + + Delete + + @endif |