Skip to content

Commit

Permalink
Merge pull request #40173 from code-dot-org/revert-right-to-left-changes
Browse files Browse the repository at this point in the history
Revert "revert navbar fix"
  • Loading branch information
daynew committed Apr 20, 2021
2 parents d4cada5 + 0f7af57 commit ee18ff7
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 53 deletions.
1 change: 0 additions & 1 deletion dashboard/app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ img.video_thumbnail {
.create_button, .display_name, .pairing_name {
html[dir=rtl] & {
float: right;
padding-left: 3px;
}
}

Expand Down
1 change: 0 additions & 1 deletion dashboard/app/views/layouts/_header.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
:ruby
require 'cdo/language_dir'

script = local_assigns[:script] || Script.twenty_hour_script
script_level = local_assigns[:script_level]
Expand Down
8 changes: 0 additions & 8 deletions lib/cdo/language_dir.rb

This file was deleted.

10 changes: 9 additions & 1 deletion pegasus/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require_relative '../shared/middleware/helpers/storage_id'
require 'cdo/asset_helper'
require 'cdo/cookie_helpers'
require 'cdo/language_dir'

def avatar_image(name, width=320, square_photo=false)
basename = name.downcase.gsub(/\W/, '_').gsub(/_+/, '_')
Expand Down Expand Up @@ -102,6 +101,15 @@ def csrf_tag
Rack::Csrf.csrf_tag(env)
end

def language_dir_class(locale=request.locale)
# This list of RTL languages matches those in dashboard/config/locales.yml
if ["ar-SA", "fa-IR", "he-IL", "ur-PK"].include? locale
"rtl"
else
"ltr"
end
end

def curriculum_url(resource)
CDO.curriculum_url(request.locale, resource)
end
Expand Down
19 changes: 5 additions & 14 deletions shared/css/hamburger.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
padding-bottom: 10px;
.item {

html[dir=rtl] & {
margin-left: 0px;
margin-right: 25px;
}

color: $white;
line-height: 20px;
Expand Down Expand Up @@ -103,9 +107,6 @@
font-family: $gotham-regular;
color: $white;
text-decoration: none;
html[dir=rtl], .rtl & {
float:right;
}
}

#about-more {
Expand Down Expand Up @@ -159,27 +160,17 @@
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
html[dir=rtl], .rtl & {
float: right;
}
}
.arrow-down {
font-size: 30px;
float: right;
margin-top: -7px;
html[dir=rtl], .rtl & {
float: left;
}

margin-top: -7px
}
.arrow-up {
font-size: 30px;
float: right;
margin-top: -7px;
display: none;
html[dir=rtl], .rtl & {
float: left;
}
}
}

Expand Down
35 changes: 10 additions & 25 deletions shared/css/user-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,16 @@
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
.rtl & {
float: right;
padding-left: 3px;
}
}

.user_menu_arrow_down,
.user_menu_arrow_up,
.create_menu_arrow_down,
.create_menu_arrow_up {
.create_menu_arrow_up, {
font-size: 25px;
margin-top: -3px;
.rtl & {
float: left;
}
html[dir='rtl'] & {
float: left;

}
}

.user_options, .create_options, .help_contents {
position: absolute;
top: 55px;
Expand Down Expand Up @@ -63,9 +53,7 @@
text-align: left;
white-space: nowrap;
padding: 0;
&[dir = 'rtl'] a {
text-align: right;
}

.display_name {
font-family: $gotham-bold;
background-color: $charcoal;
Expand Down Expand Up @@ -124,9 +112,7 @@
white-space: nowrap;
padding: 0;
right: 0px;
&[dir = 'rtl'] a {
text-align: right;
}

a {
display: block;
padding: 10px;
Expand All @@ -145,7 +131,7 @@
.hide-mobile {
display: none;
}
}
}
}

.create_menu {
Expand All @@ -168,12 +154,11 @@
}
.project_link_box {
display: block;

.project_link {
display: inline-block;
padding: 0 10px 0 4px;
line-height: 67px;
}
}
.project_link {
display: inline-block;
padding: 0 10px 0 4px;
line-height: 67px;
}
#view_all_projects {
height: 70px;
Expand Down
2 changes: 1 addition & 1 deletion shared/haml/help_button.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
help_items = HelpHeader.get_help_contents(options)

.help_button{class: "hide-mobile", id: "help-button", tabindex: "0", 'aria-label': I18n.t('header_screen_reader_help')}
.help_contents{style: 'display: none', id: "help-contents", dir: language_dir_class}
.help_contents{style: 'display: none', id: "help-contents"}
- help_items.each do |entry|
%a.linktag{id: entry[:id], href: entry[:url], target: entry[:target], rel: entry[:rel]}=entry[:title]
Expand Down
4 changes: 2 additions & 2 deletions shared/haml/user_header.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
 
%i.create_menu_arrow_down{class: "fa fa-caret-down"}
%i.create_menu_arrow_up{class: "fa fa-caret-up", style: "display: none"}
.create_options{style: 'display: none', dir: language_dir_class}
.create_options{style: 'display: none'}
- create_drop_down_items.each do |entry|
%a.project_link_box{href: entry[:url]}
%img{src: "/shared/images/fill-70x70/courses/#{entry[:image]}"}
Expand All @@ -44,7 +44,7 @@
 
%i.user_menu_arrow_down{class: "fa fa-caret-down"}
%i.user_menu_arrow_up{class: "fa fa-caret-up", style: "display: none"}
.user_options{style: 'display: none', dir: language_dir_class}
.user_options{style: 'display: none'}
%a.linktag#my-projects{href: CDO.studio_url('projects')}= I18n.t("#{loc_prefix}my_projects")
- if current_user.can_pair?
- if session_pairings.present?
Expand Down

0 comments on commit ee18ff7

Please sign in to comment.