From feb7dfea84db1cf4fc9620ce4ae1042090b176b1 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Sun, 21 Dec 2014 10:14:58 +0000 Subject: [PATCH] User profile can be updated by clicking on profile picture --- app/controllers/DashUserController.php | 28 +++++++++++++ app/lang/en/cachet.php | 1 + app/routes/dashboard.php | 4 ++ app/views/dashboard/user.blade.php | 39 +++++++++++++++++++ .../partials/dashboard/sidebar.blade.php | 2 +- 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 app/controllers/DashUserController.php create mode 100644 app/views/dashboard/user.blade.php diff --git a/app/controllers/DashUserController.php b/app/controllers/DashUserController.php new file mode 100644 index 00000000..39579ad4 --- /dev/null +++ b/app/controllers/DashUserController.php @@ -0,0 +1,28 @@ +with([ + 'pageTitle' => 'User - Dashboard', + ]); + } + + /** + * Updates the statsu page user. + * @return \Illuminate\View\View + */ + public function postUser() + { + $items = Input::all(); + + $updated = Auth::user()->update($items); + + return Redirect::back()->with('updated', $updated); + } +} diff --git a/app/lang/en/cachet.php b/app/lang/en/cachet.php index f5509492..c4c44b84 100644 --- a/app/lang/en/cachet.php +++ b/app/lang/en/cachet.php @@ -43,5 +43,6 @@ return [ 'notifications' => 'Notifications', 'toggle_navigation' => 'Toggle Navigation', 'search' => 'Search...', + 'user' => 'User', ], ]; diff --git a/app/routes/dashboard.php b/app/routes/dashboard.php index f77025c4..66a835ef 100644 --- a/app/routes/dashboard.php +++ b/app/routes/dashboard.php @@ -28,4 +28,8 @@ Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function () { // Settings Route::get('settings', ['as' => 'dashboard.settings', 'uses' => 'DashSettingsController@showSettings']); Route::post('settings', 'DashSettingsController@postSettings'); + + // User Settings + Route::get('user', ['as' => 'dashboard.user', 'uses' => 'DashUserController@showUser']); + Route::post('user', 'DashUserController@postUser'); }); diff --git a/app/views/dashboard/user.blade.php b/app/views/dashboard/user.blade.php new file mode 100644 index 00000000..31a6ba8c --- /dev/null +++ b/app/views/dashboard/user.blade.php @@ -0,0 +1,39 @@ +@extends('layout.dashboard') + +@section('content') +
+ {{ Lang::get('cachet.dashboard.user') }} +
+
+
+ @if($updated = Session::get('updated')) +
+ @if($updated) + Awesome. Profile updated. + @else + Whoops. Something went wrong when updating. + @endif +
+ @endif + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+@stop diff --git a/app/views/partials/dashboard/sidebar.blade.php b/app/views/partials/dashboard/sidebar.blade.php index d86cba12..0a6c06c1 100644 --- a/app/views/partials/dashboard/sidebar.blade.php +++ b/app/views/partials/dashboard/sidebar.blade.php @@ -3,7 +3,7 @@