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

Dance page: Add links for translated versions of lesson plan and unplugged activity #26193

Merged
merged 6 commits into from Nov 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions pegasus/sites.v3/code.org/views/dance_teacher_resources.haml
@@ -1,20 +1,31 @@
%link{:rel=>'stylesheet', :type=>'text/css', :href=>'/css/dance-landing/dance-teacher-resources.css'}

:ruby
locale = I18n.locale.to_s.downcase
translated_languages = ["es-mx", "es-es", "fr-fr", "ko-ko", "tr-tr", "zh-tw"]
lesson_link = translated_languages.include?(locale) ?
"https://curriculum.code.org/#{locale}/hoc/plugged/8" :
"https://curriculum.code.org/hoc/plugged/8"
unplugged_link = translated_languages.include?(locale) ?
"https://curriculum.code.org/#{locale}/hoc/unplugged/4" :
"https://curriculum.code.org/hoc/unplugged/4"

Copy link
Contributor

@Erin007 Erin007 Nov 21, 2018

Choose a reason for hiding this comment

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

tiny style nits: translated_languages, lessson_link and unplugged_link should align with locale; they're currently indented too far.

resources = [
{
title: I18n.t(:hoc2018_dance_teacher_resources_title),
description: I18n.t(:hoc2018_dance_teacher_resources_tile1_description),
image: "/images/dance-hoc/dance_party_dance.gif",
button_text: I18n.t(:hoc2018_dance_teacher_resources_tile1_button),
link: "https://curriculum.code.org/hoc/plugged/8"
id: "lesson_plan",
link: lesson_link
},
{
title: I18n.t(:hoc2018_dance_teacher_resources_tile2_title),
description: I18n.t(:hoc2018_dance_teacher_resources_tile2_description),
image: "/images/dance-hoc/dance_party_unplugged_portrait.png",
button_text: I18n.t(:hoc2018_dance_teacher_resources_tile2_button),
link: "https://curriculum.code.org/hoc/unplugged/4"
id: "unplugged_activity",
link: unplugged_link
},
]

Expand All @@ -30,5 +41,5 @@
.resource-description
= resource[:description]
%a{href: resource[:link]}
%button.gray-button
%button.gray-button{:id => "#{resource[:id]}"}
Copy link
Contributor

Choose a reason for hiding this comment

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

ids are unnecessary here and in the resources hash, but I guess there's no harm in having them. Do you have an anticipated reason you'll use them later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ids are not necessary. There were added as part of an initial solution to the problem. Thanks!

= resource[:button_text]