diff --git a/app/Database/seeds/sample.yml b/app/Database/seeds/sample.yml index 3759d5f3..792204b6 100644 --- a/app/Database/seeds/sample.yml +++ b/app/Database/seeds/sample.yml @@ -36,7 +36,7 @@ users: home_airport_id: KJFK curr_airport_id: KJFK flights: 1 - flight_time: 43200 + flight_time: 4320 created_at: now updated_at: now state: 0 @@ -50,7 +50,7 @@ users: home_airport_id: KJFK curr_airport_id: KAUS flights: 1 - flight_time: 43200 + flight_time: 4320 created_at: now updated_at: now state: 1 diff --git a/app/Http/Controllers/Frontend/UserController.php b/app/Http/Controllers/Frontend/UserController.php new file mode 100644 index 00000000..c7e1f45f --- /dev/null +++ b/app/Http/Controllers/Frontend/UserController.php @@ -0,0 +1,30 @@ +userRepo = $userRepo; + } + + /** + * + */ + public function index(Request $request) + { + return $this->view('users.index',[ + 'country' => new \League\ISO3166\ISO3166(), + 'users' => $this->userRepo->orderBy('name', 'desc')->paginate(25), + ]); + } +} diff --git a/app/Models/User.php b/app/Models/User.php index a4f46c1b..068d64b8 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -88,14 +88,21 @@ class User extends Authenticatable } /** + * @param mixed $size Size of the gravatar, in pixels * @return string */ - public function getGravatarAttribute() + public function gravatar($size=null) { - $size = config('gravatar.size'); $default = config('gravatar.default'); - return config('gravatar.url') . - md5(strtolower(trim($this->email))) . '?d=' . urlencode($default ) . '&s=' . $size; + + $uri = config('gravatar.url') + . md5(strtolower(trim($this->email))).'?d='.urlencode($default); + + if($size !== null) { + $uri .= '&s='.$size; + } + + return $uri; } /** diff --git a/app/Routes/web.php b/app/Routes/web.php index 6c0ecaa9..0de76cbb 100755 --- a/app/Routes/web.php +++ b/app/Routes/web.php @@ -11,6 +11,9 @@ Route::group([ Route::get('r/{id}', 'PirepController@show')->name('pirep.show.public'); Route::get('p/{id}', 'ProfileController@show')->name('profile.show.public'); + Route::get('users', 'UserController@index')->name('users.show'); + Route::get('pilots', 'UserController@index')->name('users.show'); + Route::get('livemap', 'AcarsController@index')->name('livemap.public'); }); diff --git a/config/gravatar.php b/config/gravatar.php index b54e356f..2b3c1090 100644 --- a/config/gravatar.php +++ b/config/gravatar.php @@ -5,6 +5,5 @@ return [ 'url' => 'https://www.gravatar.com/avatar/', - 'default' => 'https://en.gravatar.com/userimage/12856995/7c7c1da6387853fea65ff74983055386.png', - 'size' => 80, + 'default' => 'https://en.gravatar.com/userimage/12856995/aa6c0527a723abfd5fb9e246f0ff8af4.png', ]; diff --git a/resources/views/admin/pireps/fields.blade.php b/resources/views/admin/pireps/fields.blade.php index 83bb3f06..70489d50 100644 --- a/resources/views/admin/pireps/fields.blade.php +++ b/resources/views/admin/pireps/fields.blade.php @@ -1,7 +1,7 @@
| Name |
|---|
| + | Name | ++ | Airline | +Location | +Flights | +Hours | + + + @foreach($users as $user) +
|---|---|---|---|---|---|---|
|
+
+
+ |
+ + + {!! $user->name !!} + + | ++ @if(filled($user->country)) + + @endif + | +{!! $user->airline->icao !!} | +{!! $user->curr_airport_id !!} | +{!! $user->flights !!} | +{!! \App\Facades\Utils::minutesToTimeString($user->flight_time) !!} | +