Skip to content

Commit

Permalink
Merge pull request #2142 from shinyichen/login
Browse files Browse the repository at this point in the history
Fixed mobile layout for login and registration forms
  • Loading branch information
thostetler authored Apr 14, 2021
2 parents efa4dd6 + d4dca1f commit a6b57a7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
7 changes: 4 additions & 3 deletions src/js/widgets/authentication/templates/container.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div class="form-container s-form-container col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3">

</div>
<div
class="form-container s-form-container col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3"
style="padding-right: 0;"
></div>
18 changes: 8 additions & 10 deletions src/js/widgets/authentication/templates/log-in.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<div class="panel panel-default">
<legend class="panel-heading">
Log in to ADS
<button class="show-register btn btn-default pull-right">
sign up for an account
</button>
<div class="s-form-note">
<i class="fa fa-info-circle" aria-hidden="true"></i> Your ADS Classic
credentials will not work here. <br />
You'll have to make a new account to access this system.
credentials will not work here. You'll have to make a new account to access this system.
</div>
</legend>
<form class="panel-body">
Expand Down Expand Up @@ -35,18 +31,20 @@
/>
</div>

<button class="btn btn-link show-reset-password-1">
Forgot your password?
</button>
<span class="help-block no-show s-help-block"></span>

<div class="form-group has-feedback">
<span class="help-block no-show s-help-block s-help-block-submit"></span>
<button type="submit" class="btn btn-primary-faded submit-login">
Submit
</button>
</div>

<div class="form-group">
<button class="btn btn-link show-reset-password-1">
Forgot your password?
</button>
<span class="help-block no-show s-help-block"></span>
<div style="display: flex; justify-content: center;">
<strong>Don't have an account yet?&nbsp;<a class="show-register">Register</a></strong>
</div>
</form>

Expand Down
5 changes: 4 additions & 1 deletion src/js/widgets/authentication/templates/register.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div class="panel panel-default">
<legend class="panel-heading">Register for an ADS Account
<button class="show-login btn btn-default pull-right"> I already have an account </button>
</legend>
<form class="panel-body">
<div class="form-group has-feedback">
Expand All @@ -27,6 +26,10 @@
<span class="help-block no-show s-help-block"></span>
</div>

<div style="display: flex; justify-content: center;">
<strong>Already have an account?&nbsp;<a class="show-login">Login</a></strong>
</div>

<div class="form-group">
<div class="g-recaptcha"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div class="panel panel-default">
<legend class="panel-heading"> Password Reset
<button class="show-login btn btn-default pull-right"> return to login form </button>
</legend>
<form class="panel-body">
<div class="form-group has-feedback">
Expand All @@ -14,6 +13,10 @@
<span class="help-block no-show s-help-block"></span>
</div>

<div style="display: flex; justify-content: center;">
<strong><a class="show-login">Return to login form</a></strong>
</div>

<div class="form-group">
<div class="g-recaptcha"></div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions test/mocha/js/widgets/authentication_widget.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define([

//should render nothing since there is no subview indicated in the view model
expect(normalizeSpace($('#test').html())).to.eql(
'<div class="s-authentication-container row s-form-widget"><div class="form-container s-form-container col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3"> </div></div>'
'<div class="s-authentication-container row s-form-widget"><div class="form-container s-form-container col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3" style="padding-right: 0;"></div> </div>'
);

a.setSubView('login');
Expand Down Expand Up @@ -78,7 +78,7 @@ define([

a.setSubView('login');

$('.show-register').click();
$('.show-register').trigger('click');

expect(publishStub.args[0]).to.eql([
'[Router]-Navigate-With-Trigger',
Expand All @@ -90,7 +90,7 @@ define([

a.setSubView('reset-password-1');

$('.show-login').click();
$('.show-login').trigger('click');

expect(publishStub.args[1]).to.eql([
'[Router]-Navigate-With-Trigger',
Expand All @@ -102,7 +102,7 @@ define([

a.setSubView('register');

$('.show-login').click();
$('.show-login').trigger('click');

expect(publishStub.args[2]).to.eql([
'[Router]-Navigate-With-Trigger',
Expand All @@ -114,7 +114,7 @@ define([

a.setSubView('login');

$('.show-reset-password-1').click();
$('.show-reset-password-1').trigger('click');

expect(publishStub.args[3]).to.eql([
'[Router]-Navigate-With-Trigger',
Expand Down

0 comments on commit a6b57a7

Please sign in to comment.