Files
core/resources/views/admin/userManagement/editForm.blade.php
T
Michal Kváček 452280a6fe FEATURE: remove @lang() from blade templates when translating enumerations.
Enumerations are translated right after inserting into collection, so there is no need to translate it again.
2016-01-27 01:58:57 +01:00

65 lines
2.0 KiB
PHP

<form method="POST" action="{{route('users.editPost', ['id' => $user->id])}}">
{!! csrf_field() !!}
<label>
@lang('admin/userManagement.name')
<input type="text" placeholder="@lang('admin/userManagement.name')" value="{{$user->name}}" name="name">
</label>
<label>
@lang('admin/userManagement.email')
<input type="text" name="email" value="{{$user->email}}" placeholder="somebody@example.com">
@if (isset($errors) && $errors->has('email'))
<div class="callout alert">
{{ $errors->first('email') }}
</div>
@endif
</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')
<select name="role">
@foreach($roles as $role => $translation)
<option value="{{$role}}" @if($role == $user->role) selected @endif>{{$translation}}</option>
@endforeach
</select>
</label>
@if (isset($errors) && $errors->has('role'))
<div class="callout alert">
{{ $errors->first('role') }}
</div>
@endif
<label>
@lang('admin/userManagement.status')
<select name="status">
@foreach($states as $status => $translation)
<option value="{{$status}}" @if($status == $user->status) selected @endif>{{$translation}}</option>
@endforeach
</select>
</label>
@if (isset($errors) && $errors->has('role'))
<div class="callout alert">
{{ $errors->first('role') }}
</div>
@endif
@endif
<label>
<button type="submit" class="button success">@lang('admin/userManagement.update')</button>
</label>
</form>