FEATURE #1359: add working user edit

Finally user can be edited in admin. Admin can change password and role of given user.
This commit is contained in:
Michal Kváček
2016-01-24 21:18:27 +01:00
parent bad25cb161
commit 1767872402
6 changed files with 85 additions and 27 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ return [
'editUser' => 'Editing user :name (:email)',
'usersActions' => 'User\'s actions',
'update' => 'Update informations',
'passwordLeaveEmpty' => 'Leave empty, if you do not want to change it.'
'passwordLeaveEmpty' => 'Leave empty, if you do not want to change it.',
'userSuccessfullyEdited' => 'User successfully edited.',
];
@@ -30,6 +30,19 @@
</div>
<div class="columns large-8">
@if (session('success'))
<div class="callout success">
{{ session('success') }}
</div>
@endif
@if (session('error'))
<div class="callout alert">
{{ session('error') }}
</div>
@endif
<div class="callout">
<h3>@lang('admin/userManagement.editUser', ['name' => str_limit($user->name, 20), 'email' => $user->email])</h3>
@include('admin.userManagement.editForm')
@@ -1,8 +1,6 @@
<form method="POST" action="{{route('users.newPost')}}">
<form method="POST" action="{{route('users.editPost', ['id' => $user->id])}}">
{!! csrf_field() !!}
<input type="hidden" value="{{$user->id}}" name="userId" />
<label>
@lang('admin/userManagement.name')
<input type="text" placeholder="@lang('admin/userManagement.name')" value="{{$user->name}}" name="name">
@@ -20,14 +18,14 @@
@endif
</label>
<label>
@lang('admin/userManagement.password') <em>(@lang('admin/userManagement.passwordLeaveEmpty'))</em>
<input type="text" name="password" value="">
</label>
@if (\Auth::user()->role == \App\Models\User::ROLE_ADMIN)
<label>
@lang('admin/userManagement.password') <em>(@lang('admin/userManagement.passwordLeaveEmpty'))</em>
<input type="text" name="password" value="">
</label>
<label>
@lang('admin/userManagement.roles')