2017-09-10 21:12:57 +01:00
|
|
|
@extends(Theme::viewName('layout'))
|
2016-10-03 14:11:24 +01:00
|
|
|
@section('title', trans('admin.edit_user_title', ['name' => $user->name]))
|
|
|
|
|
|
|
|
@section('breadcrumb')
|
2017-03-26 21:29:10 +01:00
|
|
|
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('users.index') }}">@lang('navigation.breadcrumb.users')</a></li>
|
|
|
|
<li class="breadcrumb-item active">@lang('navigation.breadcrumb.edit_user')</li>
|
2016-10-03 14:11:24 +01:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
2017-03-26 21:29:10 +01:00
|
|
|
<div class="col">
|
2016-10-03 14:11:24 +01:00
|
|
|
<h1>@yield('title')</h1>
|
|
|
|
<p>@lang('admin.edit_user_intro')</p>
|
|
|
|
<hr/>
|
|
|
|
|
2017-03-26 21:29:10 +01:00
|
|
|
<form action="{{ route('users.update', [$user->id]) }}" method="post">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
{{ method_field('PUT') }}
|
|
|
|
|
|
|
|
<div>
|
|
|
|
{{-- Nav tabs --}}
|
|
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
|
|
@include(Theme::viewName('partials.tab'), ['active_tab' => 'details', 'tab_name' => 'details', 'tab_icon' => 'info-circle', 'tab_text' => trans('admin.user_details_tab')])
|
|
|
|
@include(Theme::viewName('partials.tab'), ['active_tab' => 'details', 'tab_name' => 'groups', 'tab_icon' => 'users', 'tab_text' => trans('admin.user_groups_tab')])
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
{{-- Tab panes --}}
|
|
|
|
<div class="tab-content">
|
|
|
|
{{-- Details --}}
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="details-tab">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="form-group">
|
2017-03-26 21:29:10 +01:00
|
|
|
<label class="form-control-label" for="user-name">@lang('forms.name_label')</label>
|
2017-09-01 14:52:06 +01:00
|
|
|
<input type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" id="user-name" name="name" value="{{ old('name') }}">
|
2017-03-26 21:29:10 +01:00
|
|
|
|
|
|
|
@if ($errors->has('name'))
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="invalid-feedback">
|
2017-03-26 21:29:10 +01:00
|
|
|
<strong>{{ $errors->first('name') }}</strong>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
2017-02-14 11:03:58 +00:00
|
|
|
</div>
|
|
|
|
|
2017-03-26 21:29:10 +01:00
|
|
|
<div class="col-sm-6">
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="form-group">
|
2017-03-26 21:29:10 +01:00
|
|
|
<label class="form-control-label" for="user-email">@lang('forms.email_label')</label>
|
2017-09-01 14:52:06 +01:00
|
|
|
<input type="text" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" id="user-email" name="email" value="{{ old('email') }}">
|
2017-03-26 21:29:10 +01:00
|
|
|
|
|
|
|
@if ($errors->has('email'))
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="invalid-feedback">
|
2017-03-26 21:29:10 +01:00
|
|
|
<strong>{{ $errors->first('email') }}</strong>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
2017-02-14 11:03:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-03 14:11:24 +01:00
|
|
|
|
2017-03-26 21:29:10 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="form-group">
|
2017-03-26 21:29:10 +01:00
|
|
|
<label class="form-control-label" for="user-password">@lang('forms.password_label')</label>
|
2017-09-01 14:52:06 +01:00
|
|
|
<input type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" id="user-password" name="password" value="{{ old('password') }}">
|
2017-03-26 21:29:10 +01:00
|
|
|
|
|
|
|
@if ($errors->has('password'))
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="invalid-feedback">
|
2017-03-26 21:29:10 +01:00
|
|
|
<strong>{{ $errors->first('password') }}</strong>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
2017-02-14 11:03:58 +00:00
|
|
|
</div>
|
|
|
|
|
2017-03-26 21:29:10 +01:00
|
|
|
<div class="col-sm-6">
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="form-group">
|
2017-03-26 21:29:10 +01:00
|
|
|
<label class="form-control-label" for="user-password-confirm">@lang('forms.password_confirm_label')</label>
|
2017-09-01 14:52:06 +01:00
|
|
|
<input type="password" class="form-control{{ $errors->has('password_confirmation') ? ' is-invalid' : '' }}" id="user-password-confirm" name="password_confirmation" value="{{ old('password_confirmation') }}">
|
2017-03-26 21:29:10 +01:00
|
|
|
|
|
|
|
@if ($errors->has('password_confirmation'))
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="invalid-feedback">
|
2017-03-26 21:29:10 +01:00
|
|
|
<strong>{{ $errors->first('password_confirmation') }}</strong>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
2017-02-14 11:03:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-21 21:48:55 +00:00
|
|
|
|
2018-07-12 23:46:59 +01:00
|
|
|
<div class="form-check">
|
|
|
|
<input type="checkbox" class="form-check-input" id="is-admin" name="is_admin"@if (old('is_admin', $user->is_admin)) checked="checked"@endif>
|
|
|
|
<label class="form-check-label" for="is-admin">@lang('forms.admin_user_label')</label>
|
2017-02-14 11:03:58 +00:00
|
|
|
</div>
|
2016-10-03 14:11:24 +01:00
|
|
|
|
2017-03-26 21:29:10 +01:00
|
|
|
@if (!$user->is_activated)
|
2018-07-12 23:46:59 +01:00
|
|
|
<div class="form-check">
|
|
|
|
<input type="checkbox" class="form-check-input" id="is-activated" name="is_activated"@if (old('is_activated', $user->is_activated)) checked="checked"@endif>
|
|
|
|
<label class="form-check-label" for="is-activated">@lang('forms.activate_user_label')</label>
|
2017-02-14 11:03:58 +00:00
|
|
|
</div>
|
2017-03-26 21:29:10 +01:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{-- Groups --}}
|
|
|
|
<div role="tabpanel" class="tab-pane" id="groups-tab">
|
|
|
|
@if ($groups->count() > 0)
|
|
|
|
<p style="margin-bottom: 20px;">@lang('admin.user_groups_list_select', ['name' => $user->name])</p>
|
|
|
|
|
|
|
|
@foreach ($groups as $group)
|
2018-07-12 23:46:59 +01:00
|
|
|
<div class="form-check">
|
|
|
|
<input type="checkbox" class="form-check-input" id="user-group-{{ $group->id }}" name="user_group_id[]" value="{{ $group->id }}" @if (in_array($group->id, $users_groups)) checked="checked"@endif>
|
|
|
|
<label class="form-check-label" for="user-group-{{ $group->id }}">{{ $group->name }}</label>
|
2017-03-26 21:29:10 +01:00
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
@else
|
|
|
|
@endif
|
|
|
|
</div>
|
2016-10-03 14:11:24 +01:00
|
|
|
</div>
|
|
|
|
|
2017-03-26 21:29:10 +01:00
|
|
|
<div class="text-right" style="margin-top: 20px;">
|
|
|
|
<a href="{{ route('users.index') }}" class="btn btn-link">@lang('forms.cancel_action')</a>
|
|
|
|
<button type="submit" class="btn btn-success"><i class="fa fa-fw fa-check"></i> @lang('forms.save_action')</button>
|
|
|
|
</div>
|
2016-10-03 14:11:24 +01:00
|
|
|
</div>
|
2017-03-26 21:29:10 +01:00
|
|
|
</form>
|
2016-10-03 14:11:24 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|