Commit a2e45c80 authored by Nicolas Widart's avatar Nicolas Widart

Adding permissions to the user create view

parent 32d1da3b
......@@ -69,7 +69,8 @@ class UserController extends AdminBaseController
*/
public function store(CreateUserRequest $request)
{
$user = $this->users->create($request->all());
$data = array_merge($request->all(), ['permissions' => $this->permissions->clean($request->permissions)]);
$user = $this->users->create($data);
$user->roles()->attach($request->roles);
$code = Activation::create($user);
......
......@@ -11,11 +11,22 @@
</ol>
@stop
@section('styles')
<link href="{{{ core_asset('css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
{!! Form::open(['route' => 'dashboard.user.store', 'method' => 'post']) !!}
<div class="row">
<div class="col-md-12">
<div class="box box-<?php echo $errors->first() ? 'danger' : 'info'; ?>">
{!! Form::open(['route' => 'dashboard.user.store', 'method' => 'post']) !!}
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1-1" data-toggle="tab">Data</a></li>
<li class=""><a href="#tab_2-2" data-toggle="tab">Roles</a></li>
<li class=""><a href="#tab_3-3" data-toggle="tab">Permissions</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1-1">
<div class="box-body">
<div class="row">
@include('flash::message')
......@@ -59,6 +70,10 @@
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab_2-2">
<div class="box-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
......@@ -72,12 +87,31 @@
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab_3-3">
<div class="box-body">
@include('user::admin.users.partials.permissions-create')
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">Create</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('dashboard.user.index')}}"><i class="fa fa-times"></i> Cancel</a>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@section('scripts')
<script>
$( document ).ready(function() {
$('input[type="checkbox"].flat-blue, input[type="radio"].flat-blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
});
</script>
@stop
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment