Fixed incorrect role showing

This commit is contained in:
Dan Brown 2015-08-31 11:59:10 +01:00
parent 598fd7811b
commit a5807097e2
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
@foreach($options as $option)
<option value="{{$option->id}}"
@if($errors->has($name)) class="neg" @endif
@if(isset($model) || old($name)) @if(old($name) && old($name) === $option->id) selected @elseif(isset($model) && $model->id === $option->id) selected @endif @endif
@if(isset($model) || old($name)) @if(old($name) && old($name) === $option->id) selected @elseif(isset($model) && $model->role->id === $option->id) selected @endif @endif
>
{{ $option->$displayKey }}
</option>

View File

@ -19,7 +19,7 @@
@if($currentUser->can('user-update'))
<div class="form-group">
<label for="role">User Role</label>
@include('form/model-select', ['name' => 'role', 'options' => \Oxbow\Role::all(), 'displayKey' => 'display_name'])
@include('form.role-select', ['name' => 'role', 'options' => \Oxbow\Role::all(), 'displayKey' => 'display_name'])
</div>
@endif