2021-06-05 09:26:32 +00:00
@ extends ( 'layouts.main' )
@ section ( 'content' )
<!-- CONTENT HEADER -->
< section class = " content-header " >
< div class = " container-fluid " >
< div class = " row mb-2 " >
< div class = " col-sm-6 " >
2022-01-14 12:34:37 +00:00
< h1 > {{ __ ( 'Profile' ) }} </ h1 >
2021-06-05 09:26:32 +00:00
</ div >
< div class = " col-sm-6 " >
< ol class = " breadcrumb float-sm-right " >
2022-01-14 12:34:37 +00:00
< li class = " breadcrumb-item " >< a href = " { { route('home') }} " > {{ __ ( 'Dashboard' ) }} </ a ></ li >
< li class = " breadcrumb-item " >< a class = " text-muted "
2022-06-02 14:11:24 +00:00
href = " { { route('profile.index') }} " > {{ __ ( 'Profile' ) }} </ a >
2021-06-05 09:26:32 +00:00
</ li >
</ ol >
</ div >
</ div >
</ div >
</ section >
<!-- END CONTENT HEADER -->
<!-- MAIN CONTENT -->
< section class = " content " >
< div class = " container-fluid " >
< div class = " row " >
2021-07-11 09:03:35 +00:00
< div class = " col-lg-12 px-0 " >
2022-01-14 12:34:37 +00:00
@ if ( ! Auth :: user () -> hasVerifiedEmail () && strtolower ( $force_email_verification ) == 'true' )
2021-07-11 09:03:35 +00:00
< div class = " alert alert-warning p-2 m-2 " >
2022-01-14 12:34:37 +00:00
< h5 >< i class = " icon fas fa-exclamation-circle " ></ i > {{ __ ( 'Required Email verification!' ) }}
</ h5 >
{{ __ ( 'You have not yet verified your email address' ) }}
< a class = " text-primary "
2022-06-02 14:11:24 +00:00
href = " { { route('verification.send') }} " > {{ __ ( 'Click here to resend verification email' ) }} </ a >
2022-01-14 12:34:37 +00:00
< br >
{{ __ ( 'Please contact support If you didnt receive your verification email.' ) }}
2022-01-23 14:00:23 +00:00
2021-07-11 09:03:35 +00:00
</ div >
@ endif
2022-01-14 12:34:37 +00:00
@ if ( is_null ( Auth :: user () -> discordUser ) && strtolower ( $force_discord_verification ) == 'true' )
2023-04-25 07:22:30 +00:00
@ if ( ! empty ( config ( 'SETTINGS::DISCORD:CLIENT_ID' )) && ! empty ( config ( 'SETTINGS::DISCORD:CLIENT_SECRET' )))
2021-07-11 09:03:35 +00:00
< div class = " alert alert-warning p-2 m-2 " >
2022-06-02 14:11:24 +00:00
< h5 >
< i class = " icon fas fa-exclamation-circle " ></ i > {{ __ ( 'Required Discord verification!' ) }}
2022-01-14 12:34:37 +00:00
</ h5 >
{{ __ ( 'You have not yet verified your discord account' ) }}
< a class = " text-primary "
2022-06-02 14:11:24 +00:00
href = " { { route('auth.redirect') }} " > {{ __ ( 'Login with discord' ) }} </ a > < br >
2022-01-14 12:34:37 +00:00
{{ __ ( 'Please contact support If you face any issues.' ) }}
2021-07-11 09:03:35 +00:00
</ div >
@ else
< div class = " alert alert-danger p-2 m-2 " >
2022-06-02 14:11:24 +00:00
< h5 >
< i class = " icon fas fa-exclamation-circle " ></ i > {{ __ ( 'Required Discord verification!' ) }}
2022-01-14 12:34:37 +00:00
</ h5 >
{{ __ ( 'Due to system settings you are required to verify your discord account!' ) }} < br >
{{ __ ( 'It looks like this hasnt been set-up correctly! Please contact support.' ) }} '
2021-07-11 09:03:35 +00:00
</ div >
@ endif
@ endif
2021-06-05 09:26:32 +00:00
</ div >
</ div >
2022-01-14 12:34:37 +00:00
< form class = " form " action = " { { route('profile.update', Auth::user()->id) }} " method = " post " >
2021-06-05 09:26:32 +00:00
@ csrf
@ method ( 'PATCH' )
< div class = " card " >
< div class = " card-body " >
< div class = " e-profile " >
< div class = " row " >
< div class = " col-12 col-sm-auto mb-4 " >
< div class = " slim rounded-circle border-secondary border text-gray-dark "
2022-06-02 14:11:24 +00:00
data - label = " Change your avatar " data - max - file - size = " 3 "
data - save - initial - image = " true "
style = " width: 140px;height:140px; cursor: pointer "
data - size = " 140,140 " >
2022-01-14 12:34:37 +00:00
< img src = " { { $user->getAvatar () }} " alt = " avatar " >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
< div class = " col d-flex flex-column flex-sm-row justify-content-between mb-3 " >
2022-01-14 12:34:37 +00:00
< div class = " text-center text-sm-left mb-2 mb-sm-0 " >
< h4 class = " pt-sm-2 pb-1 mb-0 text-nowrap " > {{ $user -> name }} </ h4 >
< p class = " mb-0 " > {{ $user -> email }}
@ if ( $user -> hasVerifiedEmail ())
2021-11-18 18:22:09 +00:00
< i data - toggle = " popover " data - trigger = " hover " data - content = " Verified "
2022-06-02 14:11:24 +00:00
class = " text-success fas fa-check-circle " ></ i >
2021-07-11 09:03:35 +00:00
@ else
2022-06-02 14:11:24 +00:00
< i data - toggle = " popover " data - trigger = " hover "
data - content = " Not verified "
class = " text-danger fas fa-exclamation-circle " ></ i >
2021-07-11 09:03:35 +00:00
@ endif
</ p >
2021-06-05 09:26:32 +00:00
< div class = " mt-1 " >
2022-01-14 12:34:37 +00:00
< span class = " badge badge-primary " >< i
class = " fa fa-coins mr-2 " ></ i > {{ $user -> Credits () }} </ span >
2021-06-05 09:26:32 +00:00
</ div >
2022-06-02 14:11:24 +00:00
2023-04-25 07:22:30 +00:00
@ if ( config ( 'SETTINGS::REFERRAL::ENABLED' ) == " true " )
@ if (( config ( 'SETTINGS::REFERRAL::ALLOWED' ) == " client " && $user -> role != " member " ) || config ( 'SETTINGS::REFERRAL::ALLOWED' ) == " everyone " )
2022-06-02 16:41:08 +00:00
< div class = " mt-1 " >
< span class = " badge badge-success " >< i
class = " fa fa-user-check mr-2 " ></ i >
2022-06-08 09:01:28 +00:00
{{ _ ( " Referral URL " )}} :
< span onclick = " onClickCopy() " id = " RefLink " style = " cursor: pointer; " >
{{ route ( " register " )}} ? ref = {{ $user -> referral_code }} </ span >
</ span >
2022-06-02 16:41:08 +00:00
@ else
< span class = " badge badge-warning " >< i
class = " fa fa-user-check mr-2 " ></ i >
{{ _ ( " Make a purchase to reveal your referral-URL " )}} </ span >
@ endif
</ div >
@ endif
2022-06-02 14:11:24 +00:00
</ div >
2022-06-02 16:41:08 +00:00
< div class = " text-center text-sm-right " >< span
2022-06-08 09:01:28 +00:00
class = " badge { { $badgeColor } } " > {{ $user -> role }} </ span >
2022-06-02 16:41:08 +00:00
< div class = " text-muted " >
< small > {{ $user -> created_at -> isoFormat ( 'LL' ) }} </ small >
</ div >
2023-01-02 14:00:57 +00:00
< div class = " text-muted " >
< small >
< button class = " badge badge-danger " id = " confirmDeleteButton " type = " button " > {{ __ ( 'Permanently delete my account' ) }} </ button >
</ small >
</ div >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
</ div >
2022-06-02 16:41:08 +00:00
< ul class = " nav nav-tabs " >
< li class = " nav-item " >< a href = " javasript:void(0) "
class = " active nav-link " > {{ __ ( 'Settings' ) }} </ a >
</ li >
</ ul >
< div class = " tab-content pt-3 " >
< div class = " tab-pane active " >
< div class = " row " >
< div class = " col " >
< div class = " row " >
< div class = " col " >
@ if ( $errors -> has ( 'pterodactyl_error_message' ) )
@ foreach ( $errors -> get ( 'pterodactyl_error_message' ) as $err )
< span class = " text-danger " role = " alert " >
2021-12-27 07:39:50 +00:00
< small >< strong > {{ $err }} </ strong ></ small >
</ span >
2022-06-02 16:41:08 +00:00
@ endforeach
@ endif
@ if ( $errors -> has ( 'pterodactyl_error_status' ) )
@ foreach ( $errors -> get ( 'pterodactyl_error_status' ) as $err )
< span class = " text-danger " role = " alert " >
< small >< strong > {{ $err }} </ strong ></ small >
</ span >
@ endforeach
@ endif
< div class = " form-group " >< label > {{ __ ( 'Name' )}} </ label > < input
class = " form-control @error('name') is-invalid @enderror "
type = " text " name = " name " placeholder = " { { $user->name }} "
value = " { { $user->name }} " >
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
@ error ( 'name' )
< div class = " invalid-feedback " >
{{ $message }}
</ div >
@ enderror
2022-06-02 14:11:24 +00:00
</ div >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
2022-06-02 16:41:08 +00:00
< div class = " row " >
< div class = " col " >
< div class = " form-group " >< label > {{ __ ( 'Email' ) }} </ label > < input
class = " form-control @error('email') is-invalid @enderror "
type = " text " placeholder = " { { $user->email }} " name = " email "
value = " { { $user->email }} " >
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
@ error ( 'email' )
< div class = " invalid-feedback " >
{{ $message }}
</ div >
@ enderror
2022-06-02 14:11:24 +00:00
</ div >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
</ div >
</ div >
2022-06-02 16:41:08 +00:00
< div class = " row " >
< div class = " col-12 col-sm-6 mb-3 " >
< div class = " mb-3 " >< b > {{ __ ( 'Change Password' ) }} </ b ></ div >
< div class = " row " >
< div class = " col " >
< div class = " form-group " >
< label > {{ __ ( 'Current Password' ) }} </ label >
< input
class = " form-control @error('current_password') is-invalid @enderror "
name = " current_password " type = " password "
placeholder = " •••••• " >
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
@ error ( 'current_password' )
< div class = " invalid-feedback " >
{{ $message }}
</ div >
@ enderror
2022-06-02 14:11:24 +00:00
</ div >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
2022-06-02 16:41:08 +00:00
< div class = " row " >
< div class = " col " >
< div class = " form-group " >< label > {{ __ ( 'New Password' ) }} </ label >
< input
class = " form-control @error('new_password') is-invalid @enderror "
name = " new_password " type = " password " placeholder = " •••••• " >
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
@ error ( 'new_password' )
< div class = " invalid-feedback " >
{{ $message }}
</ div >
@ enderror
2022-06-02 14:11:24 +00:00
</ div >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
2022-06-02 16:41:08 +00:00
< div class = " row " >
< div class = " col " >
< div class = " form-group " >
< label > {{ __ ( 'Confirm Password' ) }} </ span ></ label >
< input
class = " form-control @error('new_password_confirmation') is-invalid @enderror "
name = " new_password_confirmation " type = " password "
placeholder = " •••••• " >
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
@ error ( 'new_password_confirmation' )
< div class = " invalid-feedback " >
{{ $message }}
</ div >
@ enderror
2022-06-02 14:11:24 +00:00
</ div >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
</ div >
2023-04-25 07:22:30 +00:00
@ if ( ! empty ( config ( 'SETTINGS::DISCORD:CLIENT_ID' )) && ! empty ( config ( 'SETTINGS::DISCORD:CLIENT_SECRET' )))
2022-06-02 16:41:08 +00:00
< div class = " col-12 col-sm-5 offset-sm-1 mb-3 " >
@ if ( is_null ( Auth :: user () -> discordUser ))
< b > {{ __ ( 'Link your discord account!' ) }} </ b >
< div class = " verify-discord " >
< div class = " mb-3 " >
@ if ( $credits_reward_after_verify_discord )
< p > {{ __ ( 'By verifying your discord account, you receive extra Credits and increased Server amounts' ) }}
</ p >
@ endif
</ div >
2021-06-07 22:04:33 +00:00
</ div >
2022-06-02 16:41:08 +00:00
< a class = " btn btn-light " href = " { { route('auth.redirect') }} " >
< i class = " fab fa-discord mr-2 " ></ i > {{ __ ( 'Login with Discord' ) }}
</ a >
@ else
< div class = " verified-discord " >
< div class = " my-3 callout callout-info " >
< p > {{ __ ( 'You are verified!' ) }} </ p >
</ div >
2021-06-05 09:26:32 +00:00
</ div >
2022-06-02 16:41:08 +00:00
< div class = " row pl-2 " >
< div class = " small-box bg-dark " >
< div class = " d-flex justify-content-between " >
< div class = " p-3 " >
< h3 > {{ $user -> discordUser -> username }}
< sup > {{ $user -> discordUser -> locale }} </ sup >
</ h3 >
< p > {{ $user -> discordUser -> id }}
</ p >
</ div >
< div class = " p-3 " >< img width = " 100px "
height = " 100px "
class = " rounded-circle "
src = " { { $user->discordUser ->getAvatar() }} "
alt = " avatar " ></ div >
</ div >
< div class = " small-box-footer " >
< a href = " { { route('auth.redirect') }} " >
< i
class = " fab fa-discord mr-1 " ></ i > {{ __ ( 'Re-Sync Discord' ) }}
</ a >
2021-09-27 07:48:18 +00:00
</ div >
2021-11-18 18:22:09 +00:00
</ div >
2021-09-27 07:48:18 +00:00
</ div >
2022-06-02 16:41:08 +00:00
@ endif
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
</ div >
@ endif
</ div >
< div class = " row " >
< div class = " col d-flex justify-content-end " >
< button class = " btn btn-primary "
type = " submit " > {{ __ ( 'Save Changes' ) }} </ button >
2021-06-07 22:04:33 +00:00
</ div >
2021-06-05 09:26:32 +00:00
</ div >
2022-06-02 16:41:08 +00:00
</ div >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
</ div >
</ div >
2022-06-02 16:41:08 +00:00
</ form >
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
</ div >
<!-- END CUSTOM CONTENT -->
2021-06-05 09:26:32 +00:00
2022-06-02 16:41:08 +00:00
</ div >
</ section >
<!-- END CONTENT -->
2022-06-08 09:01:28 +00:00
< script >
2023-01-02 14:00:57 +00:00
document . getElementById ( " confirmDeleteButton " ) . onclick = async () => {
const { value : enterConfirm } = await Swal . fire ({
input : 'text' ,
2023-01-05 23:01:23 +00:00
inputLabel : '{{__("Are you sure you want to permanently delete your account and all of your servers?")}} \n Type "{{__(' Delete my account ')}}" in the Box below' ,
inputPlaceholder : " { { __('Delete my account')}} " ,
2023-01-02 14:00:57 +00:00
showCancelButton : true
})
2023-01-05 23:01:23 +00:00
if ( enterConfirm === " { { __('Delete my account')}} " ) {
2023-01-02 14:00:57 +00:00
Swal . fire ( " { { __('Account has been destroyed')}} " , '' , 'error' )
$ . ajax ({
type : " POST " ,
url : " { { route( " profile . selfDestroyUser " )}} " ,
data : ` {
" confirmed " : " yes " ,
} ` ,
success : function ( result ) {
console . log ( result );
},
dataType : " json "
});
location . reload ();
} else {
2023-01-05 23:01:23 +00:00
Swal . fire ( " { { __('Account was NOT deleted.')}} " , '' , 'info' )
2023-01-02 14:00:57 +00:00
}
}
2022-06-08 09:01:28 +00:00
function onClickCopy () {
let textToCopy = document . getElementById ( 'RefLink' ) . innerText ;
if ( navigator . clipboard ) {
navigator . clipboard . writeText ( textToCopy ) . then (() => {
Swal . fire ({
icon : 'success' ,
title : '{{ __("URL copied to clipboard")}}' ,
position : 'top-middle' ,
showConfirmButton : false ,
background : '#343a40' ,
toast : false ,
timer : 1000 ,
timerProgressBar : true ,
didOpen : ( toast ) => {
toast . addEventListener ( 'mouseenter' , Swal . stopTimer )
toast . addEventListener ( 'mouseleave' , Swal . resumeTimer )
}
})
})
} else {
console . log ( 'Browser Not compatible' )
}
}
</ script >
2022-06-02 16:41:08 +00:00
@ endsection
2022-06-08 09:01:28 +00:00