Skip to content

Commit

Permalink
Merge pull request #3437 from WordImpress/issue/3423
Browse files Browse the repository at this point in the history
fix(donation): don't block login form after first failed login #3423
  • Loading branch information
Devin Walker committed Jul 5, 2018
2 parents 7bf3feb + 5f5691f commit 90c3bce
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 30 deletions.
8 changes: 8 additions & 0 deletions assets/src/css/frontend/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,14 @@ User Login
}
}

.give-user-login-fields-container {
&:after {
display: block;
content: '';
clear: both;
}
}

/* Login Shortcode Form */
#give-login-form,
#give-register-form {
Expand Down
63 changes: 33 additions & 30 deletions includes/forms/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1406,42 +1406,45 @@ function give_get_login_fields( $form_id ) {
*
* @param int $form_id The form ID.
*/
do_action( 'give_checkout_login_fields_before', $form_id );
// do_action( 'give_checkout_login_fields_before', $form_id );
?>
<div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first form-row-responsive">
<label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
<?php _e( 'Username', 'give' ); ?>
<?php if ( give_logged_in_only( $form_id ) ) { ?>
<span class="give-required-indicator">*</span>
<?php } ?>
</label>
<div class="give-user-login-fields-container">
<div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first form-row-responsive">
<label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
<?php _e( 'Username', 'give' ); ?>
<?php if ( give_logged_in_only( $form_id ) ) { ?>
<span class="give-required-indicator">*</span>
<?php } ?>
</label>

<input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" type="text"
name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value=""
placeholder="<?php _e( 'Your username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
</div>
<input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" type="text"
name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value=""
placeholder="<?php _e( 'Your username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
</div>

<div id="give-user-pass-wrap-<?php echo $form_id; ?>"
class="give_login_password form-row form-row-last form-row-responsive">
<label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
<?php _e( 'Password', 'give' ); ?>
<?php if ( give_logged_in_only( $form_id ) ) { ?>
<span class="give-required-indicator">*</span>
<?php } ?>
</label>
<input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>"
type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>"
placeholder="<?php _e( 'Your password', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
<input type="hidden" name="give-purchase-var" value="needs-to-login"/>
</div>
<div id="give-user-pass-wrap-<?php echo $form_id; ?>"
class="give_login_password form-row form-row-last form-row-responsive">
<label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
<?php _e( 'Password', 'give' ); ?>
<?php if ( give_logged_in_only( $form_id ) ) { ?>
<span class="give-required-indicator">*</span>
<?php } ?>
</label>
<input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>"
type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>"
placeholder="<?php _e( 'Your password', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
<input type="hidden" name="give-purchase-var" value="needs-to-login"/>
</div>

<div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password">
<span class="give-forgot-password ">
<a href="<?php echo wp_lostpassword_url() ?>"
target="_blank"><?php _e( 'Reset Password', 'give' ) ?></a>
</span>
<div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password">
<span class="give-forgot-password ">
<a href="<?php echo wp_lostpassword_url() ?>"
target="_blank"><?php _e( 'Reset Password', 'give' ) ?></a>
</span>
</div>
</div>


<div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix">
<input type="submit" class="give-submit give-btn button" name="give_login_submit"
value="<?php _e( 'Login', 'give' ); ?>"/>
Expand Down

0 comments on commit 90c3bce

Please sign in to comment.