From 3d18f04a43aa2fdb4f41109c0cda0ba8a8677b5c Mon Sep 17 00:00:00 2001 From: Technoboy10 Date: Fri, 24 Jun 2016 10:05:44 -0400 Subject: [PATCH 01/49] localize educator landing page --- src/views/teachers/landing/l10n.json | 27 ++++++++ src/views/teachers/landing/landing.jsx | 85 +++++++++++--------------- 2 files changed, 61 insertions(+), 51 deletions(-) create mode 100644 src/views/teachers/landing/l10n.json diff --git a/src/views/teachers/landing/l10n.json b/src/views/teachers/landing/l10n.json new file mode 100644 index 000000000..896ff4f70 --- /dev/null +++ b/src/views/teachers/landing/l10n.json @@ -0,0 +1,27 @@ +{ + "teacherlanding.title": "Scratch for Educators", + "teacherlanding.intro": "Your students can use Scratch to code their own interactive stories, animations, and games. In the process, they learn to think creatively, reason systematically, and work collaboratively — essential skills for everyone in today’s society.", + "teacherlanding.inPracticeAnchor": "In Practice", + "teacherlanding.resourcesAnchor": "Resources", + "teacherlanding.accountsAnchor": "Teacher Accounts", + "teacherlanding.inPracticeTitle": "Who Uses Scratch?", + "teacherlanding.inPracticeIntro": "Educators are using Scratch in a wide variety of: ", + "teacherlanding.generalUsageSettings": "Settings: schools, museums, libraries, community centers", + "teacherlanding.generalUsageGradeLevels": "Grade Levels: elementary, middle, and high school (and some colleges too!)", + "teacherlanding.generalUsageSubjectAreas": "Subject Areas: language arts, science, social studies, math, computer science, foreign languages, and the arts", + "teacherlanding.ingridTitle": "Instructional Technology Specialist", + "teacherlanding.dylanTitle": "Educational Technologist", + "teacherlanding.afterSchoolTitle": "After-School Program", + "teacherlanding.resourcesTitle": "Educator Resources", + "teacherlanding.scratchEdTitle": "A Community for Educators", + "teacherlanding.scratchEdDescription": "ScratchEd is an online community where Scratch educators share stories, exchange resources, ask questions, and find people. ScratchEd is developed and supported by the Harvard Graduate School of Education.", + "teacherlanding.meetupTitle": "In-Person Gatherings", + "teacherlanding.meetupDescription": "Scratch Educator Meetups from each other, sharing their ideas and strategies for supporting computational creativity in all its forms.", + "teacherlanding.guidesTitle": "Guides & Tutorials", + "teacherlanding.helpPage": "On the Help Page, you can find workshop guides, Scratch Cards, videos, and other resources.", + "teacherlanding.tipsWindow" : "The Tips Window features step-by-step tutorials for getting started in Scratch.", + "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": "Request Account" +} diff --git a/src/views/teachers/landing/landing.jsx b/src/views/teachers/landing/landing.jsx index de746480d..01ad7ac95 100644 --- a/src/views/teachers/landing/landing.jsx +++ b/src/views/teachers/landing/landing.jsx @@ -1,6 +1,10 @@ var React = require('react'); var render = require('../../../lib/render.jsx'); +var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; +var FormattedMessage = require('react-intl').FormattedMessage; +var injectIntl = require('react-intl').injectIntl; + var Page = require('../../../components/page/www/page.jsx'); var FlexRow = require('../../../components/flex-row/flex-row.jsx'); var SubNavigation = require('../../../components/subnavigation/subnavigation.jsx'); @@ -9,21 +13,17 @@ var Button = require('../../../components/forms/button.jsx'); require('./landing.scss'); -var Landing = React.createClass({ +var Landing = injectIntl(React.createClass({ type: 'Landing', render: function () { return (
-

Scratch for Educators

+

- Your students can use Scratch to code their own{' '} - interactive stories, animations, and games.{' '} - In the process, they learn to think creatively,{' '} - reason systematically, and work{' '} - collaboratively — essential skills for everyone in today’s society. +

@@ -33,17 +33,17 @@ var Landing = React.createClass({
  • - In Practice +
  • - Resources +
  • - Teacher Accounts +
  • @@ -53,27 +53,26 @@ var Landing = React.createClass({
    -

    Who Uses Scratch?

    -

    Educators are using Scratch in a wide variety of:

    +

    +

    -

    Settings: schools, museums, libraries, community centers

    -

    Grade Levels: elementary, middle, and high school (and some colleges too!)

    -

    Subject Areas: language arts, science, social studies,{' '} - math, computer science, foreign languages, and the arts

    +

    +

    +

    ingrid's story
    Ingrid Gustafson -

    Instructional Technology Specialist

    +

    dylan's story
    Dylan Ryder -

    Educational Technologist

    +

    @@ -81,7 +80,7 @@ var Landing = React.createClass({ alt="plug in studio's story" />
    Plug-In Studios -

    After-School Program

    +

    @@ -89,60 +88,46 @@ var Landing = React.createClass({ alt="ghana code club's story" />
    Ghana Code Club -

    After-School Program

    +

    -

    Educator Resources

    +

    -

    A Community for Educators

    +

    - ScratchEd is an{' '} - online community where Scratch educators{' '} - share stories, - exchange resources, ask questions, and{' '} - find people. ScratchEd is developed and supported by{' '} - the Harvard Graduate School of Education. +

    -

    In-Person Gatherings

    +

    - Scratch Educator Meetups{' '} - are gatherings of Scratch Educators who want to learn with and{' '} - from each other, sharing their ideas and strategies{' '} - for supporting computational creativity in all its forms. +

    -

    Guides & Tutorials

    +

    resources icon

    - On the Help Page,{' '} - you can find workshop guides, Scratch Cards, videos, and other resources. +

    tips window icon

    - The{' '} - Tips Window{' '} - features step-by-step tutorials for getting started in Scratch. +

    creative computing icon

    - The Creative Computing{' '} - Curriculum Guide{' '} - provides plans, activities, and{' '} - strategies for introducing creative computing. +

    @@ -151,15 +136,13 @@ var Landing = React.createClass({
    -

    Teacher Accounts in Scratch

    +

    - 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. +

    - + + +
    teacher account
    @@ -167,6 +150,6 @@ var Landing = React.createClass({
    ); } -}); +})); render(, document.getElementById('app')); From 0277b96698722098f3535cbd47d234f0acd49636 Mon Sep 17 00:00:00 2001 From: Technoboy10 Date: Fri, 24 Jun 2016 10:39:55 -0400 Subject: [PATCH 02/49] move teacher accounts string to general --- src/l10n.json | 7 +++++-- src/views/teachers/landing/l10n.json | 1 - src/views/teachers/landing/landing.jsx | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/l10n.json b/src/l10n.json index 1e1625093..8c6a9802e 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -92,14 +92,17 @@ "general.stories": "Stories", "general.results": "Results", + "general.teacherAccounts": "Teacher Accounts", + + "footer.discuss": "Discussion Forums", "footer.help": "Help Page", "footer.scratchFamily": "Scratch Family", "login.forgotPassword": "Forgot Password?", - + "navigation.signOut": "Sign out", - + "parents.FaqAgeRangeA": "While Scratch is primarily designed for 8 to 16 year olds, it is also used by people of all ages, including younger children with their parents.", "parents.FaqAgeRangeQ": "What is the age range for Scratch?", "parents.FaqResourcesQ": "What resources are available for learning Scratch?", diff --git a/src/views/teachers/landing/l10n.json b/src/views/teachers/landing/l10n.json index 896ff4f70..fe9e2c6cf 100644 --- a/src/views/teachers/landing/l10n.json +++ b/src/views/teachers/landing/l10n.json @@ -3,7 +3,6 @@ "teacherlanding.intro": "Your students can use Scratch to code their own interactive stories, animations, and games. In the process, they learn to think creatively, reason systematically, and work collaboratively — essential skills for everyone in today’s society.", "teacherlanding.inPracticeAnchor": "In Practice", "teacherlanding.resourcesAnchor": "Resources", - "teacherlanding.accountsAnchor": "Teacher Accounts", "teacherlanding.inPracticeTitle": "Who Uses Scratch?", "teacherlanding.inPracticeIntro": "Educators are using Scratch in a wide variety of: ", "teacherlanding.generalUsageSettings": "Settings: schools, museums, libraries, community centers", diff --git a/src/views/teachers/landing/landing.jsx b/src/views/teachers/landing/landing.jsx index 01ad7ac95..e9fc6243a 100644 --- a/src/views/teachers/landing/landing.jsx +++ b/src/views/teachers/landing/landing.jsx @@ -43,7 +43,7 @@ var Landing = injectIntl(React.createClass({
  • - +
  • From 93054cf393662860217b84ac3130e1badcc6c2e3 Mon Sep 17 00:00:00 2001 From: Technoboy10 Date: Fri, 24 Jun 2016 11:13:05 -0400 Subject: [PATCH 03/49] change from defaultValue to value because of formsy --- src/components/languagechooser/languagechooser.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/languagechooser/languagechooser.jsx b/src/components/languagechooser/languagechooser.jsx index c9e0af69d..d536a1d5b 100644 --- a/src/components/languagechooser/languagechooser.jsx +++ b/src/components/languagechooser/languagechooser.jsx @@ -33,7 +33,7 @@ var LanguageChooser = React.createClass({
    Date: Thu, 30 Jun 2016 16:46:44 -0400 Subject: [PATCH 31/49] Remove z-index as it wasn't needed --- src/views/teachers/landing/landing.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/views/teachers/landing/landing.scss b/src/views/teachers/landing/landing.scss index 3fe14cc2d..9b2838a12 100644 --- a/src/views/teachers/landing/landing.scss +++ b/src/views/teachers/landing/landing.scss @@ -52,7 +52,6 @@ $story-width: $cols3; .ted-talk { position: relative; - z-index: 10; margin-bottom: $gutter; border: 2px solid $ui-border; border-radius: 10px; @@ -61,7 +60,6 @@ $story-width: $cols3; overflow: hidden; iframe { - z-index: 9; border: 0; width: inherit; height: inherit; From 6db426a586ebcf2ec2d89be2d5d21389a15053cb Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 30 Jun 2016 16:52:46 -0400 Subject: [PATCH 32/49] Use empty default object Looks as if the having one of these objects as the default causes overwriting in some way, as opposed to augmentation. Have the source object be an empty one, so that it gets the attributes of both defaults and props. Fixes #642. --- src/components/forms/validations.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/forms/validations.jsx b/src/components/forms/validations.jsx index 2107254c4..6410322b9 100644 --- a/src/components/forms/validations.jsx +++ b/src/components/forms/validations.jsx @@ -29,8 +29,9 @@ module.exports.validationHOCFactory = function (defaultValidationErrors) { var ValidatedComponent = React.createClass({ render: function () { var validationErrors = defaults( - this.props.validationErrors, - defaultValidationErrors + {}, + defaultValidationErrors, + this.props.validationErrors ); return ( From 42c000d14f05d69f70c84db4aab6006b82161692 Mon Sep 17 00:00:00 2001 From: Technoboy10 Date: Thu, 30 Jun 2016 18:06:17 -0400 Subject: [PATCH 33/49] orangify this --- src/components/dropdown/dropdown.scss | 10 +++++++--- src/components/navigation/container/navigation.scss | 10 +++++++--- src/components/navigation/www/navigation.jsx | 3 ++- src/components/page/www/page.jsx | 6 +++++- webpack.config.js | 3 ++- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/components/dropdown/dropdown.scss b/src/components/dropdown/dropdown.scss index 78ef27a81..4b0c56cb5 100644 --- a/src/components/dropdown/dropdown.scss +++ b/src/components/dropdown/dropdown.scss @@ -15,6 +15,10 @@ font-size: .8125rem; font-weight: normal; + &.staging { + background-color: $ui-orange; + } + &.open { display: block; } @@ -53,7 +57,7 @@ text-decoration: none; } } - } + } &.with-arrow { $arrow-border-width: 14px; @@ -61,12 +65,12 @@ border-radius: 5px; overflow: visible; - &:before { + &:before { display: block; position: absolute; top: -$arrow-border-width / 2; right: 10%; - + transform: rotate(45deg); border-top: 1px solid $active-gray; diff --git a/src/components/navigation/container/navigation.scss b/src/components/navigation/container/navigation.scss index c4d49de68..abcc7937a 100644 --- a/src/components/navigation/container/navigation.scss +++ b/src/components/navigation/container/navigation.scss @@ -11,8 +11,12 @@ box-shadow: 0 0 3px $box-shadow-gray; background-color: $ui-blue; + &.staging { + background-color: $ui-orange; + } - width: 100%; + + width: 100%; /* NOTE: Height should match offset settings in main.scss file */ height: 50px; @@ -35,7 +39,7 @@ .ie9 & { display: table-row; } - + > li { display: inline-block; @@ -75,7 +79,7 @@ display: block; padding: 13px 15px 4px 15px; height: 33px; - + text-decoration: none; white-space: nowrap; color: $type-white; diff --git a/src/components/navigation/www/navigation.jsx b/src/components/navigation/www/navigation.jsx index 6b678e9d9..8e740df12 100644 --- a/src/components/navigation/www/navigation.jsx +++ b/src/components/navigation/www/navigation.jsx @@ -253,7 +253,8 @@ var Navigation = React.createClass({ + onRequestClose={this.closeAccountNav} + className={process.env.SCRATCH_ENV}>
  • diff --git a/src/components/page/www/page.jsx b/src/components/page/www/page.jsx index 93776e35c..070f7e1dc 100644 --- a/src/components/page/www/page.jsx +++ b/src/components/page/www/page.jsx @@ -1,4 +1,5 @@ var React = require('react'); +var classNames = require('classnames'); var Navigation = require('../../navigation/www/navigation.jsx'); var Footer = require('../../footer/www/footer.jsx'); @@ -6,9 +7,12 @@ var Footer = require('../../footer/www/footer.jsx'); var Page = React.createClass({ type: 'Page', render: function () { + var classes = classNames({ + 'staging': process.env.SCRATCH_ENV == 'staging' + }); return (
    -
  • {this.props.permissions.educator ? [ -
  • +
  • diff --git a/src/components/teacher-banner/teacher-banner.jsx b/src/components/teacher-banner/teacher-banner.jsx index ec0369766..91b76e23d 100644 --- a/src/components/teacher-banner/teacher-banner.jsx +++ b/src/components/teacher-banner/teacher-banner.jsx @@ -35,11 +35,11 @@ var TeacherBanner = React.createClass({
    {this.props.session.status === sessionActions.Status.FETCHED ? ( this.props.session.session.user ? [ -

    +

    {this.props.messages['teacherbanner.greeting']},{' '} {this.props.session.session.user.username}

    , -

    +

    {this.props.messages['teacherbanner.subgreeting']}

    ] : [] @@ -48,17 +48,17 @@ var TeacherBanner = React.createClass({ {this.props.session.status === sessionActions.Status.FETCHED ? ( this.props.session.session.user ? [ - + , - + , - + diff --git a/src/views/splash/splash.jsx b/src/views/splash/splash.jsx index c3241fd62..50f574a4b 100644 --- a/src/views/splash/splash.jsx +++ b/src/views/splash/splash.jsx @@ -377,7 +377,7 @@ var Splash = injectIntl(React.createClass({ ] : []} {this.props.permissions.educator ? [ - + ] : []}
    {this.props.session.status === sessionActions.Status.FETCHED ? ( From b89d644573ba026e899b28475fdc0c546e773359 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Sun, 3 Jul 2016 15:54:37 -0400 Subject: [PATCH 38/49] Fix JSON response parsing in IE Fixes #654 IE does not honor responseType: 'json', and will not parse responses as JSON unless json data is present in the request. For some reason this issue can also be solved by including a `json` attribute on the xhr request, but if that's present, url encoded form data is overwritten with the contents of the json. So just try to parse the response ourselves if it looks like it wasn't parsed. See https://github.com/Raynos/xhr/issues/123 --- src/lib/api.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/api.js b/src/lib/api.js index 05cc2bf1d..2efd806b7 100644 --- a/src/lib/api.js +++ b/src/lib/api.js @@ -54,6 +54,16 @@ module.exports = function (opts, callback) { } xhr(opts, function (err, res, body) { if (err) log.error(err); + if (opts.responseType === 'json' && typeof body === 'string') { + // IE doesn't parse responses as JSON without the json attribute, + // even with responseType: 'json'. + // See https://github.com/Raynos/xhr/issues/123 + try { + body = JSON.parse(body); + } catch (e) { + // Not parseable anyway, don't worry about it + } + } // Legacy API responses come as lists, and indicate to redirect the client like // [{success: true, redirect: "/location/to/redirect"}] try { From 2cd8019ef65b07b7d28a2d43f71c42c719843ad8 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Tue, 5 Jul 2016 11:37:12 -0400 Subject: [PATCH 39/49] Add box shadow for focus state on checkboxes Fixes #628 by applying the same outline for focus as is currently applied to checked boxes. --- src/components/forms/checkbox.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/forms/checkbox.scss b/src/components/forms/checkbox.scss index 9d031d157..df8a17237 100644 --- a/src/components/forms/checkbox.scss +++ b/src/components/forms/checkbox.scss @@ -20,12 +20,12 @@ &:checked, &:focus { + transition: all .5s ease; outline: none; + box-shadow: 0 0 0 .25rem $active-gray; } &:checked { - transition: all .5s ease; - box-shadow: 0 0 0 .25rem $active-gray; background-color: $ui-blue; text-align: center; text-indent: .125rem; From b15b5b8614899e3e63a87bd70ff971fa8a85bb87 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 5 Jul 2016 12:03:27 -0400 Subject: [PATCH 40/49] Add style to general error messages Resolves #647 --- src/components/forms/general-error.jsx | 4 +++- src/components/forms/general-error.scss | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/components/forms/general-error.scss diff --git a/src/components/forms/general-error.jsx b/src/components/forms/general-error.jsx index bca50e20d..d9e20463b 100644 --- a/src/components/forms/general-error.jsx +++ b/src/components/forms/general-error.jsx @@ -1,6 +1,8 @@ var Formsy = require('formsy-react'); var React = require('react'); +require('./general-error.scss'); + /* * A special formsy-react component that only outputs * error messages. If you want to display errors that @@ -12,7 +14,7 @@ module.exports = Formsy.HOC(React.createClass({ render: function () { if (!this.props.showError()) return null; return ( -

    +

    {this.props.getErrorMessage()}

    ); diff --git a/src/components/forms/general-error.scss b/src/components/forms/general-error.scss new file mode 100644 index 000000000..c5da01c49 --- /dev/null +++ b/src/components/forms/general-error.scss @@ -0,0 +1,9 @@ +@import "../../colors"; + +.general-error { + border: 1px solid $active-gray; + border-radius: 4px; + background-color: $ui-orange; + padding: 1rem; + color: $type-white; +} From d990dee7553828f1a2161c64f7ef914f7aa6463d Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 5 Jul 2016 12:05:54 -0400 Subject: [PATCH 41/49] Move location of the general error message From review of the style with @carljbowman Requires a bit of magic, where the Form component manually adds the "all" value. But without a major overhaul of the validation system, I don't see how else to put the general error among the other fields. --- src/components/forms/form.jsx | 10 +++++++--- src/components/registration/steps.jsx | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/forms/form.jsx b/src/components/forms/form.jsx index d93495337..b0bfd8dfd 100644 --- a/src/components/forms/form.jsx +++ b/src/components/forms/form.jsx @@ -2,7 +2,6 @@ var classNames = require('classnames'); var Formsy = require('formsy-react'); var omit = require('lodash.omit'); var React = require('react'); -var GeneralError = require('./general-error.jsx'); var validations = require('./validations.jsx').validations; for (var validation in validations) { @@ -32,8 +31,13 @@ var Form = React.createClass({ ); return ( - - {this.props.children} + {React.Children.map(this.props.children, function (child) { + if (child.props.name === 'all') { + return React.cloneElement(child, {value: this.state.allValues}); + } else { + return child; + } + }.bind(this))} ); } diff --git a/src/components/registration/steps.jsx b/src/components/registration/steps.jsx index 2a3ff8645..c76548a7a 100644 --- a/src/components/registration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -12,6 +12,7 @@ var CharCount = require('../../components/forms/charcount.jsx'); var Checkbox = require('../../components/forms/checkbox.jsx'); var CheckboxGroup = require('../../components/forms/checkbox-group.jsx'); var Form = require('../../components/forms/form.jsx'); +var GeneralError = require('../../components/forms/general-error.jsx'); var Input = require('../../components/forms/input.jsx'); var PhoneInput = require('../../components/forms/phone-input.jsx'); var RadioGroup = require('../../components/forms/radio-group.jsx'); @@ -148,6 +149,7 @@ module.exports = { onChange={this.onChangeShowPassword} help={null} name="showPassword" /> + } /> @@ -508,6 +510,7 @@ module.exports = { type="text" name="address.zip" required /> + } /> @@ -631,6 +634,7 @@ module.exports = { equalsField: formatMessage({id: 'general.validationEmailMatch'}) }} required /> + } /> From aa3cbe552ae7438ed909adaaef08e9c348160cac Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Tue, 5 Jul 2016 13:36:51 -0400 Subject: [PATCH 42/49] Make category options into key/value so that we can store the query string with the tab name, since it's not the same in every instance. fixes #666, and makes a couple other style tweaks. --- src/views/explore/explore.jsx | 64 +++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/views/explore/explore.jsx b/src/views/explore/explore.jsx index 0b1cd7d69..7485a4243 100644 --- a/src/views/explore/explore.jsx +++ b/src/views/explore/explore.jsx @@ -1,3 +1,4 @@ +var classNames = require('classnames'); var injectIntl = require('react-intl').injectIntl; var FormattedMessage = require('react-intl').FormattedMessage; var React = require('react'); @@ -17,7 +18,14 @@ require('./explore.scss'); var Explore = injectIntl(React.createClass({ type: 'Explore', getDefaultProps: function () { - var categoryOptions = ['all','animations','art','games','music','stories']; + var categoryOptions = { + all: '*', + animations: 'animations', + art: 'art', + games: 'games', + music: 'music', + stories: 'stories' + }; var typeOptions = ['projects','studios']; var pathname = window.location.pathname.toLowerCase(); @@ -28,7 +36,7 @@ var Explore = injectIntl(React.createClass({ var currentCategory = pathname.substring(slash + 1,pathname.length); var typeStart = pathname.indexOf('explore/'); var type = pathname.substring(typeStart + 8,slash); - if (categoryOptions.indexOf(currentCategory) === -1 || typeOptions.indexOf(type) === -1) { + if (Object.keys(categoryOptions).indexOf(currentCategory) === -1 || typeOptions.indexOf(type) === -1) { window.location = window.location.origin + '/explore/projects/all/'; } @@ -50,10 +58,8 @@ var Explore = injectIntl(React.createClass({ this.getExploreMore(); }, getExploreMore: function () { - var qText = ''; - if (this.props.tab != 'all') { - qText = '&q=' + this.props.category; - } + var qText = '&q=' + this.props.acceptableTabs[this.props.category] || '*'; + api({ uri: '/search/' + this.props.itemType + '?limit=' + this.props.loadNumber + @@ -80,34 +86,28 @@ var Explore = injectIntl(React.createClass({ window.location = window.location.origin + '/explore/' + newType + '/' + this.props.tab; }, getBubble: function (type) { - var allBubble =
    -
  • - -
  • - ; - if (this.props.category === type) { - allBubble = -
  • - -
  • -
    ; - } - return allBubble; + let classes = classNames({ + active: (this.props.category === type) + }); + return ( + +
  • + +
  • +
    + ); }, getTab: function (type) { - var allTab = -
  • - -
  • -
    ; - if (this.props.itemType === type) { - allTab = -
  • - -
  • -
    ; - } - return allTab; + let classes = classNames({ + active: (this.props.itemType === type) + }); + return ( + +
  • + +
  • +
    + ); }, render: function () { return ( From 9a037fda818c415097df26e9b6eed4f9c5078924 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Tue, 5 Jul 2016 14:21:40 -0400 Subject: [PATCH 43/49] don't use `let` yet for variable definitions Fixes #670 --- src/views/explore/explore.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/explore/explore.jsx b/src/views/explore/explore.jsx index 7485a4243..e51dd4a0a 100644 --- a/src/views/explore/explore.jsx +++ b/src/views/explore/explore.jsx @@ -86,7 +86,7 @@ var Explore = injectIntl(React.createClass({ window.location = window.location.origin + '/explore/' + newType + '/' + this.props.tab; }, getBubble: function (type) { - let classes = classNames({ + var classes = classNames({ active: (this.props.category === type) }); return ( @@ -98,7 +98,7 @@ var Explore = injectIntl(React.createClass({ ); }, getTab: function (type) { - let classes = classNames({ + var classes = classNames({ active: (this.props.itemType === type) }); return ( From edf0c1e475b077d4987f4404ddc5001ca2d4da2d Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 5 Jul 2016 14:39:08 -0400 Subject: [PATCH 44/49] Disable default style for select elements in IE Fixes #669 --- src/components/forms/select.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/forms/select.scss b/src/components/forms/select.scss index d001cab27..e85704973 100644 --- a/src/components/forms/select.scss +++ b/src/components/forms/select.scss @@ -19,6 +19,10 @@ font-size: .875rem; appearance: none; + &::-ms-expand { + display: none; + } + &:focus { transition: all .5s ease; outline: none; From b7c46f483e76ca3f2fb0d7209011e81d3ddd027b Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 5 Jul 2016 15:48:21 -0400 Subject: [PATCH 45/49] Don't error on null children Was throwing a `TypeError` when child was null/undefined. --- src/components/forms/form.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/forms/form.jsx b/src/components/forms/form.jsx index b0bfd8dfd..17ada223a 100644 --- a/src/components/forms/form.jsx +++ b/src/components/forms/form.jsx @@ -32,6 +32,7 @@ var Form = React.createClass({ return ( {React.Children.map(this.props.children, function (child) { + if (!child) return child; if (child.props.name === 'all') { return React.cloneElement(child, {value: this.state.allValues}); } else { From 66c3a02340b57a91d4cf2966218edb483d6de500 Mon Sep 17 00:00:00 2001 From: Technoboy10 Date: Wed, 6 Jul 2016 12:27:42 -0400 Subject: [PATCH 46/49] default cursor on coming soon, make cards into links --- src/views/teachers/landing/landing.jsx | 32 ++++++++++++------------- src/views/teachers/landing/landing.scss | 9 +++++++ 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/views/teachers/landing/landing.jsx b/src/views/teachers/landing/landing.jsx index 6ac2cda44..a2957a7b9 100644 --- a/src/views/teachers/landing/landing.jsx +++ b/src/views/teachers/landing/landing.jsx @@ -63,36 +63,36 @@ var Landing = injectIntl(React.createClass({

    -
    - ingrid's story - -
    - -
    + + plug in studio's story
    - Plug-In Studios +

    Plug-In Studios

    -
    -
    + + ghana code club's story
    - Ghana Code Club +

    Ghana Code Club

    -
    +
    diff --git a/src/views/teachers/landing/landing.scss b/src/views/teachers/landing/landing.scss index 9b2838a12..bae13322f 100644 --- a/src/views/teachers/landing/landing.scss +++ b/src/views/teachers/landing/landing.scss @@ -159,6 +159,14 @@ $story-width: $cols3; padding-top: 10px; padding-left: 10px; + .name { + margin: 0; + line-height: initial; + color: $ui-blue; + font-size: initial; + font-weight: 500; + } + p { margin: 10px 0; font-size: .75rem; @@ -227,6 +235,7 @@ $story-width: $cols3; border-radius: 50px; box-shadow: none; background-color: transparent; + cursor: default; padding: 16px 16px; width: $cols5 / 2; color: $ui-white; From 717a2319b47d137a8108f1b49384a258ea2aab88 Mon Sep 17 00:00:00 2001 From: Technoboy10 Date: Wed, 6 Jul 2016 14:16:08 -0400 Subject: [PATCH 47/49] remove button, use div instead --- src/views/teachers/landing/landing.jsx | 3 +-- src/views/teachers/landing/landing.scss | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/teachers/landing/landing.jsx b/src/views/teachers/landing/landing.jsx index a2957a7b9..e61973412 100644 --- a/src/views/teachers/landing/landing.jsx +++ b/src/views/teachers/landing/landing.jsx @@ -9,7 +9,6 @@ var Page = require('../../../components/page/www/page.jsx'); var FlexRow = require('../../../components/flex-row/flex-row.jsx'); var SubNavigation = require('../../../components/subnavigation/subnavigation.jsx'); var TitleBanner = require('../../../components/title-banner/title-banner.jsx'); -var Button = require('../../../components/forms/button.jsx'); require('./landing.scss'); @@ -142,7 +141,7 @@ var Landing = injectIntl(React.createClass({

    - +
    teacher account
    diff --git a/src/views/teachers/landing/landing.scss b/src/views/teachers/landing/landing.scss index bae13322f..5f43f11e2 100644 --- a/src/views/teachers/landing/landing.scss +++ b/src/views/teachers/landing/landing.scss @@ -230,17 +230,18 @@ $story-width: $cols3; margin-bottom: 3.5rem; } - button { + .coming-soon { border: 2px solid $ui-white; border-radius: 50px; box-shadow: none; background-color: transparent; - cursor: default; 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; From 7f466aacc67854bb402dd834fe1d292271a6f294 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 7 Jul 2016 08:38:10 -0400 Subject: [PATCH 48/49] Add language to search / explore api requests Fixes #686, thanks @thisandagain ! --- src/views/explore/explore.jsx | 1 + src/views/search/search.jsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/views/explore/explore.jsx b/src/views/explore/explore.jsx index e51dd4a0a..6fb119741 100644 --- a/src/views/explore/explore.jsx +++ b/src/views/explore/explore.jsx @@ -64,6 +64,7 @@ var Explore = injectIntl(React.createClass({ uri: '/search/' + this.props.itemType + '?limit=' + this.props.loadNumber + '&offset=' + this.state.offset + + '&language=' + this.props.intl.locale + qText }, function (err, body) { if (!err) { diff --git a/src/views/search/search.jsx b/src/views/search/search.jsx index ecd6cff29..58883db54 100644 --- a/src/views/search/search.jsx +++ b/src/views/search/search.jsx @@ -61,6 +61,7 @@ var Search = injectIntl(React.createClass({ uri: '/search/' + this.props.tab + '?limit=' + this.props.loadNumber + '&offset=' + this.state.offset + + '&language=' + this.props.intl.locale + termText }, function (err, body) { var loadedSoFar = this.state.loaded; From 075f1481a28763573e2de5386a9950211848f7e9 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 7 Jul 2016 16:56:51 -0400 Subject: [PATCH 49/49] Add custom validation for organization and phone It appears that the `required` field is not applied in the way we'd like it to be for the custom checkbox group and custom phone input fields, so do a `required` check on form submission. Additionally, this adds in a few style fixes. Fixes #695, #694, #693, #691 --- src/components/registration/steps.jsx | 20 +++++++++++++++++-- src/views/teacherregistration/l10n.json | 4 +++- .../teacherregistration.scss | 20 ++++++++++++++++--- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/components/registration/steps.jsx b/src/components/registration/steps.jsx index c76548a7a..7db166575 100644 --- a/src/components/registration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -286,6 +286,14 @@ module.exports = { waiting: false }; }, + onValidSubmit: function (formData, reset, invalidate) { + if (formData.phone.national_number.length !== formData.phone.country_code.format.length) { + return invalidate({ + 'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationPhoneNumber'}) + }); + } + return this.props.onNextStep(formData); + }, render: function () { var formatMessage = this.props.intl.formatMessage; return ( @@ -299,7 +307,7 @@ module.exports = { tipContent={formatMessage({id: 'teacherRegistration.nameStepTooltip'})} />

    -
    +

    - +