Skip to content

Commit

Permalink
revert navbar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ameer Akashe committed Apr 15, 2021
1 parent d480e50 commit 58a8a56
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 27 deletions.
1 change: 1 addition & 0 deletions dashboard/app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ img.video_thumbnail {
.create_button, .display_name, .pairing_name {
html[dir=rtl] & {
float: right;
padding-left: 3px;
}
}

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

script = local_assigns[:script] || Script.twenty_hour_script
script_level = local_assigns[:script_level]
Expand Down
8 changes: 8 additions & 0 deletions lib/cdo/language_dir.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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
10 changes: 1 addition & 9 deletions pegasus/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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 @@ -101,15 +102,6 @@ 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: 14 additions & 5 deletions shared/css/hamburger.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@
padding-bottom: 10px;
.item {

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

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

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

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

Expand Down
35 changes: 25 additions & 10 deletions shared/css/user-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,26 @@
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 @@ -53,7 +63,9 @@
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 @@ -112,7 +124,9 @@
white-space: nowrap;
padding: 0;
right: 0px;

&[dir = 'rtl'] a {
text-align: right;
}
a {
display: block;
padding: 10px;
Expand All @@ -131,7 +145,7 @@
.hide-mobile {
display: none;
}
}
}
}

.create_menu {
Expand All @@ -154,11 +168,12 @@
}
.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"}
.help_contents{style: 'display: none', id: "help-contents", dir: language_dir_class}
- 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'}
.create_options{style: 'display: none', dir: language_dir_class}
- 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'}
.user_options{style: 'display: none', dir: language_dir_class}
%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 58a8a56

Please sign in to comment.