2021-04-16 01:00:00 +02:00
@ extends ( 'layouts.sidebar' )
@ section ( 'content' )
2023-03-08 17:20:39 +01:00
@ if ( session () -> has ( 'success' ))
< div class = " alert alert-success " >
{{ session () -> get ( 'success' ) }}
</ div >
@ endif
@ if ( session () -> has ( 'error' ))
< div class = " alert alert-danger " >
{{ session () -> get ( 'error' ) }}
</ div >
@ endif
2022-11-08 16:11:59 +01:00
@ if ( $_SERVER [ 'QUERY_STRING' ] === '' )
< section class = " shadow text-gray-400 " >
< h3 class = " mb-4 card-header " >< i class = " bi bi-person " > Account Settings </ i ></ h3 >
< div class = " card-body p-0 p-md-3 " >
2021-04-16 01:00:00 +02:00
2022-03-31 21:31:00 +02:00
@ foreach ( $profile as $profile )
2022-05-02 21:49:10 +02:00
@ if ( env ( 'REGISTER_AUTH' ) != 'verified' or auth () -> user () -> role == 'admin' )
2022-11-08 16:11:59 +01:00
< form action = " { { route('editProfile') }} " method = " post " >
2022-03-31 21:31:00 +02:00
@ csrf
2021-04-16 01:00:00 +02:00
< div class = " form-group col-lg-8 " >
2022-11-08 16:11:59 +01:00
< h4 > Email </ h4 >
2022-07-07 12:31:06 +02:00
< input type = " email " class = " form-control " name = " email " value = " { { $profile->email }} " required >
2021-04-16 01:00:00 +02:00
</ div >
2022-03-31 21:31:00 +02:00
< button type = " Change " class = " mt-3 ml-3 btn btn-info " > Change email </ button >
</ form >
2022-03-31 21:33:58 +02:00
@ endif
2022-03-31 21:31:00 +02:00
2023-03-08 21:00:20 +01:00
< br >< br >< form action = " { { route('editProfile') }} " method = " post " >
@ csrf
< div class = " form-group col-lg-8 " >
< h4 > Password </ h4 >
< input type = " password " name = " password " class = " form-control " placeholder = " At least 8 characters " required >
</ div >
< button type = " Change " class = " mt-3 ml-3 btn btn-info " > Change password </ button >
</ form >
@ csrf
< br >< br >< div class = " form-group col-lg-8 " >
< h4 > Role </ h4 >
< input type = " text " class = " form-control " value = " { { strtoupper( $profile->role ) }} " readonly >
</ div >
2023-03-08 17:46:40 +01:00
@ if ( env ( 'ALLOW_USER_EXPORT' ) != false )
2023-03-08 17:20:39 +01:00
< br >< br >< br >
< div class = " form-group col-lg-8 " >
< h4 > Export user data </ h4 >
< label > Export your user data to transfer to a different instance .</ label >
< div class = " row " >
< button class = " mt-3 ml-3 btn btn-outline-secondary " >< a href = " { { route('exportAll') }} " style = " color:#fff; " >< i class = " bi bi-layer-backward " ></ i > Export all data </ a ></ button >
< button class = " mt-3 ml-3 btn btn-outline-secondary " >< a href = " { { route('exportLinks') }} " style = " color:#fff; " >< i class = " bi bi-layer-backward " ></ i > Export links only </ a ></ button >
</ div ></ div >
2023-03-08 17:46:40 +01:00
@ endif
2023-03-08 17:20:39 +01:00
2023-03-08 17:46:40 +01:00
@ if ( env ( 'ALLOW_USER_IMPORT' ) != false )
2023-03-08 17:20:39 +01:00
< form action = " { { route('importData') }} " enctype = " multipart/form-data " method = " post " >
@ csrf
< div class = " form-group col-lg-8 " >< br >< br >< br >
< h4 > Import user data </ h4 >
< label > Import your user data from another instance .</ label >
< input type = " file " accept = " application/JSON " class = " form-control-file " name = " import " >
</ div >
< button type = " submit " class = " mt-3 ml-3 btn btn-info " onclick = " return confirm('Are you sure you want to import this file? This action will replace all your current data, including links!') " > Import </ button >
</ form >
2023-03-08 17:46:40 +01:00
@ endif
2023-03-08 17:20:39 +01:00
< br >
< br >< button class = " mt-3 ml-3 btn btn-primary "
style = " margin-bottom:2rem;margin-top:2rem!important;background-color:tomato!important;border-color:tomato!important; " >< a
href = " { { url('/studio/profile/?delete') }} " style = " color:#FFFFFF; " >< i class = " bi bi-exclamation-octagon-fill " ></ i >
Delete your account </ a ></ button >
2022-11-08 16:11:59 +01:00
</ div >
</ section >
2021-04-16 01:00:00 +02:00
@ endforeach
2022-11-08 16:11:59 +01:00
@ endif
@ if ( $_SERVER [ 'QUERY_STRING' ] === 'delete' )
< center style = " margin-top: 14%; " >
< h2 style = " text-decoration: underline; " > You are about to delete your account !</ h2 >
< p > You are about to delete your account ! This action cannot be undone .</ p >
< div >
< button class = " redButton mt-3 ml-3 btn btn-primary " style = " width:10rem; background-color:tomato!important;border-color:tomato!important; filter: grayscale(100%); " disabled onclick = " window.location.href = ' { { url('/studio/delete-user/') . " / " . Auth::id() }}'; " >< i class = " bi bi-exclamation-diamond-fill " ></ i ></ button >
< button type = " submit " class = " mt-3 ml-3 btn btn-info " >< a style = " color:#fff; " href = " { { url('/studio/profile') }} " > Cancel </ a ></ button >
</ div >
< script >
var seconds = 10 ;
var interval = setInterval ( function () {
document . querySelector ( " .redButton " ) . innerHTML = -- seconds ;
if ( seconds <= 0 )
clearInterval ( interval );
}, 1000 );
setTimeout ( function (){
document . querySelector ( " .redButton " ) . disabled = false ;
document . querySelector ( " .redButton " ) . innerHTML = 'Delete account' ;
document . querySelector ( " .redButton " ) . style . filter = " none " ;
}, 10000 );
</ script >
</ center >
@ endif
2021-04-16 01:00:00 +02:00
@ endsection