2023-04-08 00:42:55 +02:00
@ js ( js / account / account . js )
@ extends ( templates / layout_normal )
@ section ( main )
< h2 > Account </ h2 >
2023-05-01 19:18:48 +02:00
< div class = " box compactBox " >
2023-04-16 20:54:29 +02:00
< form id = " accountForm " action = " <?= Container:: $routeCollection->getRoute ('account-action')->generateLink() ?> " method = " post " data - reload - on - success = " true " data - observe - inputs = " email,username,password_new,password_new_confirm,nickname,phone,id_number " >
2023-04-08 00:42:55 +02:00
< ? php if ( $user [ 'password' ] !== null && $user [ 'google_sub' ] !== null ) : ?>
< p class = " justify small " > Please confirm your identity with your password or with Google to modify your account .</ p >
< div class = " inputWithButton " >
2023-05-02 13:12:19 +02:00
< input type = " password " class = " text " name = " password " placeholder = " Current password " autocomplete = " current-password " required minlength = " 6 " autofocus ><!--
2023-04-08 00:42:55 +02:00
-->< button id = " authenticateWithGoogleButton " class = " yellow " type = " button " > Google </ button >
</ div >
< ? php elseif ( $user [ 'password' ] !== null ) : ?>
< p class = " justify small " > Please confirm your identity with your password to modify your account .</ p >
2023-05-02 13:12:19 +02:00
< input type = " password " class = " text big fullWidth " name = " password " placeholder = " Current password " autocomplete = " current-password " required minlength = " 6 " autofocus >
2023-04-08 00:42:55 +02:00
< ? php elseif ( $user [ 'google_sub' ] !== null ) : ?>
< p class = " justify small " > Please confirm your identity with Google to modify your account .</ p >
< div class = " inputWithButton " >
< input type = " text " class = " text " name = " password " placeholder = " Authenticate with Google... " disabled ><!--
-->< button id = " authenticateWithGoogleButton " class = " yellow " type = " button " > Google </ button >
</ div >
< ? php endif ; ?>
< hr >
2023-05-02 13:12:19 +02:00
< input type = " email " class = " text big fullWidth " name = " email " placeholder = " Email address " autocomplete = " username " value = " <?= $user['email'] ?> " >
2023-04-09 02:10:32 +02:00
< input type = " text " class = " text big fullWidth marginTop " name = " username " placeholder = " Username " value = " <?= $user['username'] ?> " >
2023-05-02 13:12:19 +02:00
< input type = " password " class = " text big fullWidth marginTop " name = " password_new " placeholder = " New password " autocomplete = " new-password " minlength = " 6 " >
< input type = " password " class = " text big fullWidth marginTop " name = " password_new_confirm " placeholder = " New password confirmation " autocomplete = " new-password " minlength = " 6 " >
2023-04-09 02:29:23 +02:00
< hr >
< input type = " text " class = " text big fullWidth marginTop " name = " full_name " placeholder = " Full name " value = " <?= $user['full_name'] ?> " disabled >
< input type = " text " class = " text big fullWidth marginTop " name = " nickname " placeholder = " Nickname " value = " <?= $user['nickname'] ?> " >
< input type = " text " class = " text big fullWidth marginTop " name = " phone " placeholder = " Phone " value = " <?= $user['phone'] ?> " >
< input type = " text " class = " text big fullWidth marginTop " name = " id_number " placeholder = " ID number " value = " <?= $user['id_number'] ?> " >
2023-04-08 00:42:55 +02:00
< p id = " accountFormError " class = " formError justify marginTop " ></ p >
< div class = " right marginTop " >
2023-05-02 01:03:39 +02:00
< button type = " submit " name = " submit_button " disabled > Save </ button >
2023-04-08 00:42:55 +02:00
</ div >
</ form >
</ div >
@ endsection
2023-04-16 14:25:06 +02:00
@ section ( pageScript )
< script >
2023-04-16 20:54:29 +02:00
var googleAuthenticateUrl = '<?= Container::$routeCollection->getRoute(' account . googleAuthenticate ')->generateLink() ?>' ;
2023-04-16 14:25:06 +02:00
</ script >
@ endsection