Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new OAuth links to signup page #25803

Merged
merged 6 commits into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
80 changes: 62 additions & 18 deletions dashboard/app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1599,25 +1599,73 @@ a.download-video {
}
}

#signin {
.flex-container {
display: flex;
justify-content: space-between;
}

#signin, #signup, #school-info-modal {
// NEW SIGN-UP & SIGN-IN FORMS
.signin, .signup {
margin: 20px 0;
#signin {
$field-width: 310px;
$button-width: 324px;

min-width: 450px;
display: flex;
flex-direction: column;
flex-grow: 2;

form {
display: flex;
flex-direction: column;
}

.signin {
width: 550px;
.field {
display: flex;
align-items: center;
justify-content: space-between;

input[type=text], input[type=password] {
width: $field-width;
height: 40px;
padding: 0 6px;
}
}

.field-aligned {
width: $button-width;
align-self: flex-end;
}

#forgot-password {
font-family: $gotham-extra-bold-italics;
}

button {
align-self: flex-end;
background-color: $orange;
border: 1px solid $orange;
color: $white;
font-family: $gotham-extra-bold;
margin: 5px 0;
width: $button-width;
}

.blue-button {
background-color: $blue;
border: 1px solid $blue;
}
}

#signup, #school-info-modal {
// NEW SIGN-UP FORM
.signup {
margin: 20px 0;
}

.finish-signup {
width: 800px;
}

.signin, .signup, .finish-signup {
.signup, .finish-signup {
$school-info-background: #f7f7f7;
$school-info-border-color: #e5e5e5;

Expand Down Expand Up @@ -1860,10 +1908,6 @@ a.download-video {
#user_type-block {
margin-bottom: 20px;
}
.devise_links {
padding-left: 20px;
margin-top: 20px;
}
}

.vertical-or {
Expand Down Expand Up @@ -1904,7 +1948,7 @@ a.download-video {

// NEW STYLES FOR devise/shared/_new_links
.devise-links {
margin: 10px 0;
flex-grow: 2;

form {
margin: 0;
Expand All @@ -1926,16 +1970,16 @@ a.download-video {
background-color: $orange;
border: 1px solid $orange;
color: $white;
font-weight: bolder;
padding: 0 20px;
margin: 5px;
font-family: $gotham-extra-bold;
padding: 10px 20px;
margin-right: 0;
}
}

.oauth-sign-in {
color: $white;
font-weight: bolder;
min-width: 400px;
font-family: $gotham-extra-bold;
width: 100%;
margin: 5px 0;

&.with-google_oauth2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- user_return_to_url = get_and_clear_session_user_return_to

.row
.span8.signupblock
.span7.signupblock
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {class: 'signupform'}) do |f|
#user_type-block.itemblock
.labelblock= t('signup_form.user_type_label')
Expand Down Expand Up @@ -152,9 +152,13 @@
-# Temporarily use student_terms so that existing translations get used.
!= t('signup_form.student_terms')

.span4
.devise_links
= render "devise/shared/old_links"
.span5{style: "display: flex;"}
%div.vertical-or
%hr
= t("or").upcase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a difference between using single or double quotes here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. i believe single-vs-double quotes only matters in Ruby when you have string interpolation

%hr

= render "devise/shared/new_links"

%script{src: minifiable_asset_path('js/signup.js')}
%script{type: "text/javascript", src: "https://maps.googleapis.com/maps/api/js?client=#{CDO.google_maps_client_id}&sensor=true&libraries=places,geometry&v=3.7"}
Expand Down
50 changes: 20 additions & 30 deletions dashboard/app/views/devise/sessions/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
%h1= t('signin_form.title')

/ Not yet signed up? Sign up
- if devise_mapping.registerable?
%strong
= t('auth.notyet_signedup')
= link_to t('nav.user.signup'), new_user_registration_path
%br/

#signin
= form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: "signin"}) do |f|

= show_flashes.html_safe
.flex-container
#signin
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
= show_flashes.html_safe
= f.hidden_field :hashed_email

= f.hidden_field :hashed_email

/ Email
.field-row
/ Email
.field
= t('signin_form.login_username')
= label_tag t('signin_form.login_username')
- email = @email || ''
= f.text_field :login, value: email, autofocus: email == ''

/ Password
.field-row
/ Password
.field
= f.label :password
= f.password_field :password, autofocus: email != ''

.submit-section
/ Forgot password?
- if devise_mapping.recoverable?
#forgot-password
= link_to t('auth.forgot_password'), new_password_path(resource_name)
%div.field-aligned
= link_to t('auth.forgot_password'), new_password_path(resource_name), id: 'forgot-password'

/ Sign in button
%button.submit#signin-button= t('signin_form.submit')
%button#signin-button= t('signin_form.submit')

/ Not yet signed up? Sign up
- if devise_mapping.registerable?
%div.field-aligned
%strong= t('auth.notyet_signedup')
= link_to new_user_registration_path, class: 'field-aligned' do
%button.blue-button= t('nav.user.signup')

%div.vertical-or
%hr
Expand All @@ -43,9 +39,8 @@

= render "devise/shared/new_links"

.row
.span12
%h3= t('signin.try_heading')
%h3= t('signin.try_heading')

.row
- if ['mc', 'dance'].include? DCDO.get('hoc_launch', nil)
= render partial: 'shared/course_tall_block', locals: { id: Script::MINECRAFT_AQUATIC_NAME, showState: false }
Expand Down Expand Up @@ -74,8 +69,3 @@

dashboard.clientState.reset();
});

$("#signup-button").click(function (e) {
window.location.href = "#{new_user_registration_path}";
return false;
});