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

Courses: update UI for course catalog & hoc options #16316

Merged
merged 10 commits into from Jul 13, 2017

Conversation

breville
Copy link
Member

@breville breville commented Jul 10, 2017

signed-in teacher, english

_teacher english

signed-in student, english

courses student en

signed out, english

_signedout english

signed-in teacher, non-english

_teacher spanish

signed-in student, non-english

courses student nonen

signed out, non-english

_signedout spanish

@breville breville requested a review from Erin007 July 10, 2017 03:41
@breville
Copy link
Member Author

cc @tanyaparker

@tanyaparker
Copy link
Contributor

Erin is out so can you assign another dev to review?

Is the Local Classes box localized? Ideally I want this to only show for US users (whether they are in English or non-EN). It's ok if it shows up for non-EN now as long as it's US only AND it's localized. Otherwise, if we can't target by country OR if it's not localized, I would rather hide it completely for all non-EN.

Also, is the Hour of Code widget localized? I don't want to switch it out just yet, but in some time (after we get some translations) we can replace the 8 block version with the 4 block version so we have fewer versions/more consistency.

Copy link
Contributor

@tanyaparker tanyaparker left a comment

Choose a reason for hiding this comment

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

I'll let another dev review the React code but the screenshots lgtm. Just left one comment for non-EN experience.

@@ -56,7 +56,7 @@
- unless course[:starts] == 0
%div{class: "bar-#{course[:starts]}"}
 
%div{class: "courserow bar-#{course[:ends] - course[:starts] + 1}", style: "background-color: #{"#1AC7D6" || course[:color] || '#00adbc'}"}
%div{class: "courserow bar-#{course[:ends] - course[:starts] + 1}", style: "background-color: #{"#00adbc"}"}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like sticking to our color palette a lot better. 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

presumably we don't need the #{} portion now that there's no ruby in there (just a string)

@@ -492,13 +492,15 @@
"teacherCommunity": "Teacher Community",
"teacherCommunityDescription": "Ask questions about curriculum, share ideas from your lessons, and get help from other teachers",
"teacherCourseHoc": "Hour of Code",
"teacherCourseHocDescription": "Celebrated in December, but available year-round, the Hour of Code makes computer science fun and accessible to all ages.",
"teacherCourseHocDescription": "If you don’t have time for a full length course, try a one-hour tutorial designed for all ages. Join millions of students and teachers in over 180 countries by starting with an Hour of Code.",
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

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?

/>
</ContentContainer>
linkText={i18n.teacherCourseHocLinkText()}
link={`${codeOrgUrlPrefix}/hourofcode/overview`}
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Signed-in student in English gets /learn.
Signed-in teacher in English gets /hourofcode/overview.

{/* Anything but a teacher or student in English.
That is: signed-out, or a student or teacher in non-English. */}
{(isSignedOut || !isEnglish) && (
<div id="all-courses">
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this div need an id? I don't see it used anywhere (we do look for a class by this name in componentDidMount)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I just added this to make my own visual inspection of the DOM a bit easier. I can take it back out again if not a good practice.

Copy link
Contributor

Choose a reason for hiding this comment

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

When I'm reading JSX and I see an id, my first thought is "that means there are side effects somewhere else that I need to track down" (either CSS, or jquery doing something). To some extent it's conceptually similar to adding a global variable (although arguably not quite egregious). As such, I prefer avoiding them unless absolutely necessary.

@breville
Copy link
Member Author

@tanyaparker:

Local Classes box is localised. I'm waiting to hear back from infrastructure folks about perf impact of calling Geocoder on every page, so in the meantime I'll just make it EN only for now.

The Hour of Code content is also localised. The boxes themselves are the legacy HAML.

@breville breville merged commit c00269c into staging Jul 13, 2017
@breville breville deleted the update-teacher-courses branch July 13, 2017 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants