[WIP] Setup of skeleton
This commit is contained in:
12
resources/views/users/users/agenda.blade.php
Normal file
12
resources/views/users/users/agenda.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<div id="calendar" class="calendar">
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
@include('components.js', ['js' => '/js/calendar.min.js'])
|
||||
@include('components.js', ['js' => '/js/events.min.js'])
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
@include('components.css', ['css' => '/css/calendar.min.css'])
|
||||
@endpush
|
||||
|
||||
100
resources/views/users/users/create.blade.php
Normal file
100
resources/views/users/users/create.blade.php
Normal file
@@ -0,0 +1,100 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('boilerplate::users.title'),
|
||||
'subtitle' => __('boilerplate::users.create.title'),
|
||||
'breadcrumb' => [
|
||||
__('boilerplate::users.title') => 'boilerplate.users.index',
|
||||
__('boilerplate::users.create.title')
|
||||
]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.icheck')
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => 'boilerplate.users.store', 'autocomplete' => 'off']) }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("boilerplate.users.index") }}" class="btn btn-default">
|
||||
{{ __('boilerplate::users.returntolist') }}
|
||||
</a>
|
||||
<span class="btn-group pull-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('boilerplate::users.save') }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('boilerplate::users.informations') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
|
||||
<div class="form-group {{ $errors->has('active') ? 'has-error' : '' }}">
|
||||
{{ Form::label('active', __('boilerplate::users.status')) }}
|
||||
{{ Form::select("active", ['0' => __('boilerplate::users.inactive'), '1' => __('boilerplate::users.active')], old('active', 1), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('active','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-8">
|
||||
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
{{ Form::label('email', __('boilerplate::users.email')) }}
|
||||
{{ Form::input('text', 'email', old('email'), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<small class="text-muted">
|
||||
{{ __('boilerplate::users.create.help') }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('last_name', __('boilerplate::users.firstname')) }}
|
||||
{{ Form::input('text', 'first_name', old('first_name'), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('first_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('last_name', __('boilerplate::users.lastname')) }}
|
||||
{{ Form::input('text', 'last_name', old('last_name'), ['class' => 'form-control', 'autofocus']) }}
|
||||
{!! $errors->first('last_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('boilerplate::users.roles') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-condensed table-hover">
|
||||
@foreach($roles as $role)
|
||||
<tr>
|
||||
<td style="width:25px">
|
||||
{{ Form::checkbox('roles['.$role->id.']', null, null, ['id' => 'role_'.$role->id, 'class' => 'icheck']) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::label('role_'.$role->id, $role->display_name, ['class' => 'mbn']) }}<br />
|
||||
<span class="small">{{ $role->description }}</span><br />
|
||||
<!--
|
||||
<span class="small text-muted">{{ $role->permissions->implode('display_name', ', ') }}</span>
|
||||
-->
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
@endsection
|
||||
97
resources/views/users/users/edit.blade.php
Normal file
97
resources/views/users/users/edit.blade.php
Normal file
@@ -0,0 +1,97 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('boilerplate::users.title'),
|
||||
'subtitle' => __('boilerplate::users.edit.title'),
|
||||
'breadcrumb' => [
|
||||
__('boilerplate::users.title') => 'boilerplate.users.index',
|
||||
__('boilerplate::users.edit.title')
|
||||
]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => ['boilerplate.users.update', $user->id], 'method' => 'put', 'autocomplete' => 'off']) }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("boilerplate.users.index") }}" class="btn btn-default">
|
||||
{{ __('boilerplate::users.returntolist') }}
|
||||
</a>
|
||||
<span class="btn-group pull-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('boilerplate::users.save') }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('boilerplate::users.informations') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if(Auth::user()->id !== $user->id)
|
||||
<div class="form-group {{ $errors->has('active') ? 'has-error' : '' }}">
|
||||
{{ Form::label('active', __('boilerplate::users.status')) }}
|
||||
{{ Form::select('active', ['0' => __('boilerplate::users.inactive'), '1' => __('boilerplate::users.active')], old('active', $user->active), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('active','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('last_name', __('boilerplate::users.lastname')) }}
|
||||
{{ Form::text('last_name', old('last_name', $user->last_name), ['class' => 'form-control', 'autofocus']) }}
|
||||
{!! $errors->first('last_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('first_name', __('boilerplate::users.firstname')) }}
|
||||
{{ Form::text('first_name', old('first_name', $user->first_name), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('first_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
{{ Form::label('email', __('boilerplate::users.email')) }}
|
||||
{{ Form::email('email', old('email', $user->email), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('boilerplate::users.roles') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-condensed table-hover">
|
||||
@foreach($roles as $role)
|
||||
@if($role->name !== 'admin' || ($role->name === 'admin' && Auth::user()->hasRole('admin')))
|
||||
<tr>
|
||||
<td style="width:25px">
|
||||
@if(Auth::user()->id === $user->id && $role->name === 'admin' && Auth::user()->hasRole('admin'))
|
||||
{{ Form::checkbox('roles['.$role->id.']', 1, old('roles['.$role->id.']', $user->hasRole($role->name)), ['id' => 'role_'.$role->id, 'class' => 'icheck', 'checked', 'disabled']) }}
|
||||
{!! Form::hidden('roles['.$role->id.']', '1', ['id' => 'role_'.$role->id]) !!}
|
||||
@else
|
||||
{{ Form::checkbox('roles['.$role->id.']', 1, old('roles['.$role->id.']', $user->hasRole($role->name)), ['id' => 'role_'.$role->id, 'class' => 'icheck']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::label('role_'.$role->id, $role->display_name, ['class' => 'mbn']) }}<br />
|
||||
<span class="small">{{ $role->description }}</span><br />
|
||||
<span class="small text-muted">{{ $role->permissions->implode('display_name', ', ') }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
@endsection
|
||||
|
||||
@include('boilerplate::load.icheck')
|
||||
88
resources/views/users/users/list.blade.php
Normal file
88
resources/views/users/users/list.blade.php
Normal file
@@ -0,0 +1,88 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('boilerplate::users.title'),
|
||||
'subtitle' => __('boilerplate::users.list.title'),
|
||||
'breadcrumb' => [
|
||||
__('boilerplate::users.title') => 'boilerplate.users.index'
|
||||
]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<span class="btn-group pull-right">
|
||||
<a href="{{ route("boilerplate.users.create") }}" class="btn btn-primary">
|
||||
{{ __('boilerplate::users.create.title') }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('boilerplate::users.list.title') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-striped table-hover va-middle" id="users-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('boilerplate::users.list.state') }}</th>
|
||||
<th>{{ __('boilerplate::users.list.lastname') }}</th>
|
||||
<th>{{ __('boilerplate::users.list.firstname') }}</th>
|
||||
<th>{{ __('boilerplate::users.list.email') }}</th>
|
||||
<th>{{ __('boilerplate::users.list.roles') }}</th>
|
||||
<th>{{ __('boilerplate::users.list.creationdate') }}</th>
|
||||
<th>{{ __('boilerplate::users.list.lastconnect') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('boilerplate::load.datatables')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function () {
|
||||
oTable = $('#users-table').DataTable({
|
||||
processing: false,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: '{!! route('boilerplate.users.datatable') !!}',
|
||||
type: 'post',
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}
|
||||
},
|
||||
columns: [
|
||||
{data: 'active', name: 'active', searchable: false},
|
||||
{data: 'last_name', name: 'last_name'},
|
||||
{data: 'first_name', name: 'first_name'},
|
||||
{data: 'email', name: 'email'},
|
||||
{data: 'roles', name: 'roles', searchable: false},
|
||||
{data: 'created_at', name: 'created_at', searchable: false},
|
||||
{data: 'last_login', name: 'last_login', searchable: false},
|
||||
{data: 'actions', name: 'actions', orderable: false, searchable: false, width : '86px'}
|
||||
]
|
||||
});
|
||||
|
||||
$('#users-table').on('click', '.destroy', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var href = $(this).attr('href');
|
||||
|
||||
bootbox.confirm("{{ __('boilerplate::users.list.confirmdelete') }}", function (result) {
|
||||
if (result === false) return;
|
||||
|
||||
$.ajax({
|
||||
url: href,
|
||||
method: 'delete',
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||
success: function(){
|
||||
oTable.ajax.reload();
|
||||
growl("{{ __('boilerplate::users.list.deletesuccess') }}", "success");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
132
resources/views/users/users/profile.blade.php
Normal file
132
resources/views/users/users/profile.blade.php
Normal file
@@ -0,0 +1,132 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('boilerplate::users.profile.title'),
|
||||
'subtitle' => $user->name,
|
||||
'breadcrumb' => [
|
||||
$user->name => 'boilerplate.user.profile',
|
||||
]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => ['boilerplate.user.profile'], 'method' => 'post', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<span class="btn-group pull-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('boilerplate::users.save') }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-5">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon" style="line-height: normal">
|
||||
<img src="{{ $user->avatar_url }}" class="avatar" alt="avatar"/>
|
||||
</span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">
|
||||
<p class="mbn"><strong class="h3">{{ $user->name }}</strong></p>
|
||||
<p class="">{{ $user->getRolesList() }}</p>
|
||||
</span>
|
||||
<span class="info-box-more">
|
||||
<p class="mbn text-muted">
|
||||
{{ __('boilerplate::users.profile.subscribedsince', [
|
||||
'date' => $user->created_at->isoFormat(__('boilerplate::date.lFdY')),
|
||||
'since' => $user->created_at->diffForHumans()]) }}
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
@if(is_file($user->avatar_path))
|
||||
<span class="pull-right">
|
||||
<button class="btn btn-xs btn-default" id="remove_avatar">
|
||||
{{ __('boilerplate::users.profile.delavatar') }}
|
||||
</button>
|
||||
</span>
|
||||
@endif
|
||||
<h3 class="box-title">{{ __('boilerplate::users.profile.avatar') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group {{ $errors->has('avatar') ? 'has-error' : '' }}">
|
||||
{!! Form::file('avatar', ['id' => 'avatar']) !!}
|
||||
{!! $errors->first('avatar','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-7">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('boilerplate::users.informations') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('first_name', __('boilerplate::users.firstname')) }}
|
||||
{{ Form::text('first_name', old('first_name', $user->first_name), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('first_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('last_name', __('boilerplate::users.lastname')) }}
|
||||
{{ Form::text('last_name', old('last_name', $user->last_name), ['class' => 'form-control', 'autofocus']) }}
|
||||
{!! $errors->first('last_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
|
||||
{{ Form::label('password', ucfirst(__('boilerplate::auth.fields.password'))) }}
|
||||
{{ Form::password('password', ['class' => 'form-control']) }}
|
||||
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
|
||||
{{ Form::label('password_confirmation', ucfirst(__('boilerplate::auth.fields.password_confirm'))) }}
|
||||
{{ Form::password('password_confirmation', ['class' => 'form-control']) }}
|
||||
{!! $errors->first('password_confirmation','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
@endsection
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$('#avatar').fileinput({
|
||||
showUpload: false,
|
||||
uploadAsync: false
|
||||
});
|
||||
|
||||
$('#remove_avatar').on('click', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
bootbox.confirm("{{ __('boilerplate::users.profile.confirmdelavatar') }}", function(e){
|
||||
if(e === false) return;
|
||||
|
||||
$.ajax({
|
||||
url: '{{ route('boilerplate.user.avatardelete') }}',
|
||||
type: 'post',
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||
cache: false,
|
||||
success: function(res) {
|
||||
$('.avatar').attr('src', "{{ asset('/assets/vendor/boilerplate/images/default-user.png') }}");
|
||||
growl("{{ __('boilerplate::users.profile.successdelavatar') }}", "success");
|
||||
$('#remove_avatar').remove();
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user