Skip to content

Commit

Permalink
Additional 'continue' button in registration approval form.
Browse files Browse the repository at this point in the history
See #3396.
  • Loading branch information
boonebgorges committed Jul 9, 2024
1 parent 1ff244b commit 53ccd37
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
8 changes: 8 additions & 0 deletions wp-content/themes/openlab/buddypress/members/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ class="form-control"
<input type="radio" name="account-description-approval" id="account-description-approval-yes" value="yes" data-parsley-required data-parsley-required-message="Please confirm that you have read the description of the account type." <?php checked( $account_description_approval_submitted, 'yes' ); ?> /> <label for="account-description-approval-yes">Yes, I understand</label><br />
<input type="radio" name="account-description-approval" id="account-description-approval-no" value="no" data-parsley-required data-parsley-required-message="Please confirm that you have read the description of the account type." <?php checked( $account_description_approval_submitted, 'no' ); ?> /> <label for="account-description-approval-no">No, <a href="https://openlab.citytech.cuny.edu/blog/help/contact-us">I have questions</a></label>
</fieldset>

<div class="registration-continue-button" id="registration-continue-button-yes">
<button class="btn btn-primary" href="#">Continue with Sign-up</button>
</div>

<div class="registration-continue-button" id="registration-continue-button-no">
<a class="btn btn-primary" target="_blank" href="https://openlab.citytech.cuny.edu/blog/help/contact-us/">Get Help</a>
</div>
</div>
</div><!-- .panel-body -->
</div>
Expand Down
17 changes: 15 additions & 2 deletions wp-content/themes/openlab/js/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,22 @@
init_visible_metaboxes();
});

$( '[name="account-description-approval"]' ).on( 'change', function() {
init_visible_metaboxes();
$( '[name="account-description-approval"]' ).on( 'change', function( e ) {
$( '.registration-continue-button' ).hide();

if ( 'yes' === e.target.value ) {
$( '#registration-continue-button-yes' ).show();
} else {
$( '#registration-continue-button-no' ).show();
init_visible_metaboxes();
}
} )

$( '#registration-continue-button-yes' ).on( 'click', function( e ) {
e.preventDefault();
init_visible_metaboxes();
} );

load_account_type_description( $account_type_field.val() );
load_account_type_fields();
init_visible_metaboxes();
Expand Down Expand Up @@ -525,6 +537,7 @@
function load_account_type_description( accountType ) {
$( '.account-type-description' ).hide();
$( '.account-description-approval-fieldset' ).hide();
$( '.registration-continue-button' ).hide();

if ( accountType && accountType.length > 0 ) {
$( '.account-type-description[data-account-type="' + accountType + '"]' ).show();
Expand Down
8 changes: 8 additions & 0 deletions wp-content/themes/openlab/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,14 @@ body{
.account-description-approval-fieldset {
margin-top: 20px;
}

.registration-continue-button {
margin-top: 20px;

a {
text-decoration: none;
}
}
}
.panel-body{
.bp-template-notice{
Expand Down

0 comments on commit 53ccd37

Please sign in to comment.