Commit 46f8e719 authored by Micheal Mand's avatar Micheal Mand Committed by Nicolas Widart

Add "Update and Back" button to User edit (#245)

Allows developer to let users edit their own profile without having an
error upon saving because they cannot list all users.
Signed-off-by: 's avatarMicheal Mand <micheal@kmdwebdesigns.com>
parent f82421f8
......@@ -2,6 +2,7 @@
namespace Modules\User\Http\Controllers\Admin;
use Illuminate\Http\Response;
use Modules\User\Contracts\Authentication;
use Modules\User\Events\UserHasBegunResetProcess;
use Modules\User\Http\Requests\CreateUserRequest;
......@@ -119,7 +120,12 @@ class UserController extends BaseUserModuleController
$this->user->updateAndSyncRoles($id, $data, $request->roles);
return redirect()->route('admin.user.user.index')
if ($request->get('button') === 'index') {
return redirect()->route('admin.user.user.index')
->withSuccess(trans('user::messages.user updated'));
}
return redirect()->back()
->withSuccess(trans('user::messages.user updated'));
}
......
......@@ -114,9 +114,13 @@
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">{{ trans('user::button.update') }}</button>
<button class="btn btn-default btn-flat" name="button" type="reset">{{ trans('core::core.button.reset') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('admin.user.user.index')}}"><i class="fa fa-times"></i> {{ trans('user::button.cancel') }}</a>
<button type="submit" class="btn btn-primary btn-flat" name="button" value="index">
<i class="fa fa-angle-left"></i>
{{ trans('core::core.button.update and back') }}
</button>
<button type="submit" class="btn btn-primary btn-flat">{{ trans('core::core.button.update') }}</button>
<button type="reset" class="btn btn-default btn-flat" name="button">{{ trans('core::core.button.reset') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ route('admin.user.user.index')}}"><i class="fa fa-times"></i> {{ trans('core::core.button.cancel') }}</a>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment