From 6df573e50c5f44dd5e4920bee7bcc2a7ce502808 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Sat, 4 Mar 2017 00:14:21 +0100 Subject: [PATCH] retheme admin users list --- app/Http/Controllers/Admin/UserController.php | 8 +- .../pterodactyl/admin/users/index.blade.php | 84 +++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 resources/themes/pterodactyl/admin/users/index.blade.php diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 1b1079143..0de02eca9 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -47,8 +47,14 @@ class UserController extends Controller // @TODO: implement nicolaslopezj/searchable to clean up this disaster. public function getIndex(Request $request) { + $users = User::withCount('servers'); + + if (! is_null($request->input('query'))) { + $users->search($request->input('query')); + } + return view('admin.users.index', [ - 'users' => User::paginate(25), + 'users' => $users->paginate(25), ]); } diff --git a/resources/themes/pterodactyl/admin/users/index.blade.php b/resources/themes/pterodactyl/admin/users/index.blade.php new file mode 100644 index 000000000..3832c0374 --- /dev/null +++ b/resources/themes/pterodactyl/admin/users/index.blade.php @@ -0,0 +1,84 @@ +{{-- Copyright (c) 2015 - 2017 Dane Everitt --}} + +{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}} +{{-- of this software and associated documentation files (the "Software"), to deal --}} +{{-- in the Software without restriction, including without limitation the rights --}} +{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}} +{{-- copies of the Software, and to permit persons to whom the Software is --}} +{{-- furnished to do so, subject to the following conditions: --}} + +{{-- The above copyright notice and this permission notice shall be included in all --}} +{{-- copies or substantial portions of the Software. --}} + +{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}} +{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}} +{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}} +{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}} +{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}} +{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}} +{{-- SOFTWARE. --}} +@extends('layouts.admin') + +@section('title') + List Users +@endsection + +@section('content-header') +

UsersAll registered users on the system.

+ +@endsection + +@section('content') +
+
+
+
+

User List

+
+
+
+ +
+ + +
+
+
+
+
+
+ + + + + + + + + + + @foreach ($users as $user) + + + + + + + + + @endforeach + +
ID + Email + Client NameUsernameServers
{{ $user->id }}{{ $user->email }}{{ $user->name_last }}, {{ $user->name_first }}{{ $user->username }}{{ $user->servers_count }}
+
+ +
+
+
+@endsection