blue-twilight/resources/views/themes/base/admin/edit_user.blade.php

141 lines
8.5 KiB
PHP
Raw Normal View History

@extends('themes.base.layout')
@section('title', trans('admin.edit_user_title', ['name' => $user->name]))
@section('breadcrumb')
<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>
@endsection
@section('content')
<div class="container">
<div class="row">
<div class="col">
<h1>@yield('title')</h1>
<p>@lang('admin.edit_user_intro')</p>
<hr/>
<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">
<div class="form-group{{ $errors->has('name') ? ' has-danger' : '' }}">
<label class="form-control-label" for="user-name">@lang('forms.name_label')</label>
<input type="text" class="form-control" id="user-name" name="name" value="{{ old('name') }}">
@if ($errors->has('name'))
<div class="form-control-feedback">
<strong>{{ $errors->first('name') }}</strong>
</div>
@endif
</div>
</div>
<div class="col-sm-6">
<div class="form-group{{ $errors->has('email') ? ' has-danger' : '' }}">
<label class="form-control-label" for="user-email">@lang('forms.email_label')</label>
<input type="text" class="form-control" id="user-email" name="email" value="{{ old('email') }}">
@if ($errors->has('email'))
<div class="form-control-feedback">
<strong>{{ $errors->first('email') }}</strong>
</div>
@endif
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group{{ $errors->has('password') ? ' has-danger' : '' }}">
<label class="form-control-label" for="user-password">@lang('forms.password_label')</label>
<input type="password" class="form-control" id="user-password" name="password" value="{{ old('password') }}">
@if ($errors->has('password'))
<div class="form-control-feedback">
<strong>{{ $errors->first('password') }}</strong>
</div>
@endif
</div>
</div>
<div class="col-sm-6">
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-danger' : '' }}">
<label class="form-control-label" for="user-password-confirm">@lang('forms.password_confirm_label')</label>
<input type="password" class="form-control" id="user-password-confirm" name="password_confirmation" value="{{ old('password_confirmation') }}">
@if ($errors->has('password_confirmation'))
<div class="form-control-feedback">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</div>
@endif
</div>
</div>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="is_admin"@if ($user->is_admin) checked="checked"@endif>
@lang('forms.admin_user_label')
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="can_create_albums"@if ($user->can_create_albums) checked="checked"@endif>
@lang('forms.can_create_albums_label')
</label>
</div>
@if (!$user->is_activated)
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="is_activated">
<strong>@lang('forms.activate_user_label')</strong>
</label>
</div>
@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)
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="user_group_id[]" value="{{ $group->id }}"@if (in_array($group->id, $users_groups)) checked="checked"@endif>
{{ $group->name }}
</label>
</div>
@endforeach
@else
@endif
</div>
</div>
<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>
</div>
</form>
</div>
</div>
</div>
@endsection