11 changed files with 103 additions and 230 deletions
-
4app/Entities/Users/UsersRepository.php
-
2app/Http/Controllers/Users/UsersController.php
-
50resources/lang/id/user.php
-
1resources/views/layouts/partials/sidebar.blade.php
-
3resources/views/pages/partials/dashboard-nav-tabs.blade.php
-
7resources/views/users/create.blade.php
-
44resources/views/users/delete.blade.php
-
19resources/views/users/edit.blade.php
-
81resources/views/users/index.blade.php
-
109resources/views/users/roles.blade.php
-
13resources/views/users/show.blade.php
@ -1,33 +1,29 @@ |
|||
@extends('layouts.app') |
|||
@extends('layouts.dashboard') |
|||
|
|||
@section('title', trans('user.delete')) |
|||
|
|||
@section('content') |
|||
<h1 class="page-header"> |
|||
<div class="pull-right"> |
|||
{!! FormField::delete(['route'=>['users.destroy',$user->id]], trans('app.delete_confirm_button'), ['class'=>'btn btn-danger'], ['user_id'=>$user->id]) !!} |
|||
</div> |
|||
{{ trans('app.delete_confirm') }} |
|||
{!! link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default']) !!} |
|||
</h1> |
|||
@section('content-dashboard') |
|||
<div class="row"> |
|||
<div class="col-md-4"> |
|||
<div class="panel panel-info"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('user.user') }} Detail</h3></div> |
|||
<div class="col-md-4 col-lg-offset-3"> |
|||
<div class="panel panel-danger"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('user.delete') }}</h3></div> |
|||
<table class="table table-condensed"> |
|||
<tbody> |
|||
<tr><th>{{ trans('app.name') }}</th><td>{{ $user->name }}</td></tr> |
|||
<tr><th>{{ trans('user.email') }}</th><td>{{ $user->email }}</td></tr> |
|||
<tr><th>{{ trans('user.registered_at') }}</th><td>{{ $user->created_at }}</td></tr> |
|||
</tbody> |
|||
</table> |
|||
<div class="panel-body"> |
|||
<table class="table table-condensed"> |
|||
<tbody> |
|||
<tr><th>{{ trans('app.name') }}</th><td>{{ $user->name }}</td></tr> |
|||
<tr><th>{{ trans('user.email') }}</th><td>{{ $user->email }}</td></tr> |
|||
<tr> |
|||
<th>{{ trans('user.role') }}</th> |
|||
<td>{{ $user->present()->displayRoles }}</td> |
|||
</tr> |
|||
<tr><th>{{ trans('user.registered_at') }}</th><td>{{ $user->created_at }}</td></tr> |
|||
</tbody> |
|||
</table> |
|||
{{ trans('app.delete_confirm') }} |
|||
</div> |
|||
<div class="panel-footer"> |
|||
{!! link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default']) !!} |
|||
<div class="pull-right"> |
|||
{!! FormField::delete(['route'=>['users.destroy',$user->id]], trans('app.delete_confirm_button'), ['class'=>'btn btn-danger'], ['user_id'=>$user->id]) !!} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@endsection |
|||
@endsection |
|||
@ -1,48 +1,41 @@ |
|||
@extends('layouts.app') |
|||
@extends('layouts.dashboard') |
|||
|
|||
@section('title', trans('user.users')) |
|||
@section('title', trans('user.list')) |
|||
|
|||
@section('content') |
|||
<h1 class="page-header"> |
|||
{!! link_to_route('users.create', trans('user.create'), [], ['class'=>'btn btn-success pull-right']) !!} |
|||
{{ trans('user.users') }} <small>{{ $users->total() }} {{ trans('user.found') }}</small> |
|||
</h1> |
|||
<div class="well well-sm"> |
|||
{!! Form::open(['method'=>'get','class'=>'form-inline']) !!} |
|||
@if (Request::has('role')) |
|||
{!! Form::hidden('role', Request::get('role')) !!} |
|||
@endif |
|||
{!! Form::text('q', Request::get('q'), ['class'=>'form-control','placeholder'=>trans('user.search'),'style' => 'width:350px']) !!} |
|||
{!! Form::submit('Cari Member', ['class' => 'btn btn-info btn-sm']) !!} |
|||
{!! link_to_route('users.index','Reset',['role' => Request::get('role')],['class' => 'btn btn-default btn-sm']) !!} |
|||
{!! Form::close() !!} |
|||
</div> |
|||
@section('content-dashboard') |
|||
|
|||
<table class="table table-condensed"> |
|||
<thead> |
|||
<th>{{ trans('app.table_no') }}</th> |
|||
<th>{{ trans('app.name') }}</th> |
|||
<th>{{ trans('user.email') }}</th> |
|||
<th>{{ trans('user.roles') }}</th> |
|||
<th>{{ trans('app.action') }}</th> |
|||
</thead> |
|||
<tbody> |
|||
@forelse($users as $key => $user) |
|||
<tr> |
|||
<td>{{ $users->firstItem() + $key }}</td> |
|||
<td>{{ $user->name }}</td> |
|||
<td>{{ $user->email }}</td> |
|||
<td>{!! $user->present()->roleslink !!}</td> |
|||
<td> |
|||
{!! link_to_route('users.show',trans('user.show'),[$user->id],['class'=>'btn btn-info btn-xs']) !!} |
|||
</td> |
|||
</tr> |
|||
@empty |
|||
<tr> |
|||
<td colspan="5">{{ trans('user.not_found') }}</td> |
|||
</tr> |
|||
@endforelse |
|||
</tbody> |
|||
</table> |
|||
{!! str_replace('/?', '?', $users->appends(Request::except('page'))->render()) !!} |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading"> |
|||
{!! html_link_to_route('users.create', trans('user.create'), [], [ |
|||
'class'=>'btn btn-success btn-xs pull-right', |
|||
'style' => 'margin:-2px 0', |
|||
'icon' => 'plus' |
|||
]) !!} |
|||
<h3 class="panel-title">@lang('user.list')</h3> |
|||
</div> |
|||
<table class="table table-condensed"> |
|||
<thead> |
|||
<th>{{ trans('app.table_no') }}</th> |
|||
<th>{{ trans('app.name') }}</th> |
|||
<th>{{ trans('user.email') }}</th> |
|||
<th>{{ trans('app.action') }}</th> |
|||
</thead> |
|||
<tbody> |
|||
@forelse($users as $key => $user) |
|||
<tr> |
|||
<td>{{ 1 + $key }}</td> |
|||
<td>{{ $user->name }}</td> |
|||
<td>{{ $user->email }}</td> |
|||
<td> |
|||
{!! link_to_route('users.show',trans('user.show'),[$user->id],['class'=>'btn btn-info btn-xs']) !!} |
|||
</td> |
|||
</tr> |
|||
@empty |
|||
<tr> |
|||
<td colspan="5">{{ trans('user.not_found') }}</td> |
|||
</tr> |
|||
@endforelse |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
@endsection |
|||
@ -1,109 +0,0 @@ |
|||
@extends('layouts.app') |
|||
|
|||
@section('title', trans('user.roles')) |
|||
|
|||
@section('content') |
|||
<h1 class="page-header"> |
|||
@if (Request::get('act') != 'add') |
|||
{!! link_to_route('roles.index', trans('role.create'), ['act' => 'add'], ['class'=>'btn btn-success pull-right']) !!} |
|||
@endif |
|||
{{ trans('role.roles') }} |
|||
</h1> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-4 col-md-push-8"> |
|||
@if (Request::get('act') == 'add') |
|||
<div class="panel panel-success"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('role.create') }}</h3></div> |
|||
<div class="panel-body"> |
|||
{!! Form::open(['route'=>'roles.store']) !!} |
|||
{!! FormField::text('name') !!} |
|||
{!! FormField::text('label') !!} |
|||
{!! Form::submit(trans('role.create'), ['class' => 'btn btn-success']) !!} |
|||
{!! link_to_route('roles.index', trans('app.cancel'), [], ['class'=>'btn btn-default pull-right']) !!} |
|||
{!! Form::close() !!} |
|||
</div> |
|||
</div> |
|||
@elseif (Request::get('act') == 'edit' && !is_null($role)) |
|||
<div class="panel panel-warning"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('role.edit') }}</h3></div> |
|||
<div class="panel-body"> |
|||
{!! Form::model($role, ['route'=>['roles.update', $role->id],'method'=>'patch']) !!} |
|||
{!! FormField::text('name') !!} |
|||
{!! FormField::text('label') !!} |
|||
{!! Form::submit(trans('role.update'), ['class' => 'btn btn-warning']) !!} |
|||
{!! link_to_route('roles.index', trans('app.cancel'), [], ['class'=>'btn btn-default pull-right']) !!} |
|||
{!! Form::close() !!} |
|||
</div> |
|||
</div> |
|||
@elseif (Request::get('act') == 'del' && !is_null($role)) |
|||
<div class="panel panel-danger"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('role.delete') }}</h3></div> |
|||
<div class="panel-body"> |
|||
{{ trans('app.delete_confirm') }} |
|||
</div> |
|||
<table class="table table-condensed"> |
|||
<tbody> |
|||
<tr><th>{{ trans('app.name') }}</th><td>{{ $role->name }}</td></tr> |
|||
<tr><th>{{ trans('app.label') }}</th><td>{{ $role->label }}</td></tr> |
|||
<tr><th>{{ trans('role.users_count') }}</th><td>{{ $role->users()->count() }}</td></tr> |
|||
</tbody> |
|||
</table> |
|||
<div class="panel-footer"> |
|||
{!! link_to_route('roles.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) !!} |
|||
@if ($role->users()->count() < 1) |
|||
{!! FormField::delete(['route'=>['roles.destroy',$role->id]], trans('app.delete_confirm_button'), ['class'=>'btn btn-danger pull-right'], ['role_id'=>$role->id]) !!} |
|||
@endif |
|||
</div> |
|||
</div> |
|||
@elseif (Request::get('act') == 'show' && !is_null($role)) |
|||
<div class="panel panel-info"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('role.show') }}</h3></div> |
|||
<table class="table table-condensed"> |
|||
<tbody> |
|||
<tr><th>{{ trans('app.name') }}</th><td>{{ $role->name }}</td></tr> |
|||
<tr><th>{{ trans('app.label') }}</th><td>{{ $role->label }}</td></tr> |
|||
<tr><th>{{ trans('role.users_count') }}</th><td>{{ $role->users()->count() }}</td></tr> |
|||
</tbody> |
|||
</table> |
|||
<div class="panel-footer"> |
|||
{!! link_to_route('roles.index', trans('app.edit'), ['act'=>'edit','id'=>$role->id], ['class' => 'btn btn-warning']) !!} |
|||
{!! link_to_route('roles.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) !!} |
|||
</div> |
|||
</div> |
|||
@endif |
|||
</div> |
|||
<div class="col-md-8 col-md-pull-4"> |
|||
<div class="panel panel-default"> |
|||
<table class="table table-condensed"> |
|||
<thead> |
|||
<th>{{ trans('app.table_no') }}</th> |
|||
<th>{{ trans('app.name') }}</th> |
|||
<th>{{ trans('app.label') }}</th> |
|||
<th class="text-center">{{ trans('role.users_count') }}</th> |
|||
<th>{{ trans('app.action') }}</th> |
|||
</thead> |
|||
<tbody> |
|||
@forelse($roles as $key => $role) |
|||
<tr> |
|||
<td>{{ $key + 1 }}</td> |
|||
<td>{{ $role->name }}</td> |
|||
<td>{{ $role->label }}</td> |
|||
<td class="text-center">{{ $role->users()->count() }}</td> |
|||
<td> |
|||
{!! link_to_route('roles.index','detail',['act' => 'show', 'id' => $role->id],['class'=>'btn btn-info btn-xs']) !!} |
|||
{!! link_to_route('roles.index','edit',['act' => 'edit', 'id' => $role->id],['class'=>'btn btn-warning btn-xs']) !!} |
|||
{!! link_to_route('roles.index','x',['act' => 'del', 'id' => $role->id],['class'=>'btn btn-danger btn-xs']) !!} |
|||
</td> |
|||
</tr> |
|||
@empty |
|||
<tr> |
|||
<td colspan="5">{{ trans('role.not_found') }}</td> |
|||
</tr> |
|||
@endforelse |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@endsection |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue