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
fa719211
Commit
fa719211
authored
Sep 26, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re orginising the edit role view
parent
2a7bbfa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
54 deletions
+70
-54
edit.blade.php
Resources/views/admin/roles/edit.blade.php
+70
-54
No files found.
Resources/views/admin/roles/edit.blade.php
View file @
fa719211
...
...
@@ -12,70 +12,87 @@
@stop
@section('styles')
<link href="
{{{
core_asset
(
'css/vendor/iCheck/flat/
red
.css'
)
}}}
" rel="
stylesheet
" type="
text
/
css
" />
<link href="
{{{
core_asset
(
'css/vendor/iCheck/flat/
blue
.css'
)
}}}
" rel="
stylesheet
" type="
text
/
css
" />
@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>
') !!}
{!! Form::open(['route' => ['dashboard.role.update',
$role->id
], 'method' => 'put']) !!}
<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"
>
Permissions
</
a
></
li
>
<
li
class
=""><
a
href
=
"#tab_3-3"
data
-
toggle
=
"tab"
>
Users
</
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')
</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 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>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<h3>
Users with this role
</h3>
<ul>
<?php
foreach
(
$role
->
users
()
->
get
()
as
$user
)
:
?>
<li>
<a
href=
"{{ URL::route('dashboard.user.edit', [$user->id]) }}"
>
{{ $user->present()->fullname() }}
</a>
</li>
<?php
endforeach
;
?>
</ul>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<?php
foreach
(
$permissions
as
$name
=>
$value
)
:
?>
<h3>
{{ $name }} Module
</h3>
<?php
foreach
(
$value
as
$subRoleTitle
=>
$roleName
)
:
?>
<h4>
{{ $subRoleTitle }}
</h4>
<?php
foreach
(
$roleName
as
$rolePerm
)
:
?>
<div
class=
"checkbox"
>
<label
for=
"
<?php
echo
"
$subRoleTitle
.
$rolePerm
"
?>
"
>
<input
id=
"
<?php
echo
"
$subRoleTitle
.
$rolePerm
"
?>
"
name=
"permissions[
<?php
echo
"
$subRoleTitle
.
$rolePerm
"
?>
]"
type=
"checkbox"
class=
"flat-red"
<?php
echo
$role
->
hasAccess
(
"
$subRoleTitle
.
$rolePerm
"
)
?
'checked'
:
''
?>
value=
"true"
/>
{{ $rolePerm }}
</label>
</div>
</div><!-- /.tab-pane -->
<div class="
tab
-
pane
" id="
tab_2
-
2
">
<div class="
box
-
body
">
<div class="
row
">
<div class="
col
-
md
-
12
">
<?php foreach(
$permissions
as
$name
=>
$value
): ?>
<h3>{{
$name
}} Module</h3>
<?php foreach(
$value
as
$subPermissionTitle
=>
$permissionName
): ?>
<h4>{{ ucfirst(
$subPermissionTitle
) }}</h4>
<?php foreach(
$permissionName
as
$permissionAction
): ?>
<div class="
checkbox
">
<label for="
<?
php
echo
"
$subPermissionTitle
.
$permissionAction
"
?>
">
<input
id=
"
<?php
echo
"
$subPermissionTitle
.
$permissionAction
"
?>
"
name=
"permissions[
<?php
echo
"
$subPermissionTitle
.
$permissionAction
"
?>
]"
type=
"checkbox"
class=
"flat-blue"
<?php
echo
$role
->
hasAccess
(
"
$subPermissionTitle
.
$permissionAction
"
)
?
'checked'
:
''
?>
value=
"true"
/>
{{ ucfirst($permissionAction) }}
</label>
</div>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
</div>
</div>
</div>
</div>
<!-- /.tab-pane -->
<div
class=
"tab-pane"
id=
"tab_3-3"
>
<div
class=
"box-body"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<h3>
Users with this role
</h3>
<ul>
<?php
foreach
(
$role
->
users
()
->
get
()
as
$user
)
:
?>
<li>
<a
href=
"{{ URL::route('dashboard.user.edit', [$user->id]) }}"
>
{{ $user->present()->fullname() }}
</a>
</li>
<?php
endforeach
;
?>
</ul>
</div>
</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
class=
"clearfix"
>
</div>
</div>
<!-- /.tab-content -->
</div>
{!! Form::close() !!}
</div>
</div>
@stop
...
...
@@ -83,10 +100,9 @@
@section('scripts')
<script>
$
(
document
).
ready
(
function
()
{
//Flat red color scheme for iCheck
$
(
'
input[type="checkbox"].flat-red, input[type="radio"].flat-red
'
).
iCheck
({
checkboxClass
:
'
icheckbox_flat-red
'
,
radioClass
:
'
iradio_flat-red
'
$
(
'
input[type="checkbox"].flat-blue, input[type="radio"].flat-blue
'
).
iCheck
({
checkboxClass
:
'
icheckbox_flat-blue
'
,
radioClass
:
'
iradio_flat-blue
'
});
});
</script>
...
...
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