From 025958fc24d3c2c587cca76189295b9c5b6ad6f8 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Mon, 1 Aug 2016 12:18:25 -0400 Subject: [PATCH 1/4] Add `align` prop to `SubNavigation` component --- src/components/subnavigation/subnavigation.jsx | 15 +++++++++++++-- src/components/subnavigation/subnavigation.scss | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/components/subnavigation/subnavigation.jsx b/src/components/subnavigation/subnavigation.jsx index 959ae7285..62f4a78bb 100644 --- a/src/components/subnavigation/subnavigation.jsx +++ b/src/components/subnavigation/subnavigation.jsx @@ -9,10 +9,21 @@ require('./subnavigation.scss'); */ var SubNavigation = React.createClass({ type: 'SubNavigation', + getDefaultProps: function () { + return { + align: 'middle' + }; + }, render: function () { var classes = classNames( - 'sub-nav', - this.props.className + [ + 'sub-nav', + this.props.className + ], + { + 'sub-nav-align-left': this.props.align === 'left', + 'sub-nav-align-right': this.props.align === 'right' + } ); return (
diff --git a/src/components/subnavigation/subnavigation.scss b/src/components/subnavigation/subnavigation.scss index d6ed0446d..931f1d00d 100644 --- a/src/components/subnavigation/subnavigation.scss +++ b/src/components/subnavigation/subnavigation.scss @@ -53,4 +53,18 @@ } } } + + &.sub-nav-align-left { + justify-content: flex-start; + + li { + &:first-child { + margin-left: 0; + } + } + } + + &.sub-nav-align-right { + justify-content: flex-end; + } } From c842d06ac462a9695ee25064eb21e0255116836b Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Mon, 1 Aug 2016 12:19:29 -0400 Subject: [PATCH 2/4] Add "Request Account" button to Educators landing --- src/views/teachers/landing/l10n.json | 2 +- src/views/teachers/landing/landing.jsx | 7 ++++++- src/views/teachers/landing/landing.scss | 27 +++++++++---------------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/views/teachers/landing/l10n.json b/src/views/teachers/landing/l10n.json index 201229fe3..8bd9dd442 100644 --- a/src/views/teachers/landing/l10n.json +++ b/src/views/teachers/landing/l10n.json @@ -19,5 +19,5 @@ "teacherlanding.creativeComputing": "The Creative Computing Curriculum Guide provides plans, activities, and strategies for introducing creative computing.", "teacherlanding.accountsTitle": "Teacher Accounts in Scratch", "teacherlanding.accountsDescription": "As an educator, you can request a Scratch Teacher Account, which makes it easier to create accounts for groups of students and to manage your students’ projects and comments. To learn more, see the Teacher Account FAQ page.", - "teacherlanding.accountsButton": "Coming Soon" + "teacherlanding.requestAccount": "Request Account" } diff --git a/src/views/teachers/landing/landing.jsx b/src/views/teachers/landing/landing.jsx index c66898c15..6bc046b7c 100644 --- a/src/views/teachers/landing/landing.jsx +++ b/src/views/teachers/landing/landing.jsx @@ -5,6 +5,7 @@ var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; var FormattedMessage = require('react-intl').FormattedMessage; var injectIntl = require('react-intl').injectIntl; +var Button = require('../../../components/forms/button.jsx'); var Page = require('../../../components/page/www/page.jsx'); var FlexRow = require('../../../components/flex-row/flex-row.jsx'); var SubNavigation = require('../../../components/subnavigation/subnavigation.jsx'); @@ -109,7 +110,11 @@ var Landing = injectIntl(React.createClass({

-
+ + +
  • +
    +
    teacher account diff --git a/src/views/teachers/landing/landing.scss b/src/views/teachers/landing/landing.scss index 5f43f11e2..c0eef723d 100644 --- a/src/views/teachers/landing/landing.scss +++ b/src/views/teachers/landing/landing.scss @@ -220,6 +220,15 @@ $story-width: $cols3; color: $ui-white; } + .teacher-account-buttons { + li { + border: 2px solid $ui-white; + padding: 16px; + font-size: 16px; + font-weight: 500; + } + } + #left { width: $cols4; max-width: $cols4; @@ -229,24 +238,6 @@ $story-width: $cols3; p { margin-bottom: 3.5rem; } - - .coming-soon { - border: 2px solid $ui-white; - border-radius: 50px; - box-shadow: none; - background-color: transparent; - padding: 16px 16px; - width: $cols5 / 2; - text-align: center; - color: $ui-white; - font-size: 16px; - font-weight: 500; - box-sizing: border-box; - - &:hover { - box-shadow: none; - } - } } img { From 0e8e842eb296d0b3823a2b0b40193d726d086fbb Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 2 Aug 2016 09:50:46 -0400 Subject: [PATCH 3/4] Lint --- src/views/teachers/landing/landing.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/teachers/landing/landing.jsx b/src/views/teachers/landing/landing.jsx index 6bc046b7c..ce32a564c 100644 --- a/src/views/teachers/landing/landing.jsx +++ b/src/views/teachers/landing/landing.jsx @@ -5,7 +5,6 @@ var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; var FormattedMessage = require('react-intl').FormattedMessage; var injectIntl = require('react-intl').injectIntl; -var Button = require('../../../components/forms/button.jsx'); var Page = require('../../../components/page/www/page.jsx'); var FlexRow = require('../../../components/flex-row/flex-row.jsx'); var SubNavigation = require('../../../components/subnavigation/subnavigation.jsx'); From a9039ca63b73f55ee9b81fb91ec75899cd4a38ef Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 2 Aug 2016 10:52:47 -0400 Subject: [PATCH 4/4] Only redirect approved educators to My Classes Fixes #800 --- .../teacherwaitingroom/teacherwaitingroom.jsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/views/teacherwaitingroom/teacherwaitingroom.jsx b/src/views/teacherwaitingroom/teacherwaitingroom.jsx index 5770f55b3..94c0660b3 100644 --- a/src/views/teacherwaitingroom/teacherwaitingroom.jsx +++ b/src/views/teacherwaitingroom/teacherwaitingroom.jsx @@ -11,27 +11,28 @@ require('./teacherwaitingroom.scss'); var TeacherWaitingRoom = React.createClass({ displayName: 'TeacherWaitingRoom', componentWillReceiveProps: function (nextProps) { - if (nextProps.session.permissions.educator && nextProps.session.permissions.social) { + if (nextProps.approved) { window.location.href = '/educators/classes/'; } }, render: function () { - var permissions = this.props.session.permissions || {}; - var user = this.props.session.user || {}; return ( - + ); } }); var mapStateToProps = function (state) { + var permissions = state.session.session.permissions || {}; + var user = state.session.session.user || {}; return { - session: state.session.session + approved: permissions && permissions.educator && !permissions.educator_invitee && permissions.social, + confirmed: permissions && permissions.social, + invited: permissions && permissions.educator_invitee, + educator: permissions && permissions.educator, + email: user && user.email }; };