-
Notifications
You must be signed in to change notification settings - Fork 479
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
Courses: update UI for course catalog & hoc options #16316
Changes from all commits
3227678
4fbc7dc
99c0e0e
dec85c2
3bbb24d
4899bf4
bc03e7d
7d323ce
0153c2a
810d041
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,79 @@ | ||
import $ from 'jquery'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import ResourceCard from './ResourceCard'; | ||
import ContentContainer from '../ContentContainer'; | ||
import i18n from "@cdo/locale"; | ||
import ProtectedStatefulDiv from '../ProtectedStatefulDiv'; | ||
|
||
const styles = { | ||
horizontalSpacer: { | ||
width: 20, | ||
height: 1, | ||
float: 'left' | ||
} | ||
}; | ||
|
||
const TeacherAssignablesCatalog = React.createClass({ | ||
propTypes: { | ||
codeOrgUrlPrefix: React.PropTypes.string.isRequired, | ||
isRtl: React.PropTypes.bool.isRequired | ||
}, | ||
|
||
componentDidMount() { | ||
// The components used here are implemented in legacy HAML/CSS rather than React. | ||
$('.hour-of-code-courses').appendTo(ReactDOM.findDOMNode(this.refs.hocCourses)).show(); | ||
}, | ||
|
||
render() { | ||
const { codeOrgUrlPrefix, isRtl } = this.props; | ||
|
||
return ( | ||
<ContentContainer heading={i18n.teacherCoursesHeading()} isRtl={false}> | ||
<ResourceCard | ||
title={i18n.teacherCourseHoc()} | ||
description={i18n.teacherCourseHocDescription()} | ||
image="hourofcode" | ||
buttonText={i18n.learnMore()} | ||
link={`${codeOrgUrlPrefix}/hourofcode/overview`} | ||
<div> | ||
<ContentContainer | ||
heading={i18n.teacherCoursesHeading()} | ||
description={i18n.teacherCoursesDescription()} | ||
isRtl={isRtl} | ||
/> | ||
<ResourceCard | ||
title={i18n.teacherCourseElementary()} | ||
description={i18n.teacherCourseElementaryDescription()} | ||
image="elementary" | ||
buttonText={i18n.learnMore()} | ||
link={`${codeOrgUrlPrefix}/educate/curriculum/elementary-school`} | ||
isRtl={isRtl} | ||
/> | ||
<ResourceCard | ||
title={i18n.teacherCourseMiddle()} | ||
description={i18n.teacherCourseMiddleDescription()} | ||
image="middleschool" | ||
buttonText={i18n.learnMore()} | ||
link={`${codeOrgUrlPrefix}/educate/curriculum/middle-school`} | ||
isRtl={isRtl} | ||
/> | ||
<ResourceCard | ||
title={i18n.teacherCourseHighOlder()} | ||
description={i18n.teacherCourseHighDescription()} | ||
image="highschool" | ||
buttonText={i18n.learnMore()} | ||
link={`${codeOrgUrlPrefix}/educate/curriculum/high-school`} | ||
> | ||
<ResourceCard | ||
isJumbo={true} | ||
title={i18n.teacherCourseElementary()} | ||
description={i18n.teacherCourseElementaryDescription()} | ||
buttonText={i18n.learnMore()} | ||
link={`${codeOrgUrlPrefix}/educate/curriculum/elementary-school`} | ||
isRtl={isRtl} | ||
/> | ||
<div style={styles.horizontalSpacer}/> | ||
<ResourceCard | ||
isJumbo={true} | ||
title={i18n.teacherCourseMiddle()} | ||
description={i18n.teacherCourseMiddleDescription()} | ||
buttonText={i18n.learnMore()} | ||
link={`${codeOrgUrlPrefix}/educate/curriculum/middle-school`} | ||
isRtl={isRtl} | ||
/> | ||
<div style={styles.horizontalSpacer}/> | ||
<ResourceCard | ||
isJumbo={true} | ||
title={i18n.teacherCourseHighOlder()} | ||
description={i18n.teacherCourseHighDescription()} | ||
buttonText={i18n.learnMore()} | ||
link={`${codeOrgUrlPrefix}/educate/curriculum/high-school`} | ||
isRtl={isRtl} | ||
/> | ||
</ContentContainer> | ||
|
||
<ContentContainer | ||
heading={i18n.teacherCourseHoc()} | ||
description={i18n.teacherCourseHocDescription()} | ||
isRtl={isRtl} | ||
/> | ||
</ContentContainer> | ||
linkText={i18n.teacherCourseHocLinkText()} | ||
link={`${codeOrgUrlPrefix}/hourofcode/overview`} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I'm reading this right but wanted to confirm teachers go to code.org/hourofcode/overview but students go to code.org/learn? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Signed-in student in English gets /learn. |
||
showLink={true} | ||
> | ||
<ProtectedStatefulDiv ref="hocCourses"/> | ||
</ContentContainer> | ||
</div> | ||
); | ||
} | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we link Hour of Code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bjvanminnen I tried once and failed.. do we have a good way to embed links in apps strings, wrapping the link around some text that's in the string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a good way to do it inside of translated strings. The approach I usually aim for is to have a link following the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tanyaparker Can we rewrite the content to make that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe append "Visit HourOfCode.com to learn more." at the end where the whole thing is hyperlinked? Is that what you mean?