2019-04-07 01:25:30 +00:00
@ extends ( 'admin.partial.template-full' )
@ section ( 'header' )
< div class = " bg-primary " >
< div class = " container " >
< div class = " my-5 " ></ div >
</ div >
</ div >
@ endsection
2018-05-20 21:50:11 +00:00
@ section ( 'section' )
< div class = " title " >
< h3 class = " font-weight-bold " > Users </ h3 >
</ div >
2018-09-11 03:06:36 +00:00
< hr >
2018-06-05 03:33:19 +00:00
< div class = " table-responsive " >
< table class = " table " >
2018-09-03 01:23:59 +00:00
< thead class = " bg-light " >
< tr class = " text-center " >
2019-04-07 01:25:30 +00:00
< th scope = " col " class = " border-0 " width = " 10% " >
2018-09-03 01:23:59 +00:00
< span > ID </ span >
</ th >
2019-04-07 01:25:30 +00:00
< th scope = " col " class = " border-0 " width = " 30% " >
2018-09-03 01:23:59 +00:00
< span > Username </ span >
</ th >
2019-04-07 01:25:30 +00:00
< th scope = " col " class = " border-0 " width = " 15% " >
< span > Statuses </ span >
2018-09-03 01:23:59 +00:00
</ th >
2019-04-07 01:25:30 +00:00
< th scope = " col " class = " border-0 " width = " 15% " >
< span > Storage </ span >
2018-09-03 01:23:59 +00:00
</ th >
2019-04-07 01:25:30 +00:00
< th scope = " col " class = " border-0 " width = " 30% " >
2018-09-03 01:23:59 +00:00
< span > Actions </ span >
</ th >
2018-06-05 03:33:19 +00:00
</ tr >
</ thead >
2019-04-07 01:25:30 +00:00
< tbody >
2018-06-05 03:33:19 +00:00
@ foreach ( $users as $user )
2019-04-07 01:25:30 +00:00
< tr class = " font-weight-bold text-center user-row " >
2018-06-05 03:33:19 +00:00
< th scope = " row " >
2019-07-18 05:00:34 +00:00
< span class = " { { $user -> status == 'deleted' ? 'text-danger' : '' } } " > {{ $user -> id }} </ span >
2018-06-05 03:33:19 +00:00
</ th >
2019-04-07 01:25:30 +00:00
< td class = " text-left " >
2019-07-18 05:00:34 +00:00
< img src = " { { $user -> profile ? $user -> profile -> avatarUrl () : '/storage/avatars/default.png?v=1' } } " width = " 28px " class = " rounded-circle mr-2 " style = " border:1px solid #ccc " >
2018-09-03 01:23:59 +00:00
< span title = " { { $user -> username } } " data - toggle = " tooltip " data - placement = " bottom " >
2019-07-18 05:00:34 +00:00
< span class = " { { $user -> status == 'deleted' ? 'text-danger' : '' } } " > {{ $user -> username }} </ span >
2018-09-03 01:23:59 +00:00
@ if ( $user -> is_admin )
< i class = " text-danger fas fa-certificate " title = " Admin " ></ i >
@ endif
</ span >
</ td >
< td >
2019-07-18 05:00:34 +00:00
< span class = " { { $user -> status == 'deleted' ? 'text-danger' : '' } } " > {{ $user -> profile ? $user -> profile -> statusCount () : 0 }} </ span >
2018-09-03 01:23:59 +00:00
</ td >
< td >
2019-07-18 05:00:34 +00:00
< span class = " { { $user -> status == 'deleted' ? 'text-danger' : '' } } " >< p class = " human-size mb-0 " data - bytes = " { { App \ Media::whereUserId( $user->id )->sum('size')}} " ></ p ></ span >
2018-09-03 01:23:59 +00:00
</ td >
< td >
2019-04-07 01:25:30 +00:00
< span class = " action-row font-weight-lighter " >
< a href = " { { $user -> url () } } " class = " pr-2 text-muted small font-weight-bold " title = " View Profile " data - toggle = " tooltip " data - placement = " bottom " >
View
2018-09-03 01:23:59 +00:00
</ a >
2019-04-07 01:25:30 +00:00
< a href = " /i/admin/users/edit/ { { $user -> id } } " class = " pr-2 text-muted small font-weight-bold " title = " Edit Profile " data - toggle = " tooltip " data - placement = " bottom " >
Edit
2018-09-03 01:23:59 +00:00
</ a >
2019-04-07 01:25:30 +00:00
< a href = " # " class = " text-muted action-btn small font-weight-bold " title = " Delete Profile " data - toggle = " tooltip " data - placement = " bottom " data - id = " { { $user -> id } } " data - action = " delete " >
Delete
2018-09-03 01:23:59 +00:00
</ a >
</ span >
</ td >
2018-06-05 03:33:19 +00:00
</ tr >
@ endforeach
</ tbody >
</ table >
</ div >
2018-05-30 02:49:25 +00:00
< div class = " d-flex justify-content-center mt-5 small " >
2018-05-20 21:50:11 +00:00
{{ $users -> links ()}}
</ div >
@ endsection
2018-09-03 01:23:59 +00:00
@ push ( 'styles' )
< style type = " text/css " >
. jqstooltip {
- webkit - box - sizing : content - box ;
- moz - box - sizing : content - box ;
box - sizing : content - box ;
border : 0 ! important ;
border - radius : 2 px ;
max - width : 20 px ;
}
2019-04-07 01:25:30 +00:00
. user - row . action - row {
display : none ;
}
. user - row : hover {
background - color : #eff8ff;
}
. user - row : hover . action - row {
display : block ;
}
. user - row : hover . last - active {
display : none ;
}
2018-09-03 01:23:59 +00:00
</ style >
@ endpush
2018-05-20 21:50:11 +00:00
@ push ( 'scripts' )
< script type = " text/javascript " >
$ ( document ) . ready ( function () {
2018-09-03 01:23:59 +00:00
2018-05-20 21:50:11 +00:00
$ ( '.human-size' ) . each ( function ( d , a ) {
let el = $ ( a );
let size = el . data ( 'bytes' );
el . text ( filesize ( size , { round : 0 }));
});
2018-09-03 01:23:59 +00:00
$ ( document ) . on ( 'click' , '.action-btn' , function ( e ) {
e . preventDefault ();
let el = $ ( this );
let id = el . data ( 'id' );
let action = el . data ( 'action' );
switch ( action ) {
case 'view' :
window . location . href = el . data ( 'url' );
break ;
case 'edit' :
let redirect = '/i/admin/users/edit/' + id ;
window . location . href = redirect ;
break ;
case 'delete' :
swal ( 'Error' , 'Sorry this action is not yet available' , 'error' );
break ;
}
});
2018-05-20 21:50:11 +00:00
});
</ script >
2018-06-01 21:12:53 +00:00
@ endpush