From e7d48a16ee60bd6535341c3123b64c5afc1c3b0b Mon Sep 17 00:00:00 2001 From: MrZYX Date: Tue, 5 Apr 2011 19:33:51 +0200 Subject: [PATCH] moved + to the left for rtl languages --- app/helpers/application_helper.rb | 4 ++++ app/views/layouts/_header.html.haml | 9 +++++++-- app/views/layouts/application.html.haml | 2 +- app/views/layouts/application.mobile.haml | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 18f7298a4..6a21e6d6a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -284,4 +284,8 @@ module ApplicationHelper def direction_for(string) return (string.cleaned_is_rtl?) ? 'rtl' : '' end + + def rtl? + @rtl ||= RTL_LANGUAGES.include? I18n.locale + end end diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index aba33c3de..ddffd8832 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -45,6 +45,10 @@ -unless @landing_page %ul#aspect_nav + - if rtl? + %li + = link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect'), :rel => 'facebox' + %li{:class => ('selected' if @aspect == :all)} = link_to t('all_aspects'), aspects_path, :class => 'home_selector' @@ -52,8 +56,9 @@ %li{:data=>{:guid=>aspect.id}, :class => ("selected" if @object_aspect_ids.include?(aspect.id))} = link_for_aspect(aspect, :class => 'aspect_selector name', :title => t('contacts', :count => aspect.contacts.size)) - %li - = link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect'), :rel => 'facebox' + - unless rtl? + %li + = link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect'), :rel => 'facebox' .facebox_content #add_aspect_pane diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index a73371500..0c9752da6 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -22,7 +22,7 @@ = stylesheet_link_tag "blueprint/screen", :media => 'screen' = stylesheet_link_tag "blueprint/print", :media => 'print' = include_stylesheets :default, :media => 'all' - - if RTL_LANGUAGES.include? I18n.locale + - if rtl? = include_stylesheets :rtl, :media => 'all'