FEATURE: make user management nicer

This commit is contained in:
Michal Kváček
2016-09-04 21:31:56 +02:00
parent 9b64b54d7b
commit b73b575b71
6 changed files with 97 additions and 80 deletions
@@ -1,26 +1,61 @@
<form method="POST" action="{{route('users.editPost', ['id' => $user->id])}}">
{!! csrf_field() !!}
<input type="text" class="form-control" placeholder="@lang('admin/userManagement.name')" value="{{$user->name}}"
name="name">
<input type="text" class="form-control" name="email" value="{{$user->email}}" placeholder="somebody@example.com">
<div class="row">
<div class="col-lg-6">
<label class="label-control">
@lang('admin/userManagement.name')
</label>
<input type="text" class="form-control" placeholder="@lang('admin/userManagement.name')"
value="{{$user->name}}"
name="name">
</div>
<div class="col-lg-6">
<label class="label-control">
@lang('admin/userManagement.email')
</label>
<input type="text" class="form-control" name="email" value="{{$user->email}}"
placeholder="somebody@example.com">
</div>
</div>
<label class="label-control">
@lang('admin/userManagement.password') (@lang('admin/userManagement.passwordLeaveEmpty'))
</label>
<input type="text" class="form-control"
placeholder="@lang('admin/userManagement.password') (@lang('admin/userManagement.passwordLeaveEmpty'))"
placeholder="@lang('admin/userManagement.password')"
name="password"
value="">
@if (\Auth::user()->role == \App\Models\User::ROLE_ADMIN && \Auth::user()->id != $user->id)
<select class="form-control" name="role">
@foreach($roles as $role => $translation)
<option value="{{$role}}" @if($role == $user->role) selected @endif>{{$translation}}</option>
@endforeach
</select>
<div class="row">
<div class="col-lg-6">
<select class="form-control" name="status">
@foreach($states as $status => $translation)
<option value="{{$status}}" @if($status == $user->status) selected @endif>{{$translation}}</option>
@endforeach
</select>
<label class="label-control">
@lang('admin/userManagement.roles')
</label>
<select class="form-control" name="role">
@foreach($roles as $role => $translation)
<option value="{{$role}}" @if($role == $user->role) selected @endif>{{$translation}}</option>
@endforeach
</select>
</div>
<div class="col-lg-6">
<label class="label-control">
@lang('admin/userManagement.status')
</label>
<select class="form-control" name="status">
@foreach($states as $status => $translation)
<option value="{{$status}}"
@if($status == $user->status) selected @endif>{{$translation}}</option>
@endforeach
</select>
</div>
</div>
@endif
<button type="submit" class="btn btn-primary">@lang('admin/userManagement.update')</button>