From 0bb4ca78f5c7f1331aca6db3147a98199f1cdacd Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 4 Jan 2018 08:14:39 -0600 Subject: [PATCH] Fix links on admin dashboard --- app/Repositories/UserRepository.php | 4 +++ .../views/admin/dashboard/index.blade.php | 28 ++----------------- resources/views/admin/sidebar.blade.php | 8 ++++++ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index c9f3ca2c..5d6d3df4 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -59,6 +59,10 @@ class UserRepository extends BaseRepository $where['email'] = $request->email; } + if ($request->filled('state')) { + $where['state'] = $request->state; + } + $this->pushCriteria(new WhereCriteria($request, $where)); return $this; } diff --git a/resources/views/admin/dashboard/index.blade.php b/resources/views/admin/dashboard/index.blade.php index 49e97f08..9eac8441 100644 --- a/resources/views/admin/dashboard/index.blade.php +++ b/resources/views/admin/dashboard/index.blade.php @@ -12,14 +12,14 @@ @slot('icon', 'pe-7s-users') @slot('type', 'Pilots') @slot('pending', $pending_users) - @slot('link', route('admin.users.index').'?search=state:0') + @slot('link', route('admin.users.index').'?state='.UserState::PENDING) @endcomponent @component('admin.components.infobox') @slot('icon', 'pe-7s-cloud-upload') @slot('type', 'PIREPs') @slot('pending', $pending_pireps) - @slot('link', route('admin.pireps.index').'?search=state:0') + @slot('link', route('admin.pireps.index').'?search=state:'.PirepState::PENDING) @endcomponent @@ -30,24 +30,6 @@
- - {{--
- @component('admin.components.infobox') - @slot('icon', 'pe-7s-users') - @slot('type', 'Pilots') - @slot('pending', 5) - @slot('total', 60) - @endcomponent -
- -
- @component('admin.components.infobox') - @slot('icon', 'pe-7s-cloud-upload') - @slot('type', 'PIREPs') - @slot('pending', 5) - @slot('total', 60) - @endcomponent -
--}} @@ -59,12 +41,6 @@ - -
-
-

@version

-
-
@endsection diff --git a/resources/views/admin/sidebar.blade.php b/resources/views/admin/sidebar.blade.php index 75714e18..ef8d1fc8 100644 --- a/resources/views/admin/sidebar.blade.php +++ b/resources/views/admin/sidebar.blade.php @@ -16,5 +16,13 @@ + +
+ +
+
+

@version

+
+