Commit 728df71a by AlasdairSwan

ECOM-531 Updated style after review with Andy Waldrop

parent a9a4057d
...@@ -76,6 +76,10 @@ var edx = edx || {}; ...@@ -76,6 +76,10 @@ var edx = edx || {};
this.fields = data; this.fields = data;
for ( i=0; i<len; i++ ) { for ( i=0; i<len; i++ ) {
if ( data[i].errorMessages ) {
data[i].errorMessages = this.escapeStrings( data[i].errorMessages );
}
html.push( _.template( fieldTpl, $.extend( data[i], { html.push( _.template( fieldTpl, $.extend( data[i], {
form: this.formType, form: this.formType,
requiredStr: this.requiredStr requiredStr: this.requiredStr
...@@ -104,6 +108,14 @@ var edx = edx || {}; ...@@ -104,6 +108,14 @@ var edx = edx || {};
} }
}, },
escapeStrings: function( obj ) {
_.each( obj, function( val, key ) {
obj[key] = _.escape( val );
});
return obj;
},
forgotPassword: function( event ) { forgotPassword: function( event ) {
event.preventDefault(); event.preventDefault();
......
...@@ -101,6 +101,10 @@ ...@@ -101,6 +101,10 @@
padding-top: 25px; padding-top: 25px;
} }
.login-form {
margin-bottom: 20px;
}
%bold-label { %bold-label {
@include font-size(16); @include font-size(16);
font-family: $sans-serif; font-family: $sans-serif;
...@@ -116,6 +120,7 @@ ...@@ -116,6 +120,7 @@
.action-label { .action-label {
@extend %bold-label; @extend %bold-label;
margin-bottom: 20px;
} }
.form-field { .form-field {
...@@ -223,14 +228,21 @@ ...@@ -223,14 +228,21 @@
.login-provider { .login-provider {
@extend %btn-secondary-blue-outline; @extend %btn-secondary-blue-outline;
width: 100%; width: 100%;
margin-top: 20px; margin-bottom: 20px;
text-shadow: none;
text-transform: none;
.icon { .icon {
color: inherit; color: inherit;
margin-right: $baseline/2; margin-right: $baseline/2;
} }
&.button-Google:hover, &.button-Google:focus { &:last-child {
margin-bottom: 20px;
}
&.button-Google:hover,
&.button-Google:focus {
background-color: #dd4b39; background-color: #dd4b39;
border: 1px solid #A5382B; border: 1px solid #A5382B;
} }
...@@ -239,7 +251,8 @@ ...@@ -239,7 +251,8 @@
box-shadow: 0 2px 1px 0 #8D3024; box-shadow: 0 2px 1px 0 #8D3024;
} }
&.button-Facebook:hover, &.button-Facebook:focus { &.button-Facebook:hover,
&.button-Facebook:focus {
background-color: #3b5998; background-color: #3b5998;
border: 1px solid #263A62; border: 1px solid #263A62;
} }
...@@ -248,7 +261,8 @@ ...@@ -248,7 +261,8 @@
box-shadow: 0 2px 1px 0 #30487C; box-shadow: 0 2px 1px 0 #30487C;
} }
&.button-LinkedIn:hover , &.button-LinkedIn:focus { &.button-LinkedIn:hover,
&.button-LinkedIn:focus {
background-color: #0077b5; background-color: #0077b5;
border: 1px solid #06527D; border: 1px solid #06527D;
} }
...@@ -269,6 +283,7 @@ ...@@ -269,6 +283,7 @@
.message-title { .message-title {
@extend %heading-4; @extend %heading-4;
font-family: $sans-serif;
margin: 0 0 ($baseline/4) 0; margin: 0 0 ($baseline/4) 0;
font-size: em(14); font-size: em(14);
font-weight: 600; font-weight: 600;
...@@ -276,6 +291,7 @@ ...@@ -276,6 +291,7 @@
.message-copy { .message-copy {
@extend %body-text; @extend %body-text;
font-family: $sans-serif;
margin: 0 !important; margin: 0 !important;
padding: 0; padding: 0;
list-style: none; list-style: none;
...@@ -361,8 +377,9 @@ ...@@ -361,8 +377,9 @@
.headline, .headline,
.tagline, .tagline,
.form-type { .form-type {
@include span-columns(6); width: 600px;
@include shift(3); margin-left: calc( 50% - 300px );
margin-right: calc( 50% - 300px );
} }
.form-toggle { .form-toggle {
...@@ -388,18 +405,13 @@ ...@@ -388,18 +405,13 @@
} }
} }
// TODO: Update so actually using the grid
.login-provider { .login-provider {
@include span-columns(6); @include span-columns(6);
/*width: calc( 50% - 12px );
&:nth-child(odd) { /* Node uses last-child which is not specific enough */
margin-left: 10px; &:nth-of-type(2n) {
margin-right: 0;
} }
&:nth-child(even) {
margin-right: 10px;
}*/
} }
} }
} }
...@@ -27,9 +27,11 @@ ...@@ -27,9 +27,11 @@
aria-describedby="<%= form %>-<%= name %>-desc" aria-describedby="<%= form %>-<%= name %>-desc"
<% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %> <% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %>
<% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %> <% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %>
<% if ( typeof errorMessages !== 'undefined' ) { _.each(errorMessages, function(msg, type) {%> <% if ( typeof errorMessages !== 'undefined' ) {
_.each(errorMessages, function( msg, type ) {%>
data-errormsg-<%= type %>="<%= msg %>" data-errormsg-<%= type %>="<%= msg %>"
<% }); } %> <% });
} %>
<% if ( required ) { %> required<% } %> > <% if ( required ) { %> required<% } %> >
</textarea> </textarea>
<% } else { %> <% } else { %>
...@@ -41,9 +43,11 @@ ...@@ -41,9 +43,11 @@
<% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %> <% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %>
<% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %> <% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %>
<% if ( required ) { %> required<% } %> <% if ( required ) { %> required<% } %>
<% if ( typeof errorMessages !== 'undefined' ) { _.each(errorMessages, function(msg, type) {%> <% if ( typeof errorMessages !== 'undefined' ) {
_.each(errorMessages, function( msg, type ) {%>
data-errormsg-<%= type %>="<%= msg %>" data-errormsg-<%= type %>="<%= msg %>"
<% }); } %> <% });
} %>
value="<%- defaultValue %>" value="<%- defaultValue %>"
/> />
<% } %> <% } %>
...@@ -51,7 +55,7 @@ ...@@ -51,7 +55,7 @@
<% if ( type === 'checkbox' ) { %> <% if ( type === 'checkbox' ) { %>
<label for="<%= form %>-<%= name %>" class="inline"> <label for="<%= form %>-<%= name %>" class="inline">
<%= label %> <%= label %>
<% if ( required && requiredStr ) { %> <%= requiredStr %></label><% } %> <% if ( required && requiredStr ) { %> <%= requiredStr %><% } %>
</label> </label>
<% } %> <% } %>
......
<form id="login"> <form id="login" class="login-form">
<div class="status already-authenticated-msg hidden" aria-hidden="true"> <div class="status already-authenticated-msg hidden" aria-hidden="true">
<% if (currentProvider) { %> <% if (currentProvider) { %>
<p class="message-copy">You've successfully logged into <%- currentProvider %>, but you need to link your account. Please click "I am a returning user" to create an EdX account.</p> <p class="message-copy">You've successfully logged into <%- currentProvider %>, but you need to link your account. Please click "I am a new user" to create an edX account.</p>
<% } %> <% } %>
</div> </div>
......
<% if (currentProvider) { %> <% if (currentProvider) { %>
<div class="status" aria-hidden="false"> <div class="status" aria-hidden="false">
<h4 class="message-title">You've successfully signed in with <strong><%- currentProvider %></strong>.</h4> <p class="message-copy">You've successfully signed in with <%- currentProvider %>. We just need a little more information before you start learning with edX.</p>
<p class="message-copy">You've successfully signed in with <strong><%- currentProvider %></strong>. We just need a little more information before you start learning with edX.</p>
</div> </div>
<% } else { <% } else {
_.each( providers, function( provider) { %> _.each( providers, function( provider) { %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment