Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
f4b39202
Commit
f4b39202
authored
Sep 24, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding rol create and edit view
parent
b01df84f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
37 deletions
+66
-37
RolesController.php
Http/Controllers/Admin/RolesController.php
+7
-3
create.blade.php
Resources/views/admin/roles/create.blade.php
+11
-34
edit.blade.php
Resources/views/admin/roles/edit.blade.php
+48
-0
No files found.
Http/Controllers/Admin/RolesController.php
View file @
f4b39202
...
...
@@ -13,6 +13,7 @@ class RolesController extends AdminBaseController
parent
::
__construct
();
$this
->
roles
=
Sentinel
::
getRoleRepository
()
->
createModel
();
}
/**
* Display a listing of the resource.
*
...
...
@@ -32,7 +33,7 @@ class RolesController extends AdminBaseController
*/
public
function
create
()
{
return
\
View
::
make
(
'user::admin.roles.create'
);
return
View
::
make
(
'user::admin.roles.create'
);
}
/**
...
...
@@ -53,7 +54,6 @@ class RolesController extends AdminBaseController
*/
public
function
show
(
$id
)
{
return
\View
::
make
(
'user::admin.roles.show'
);
}
/**
...
...
@@ -64,7 +64,11 @@ class RolesController extends AdminBaseController
*/
public
function
edit
(
$id
)
{
return
\View
::
make
(
'user::admin.roles.edit'
);
if
(
!
$role
=
$this
->
roles
->
find
(
$id
))
{
return
Redirect
::
to
(
'user::admin.roles.index'
);
}
return
View
::
make
(
'user::admin.roles.edit'
,
compact
(
'role'
));
}
/**
...
...
Resources/views/admin/roles/create.blade.php
View file @
f4b39202
...
...
@@ -6,7 +6,7 @@
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"{{ URL::route('dashboard.index') }}"
><i
class=
"fa fa-dashboard"
></i>
Home
</a></li>
<li
class=
""
><a
href=
"{{ URL::route('dashboard.
user.index') }}"
>
User
s
</a></li>
<li
class=
""
><a
href=
"{{ URL::route('dashboard.
role.index') }}"
>
Role
s
</a></li>
<li
class=
"active"
>
New
</li>
</ol>
@stop
...
...
@@ -15,54 +15,31 @@
<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']) !!}
{!! Form::open(['route' => 'dashboard.
role
.store', 'method' => 'post']) !!}
<div
class=
"box-body"
>
<div
class=
"row"
>
@include('flash::message')
</div>
<div
class=
"row"
>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('first_name') ? ' has-error' : '' }}"
>
{!! Form::label('first_name', 'First name:') !!}
{!! Form::text('first_name', Input::old('first_name'), ['class' => 'form-control', 'placeholder' => 'First name']) !!}
{!! $errors->first('first_name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('last_name') ? ' has-error' : '' }}"
>
{!! Form::label('last_name', 'Last name:') !!}
{!! Form::text('last_name', Input::old('last_name'), ['class' => 'form-control', 'placeholder' => 'Last name']) !!}
{!! $errors->first('last_name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('email') ? ' has-error' : '' }}"
>
{!! Form::label('email', 'Email:') !!}
{!! Form::email('email', Input::old('email'), ['class' => 'form-control', 'placeholder' => 'Email address']) !!}
{!! $errors->first('email', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group{{ $errors->has('
password
') ? ' has-error' : '' }}"
>
{!! Form::label('
password', 'Password
:') !!}
{!! Form::
password('password', ['class' => 'form-control
']) !!}
{!! $errors->first('
password
', '
<span
class=
"help-block"
>
:message
</span>
') !!}
<div
class=
"form-group{{ $errors->has('
name
') ? ' has-error' : '' }}"
>
{!! Form::label('
name', 'Role name
:') !!}
{!! Form::
text('name', Input::old('name'), ['class' => 'form-control', 'placeholder' => 'First name
']) !!}
{!! $errors->first('
name
', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group{{ $errors->has('
password_confirmation
') ? ' has-error' : '' }}"
>
{!! Form::label('
password_confirmation', 'Password confirmation
:') !!}
{!! Form::
password('password_confirmation', ['class' => 'form-control
']) !!}
{!! $errors->first('
password_confirmation
', '
<span
class=
"help-block"
>
:message
</span>
') !!}
<div
class=
"form-group{{ $errors->has('
slug
') ? ' has-error' : '' }}"
>
{!! Form::label('
slug', 'Role slug
:') !!}
{!! Form::
text('slug', Input::old('slug'), ['class' => 'form-control', 'placeholder' => 'Last name
']) !!}
{!! $errors->first('
slug
', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
</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>
<a
class=
"btn btn-danger pull-right btn-flat"
href=
"{{ URL::route('dashboard.
role
.index')}}"
><i
class=
"fa fa-times"
></i>
Cancel
</a>
</div>
{!! Form::close() !!}
</div>
...
...
Resources/views/admin/roles/edit.blade.php
0 → 100644
View file @
f4b39202
@
extends
(
'core::layouts.master'
)
@
section
(
'content-header'
)
<
h1
>
Updating
Role
<
small
>
{{
$role
->
name
}}
</
small
>
</
h1
>
<
ol
class
="
breadcrumb
">
<li><a href="
{{
URL
::
route
(
'dashboard.index'
)
}}
"><i class="
fa
fa
-
dashboard
"></i> Home</a></li>
<li class=""><a href="
{{
URL
::
route
(
'dashboard.role.index'
)
}}
">Roles</a></li>
<li class="
active
">Update</li>
</ol>
@stop
@section('content')
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
box
box
-<?
php
echo
$errors
->
first
()
?
'danger'
:
'info'
;
?>
">
{!! Form::open(['route' => ['dashboard.role.update', $role->id], 'method' => 'put']) !!}
<div
class=
"box-body"
>
<div
class=
"row"
>
@include('flash::message')
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group{{ $errors->has('name') ? ' has-error' : '' }}"
>
{!! Form::label('name', 'Role name:') !!}
{!! Form::text('name', Input::old('name', $role->name), ['class' => 'form-control', 'placeholder' => 'First name']) !!}
{!! $errors->first('name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group{{ $errors->has('slug') ? ' has-error' : '' }}"
>
{!! Form::label('slug', 'Role slug:') !!}
{!! Form::text('slug', Input::old('slug', $role->slug), ['class' => 'form-control', 'placeholder' => 'Last name']) !!}
{!! $errors->first('slug', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
</div>
</div>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary btn-flat"
>
Update
</button>
<a
class=
"btn btn-danger pull-right btn-flat"
href=
"{{ URL::route('dashboard.role.index')}}"
><i
class=
"fa fa-times"
></i>
Cancel
</a>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@stop
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment