Enable RTL direction in emails.

This commit is contained in:
Eyal Levin
2014-08-06 15:27:15 +03:00
parent 33eca10860
commit f8c99a35d0
5 changed files with 27 additions and 18 deletions

View File

@ -32,7 +32,7 @@ module ApplicationHelper
end
def html_classes
"#{mobile_view? ? 'mobile-view' : 'desktop-view'} #{mobile_device? ? 'mobile-device' : 'not-mobile-device'} #{rtl_view? ? 'rtl' : ''}"
"#{mobile_view? ? 'mobile-view' : 'desktop-view'} #{mobile_device? ? 'mobile-device' : 'not-mobile-device'} #{RTL.html_class}"
end
def escape_unicode(javascript)
@ -124,21 +124,6 @@ module ApplicationHelper
MobileDetection.mobile_device?(request.user_agent)
end
def rtl_view?
site_default_rtl? || current_user_rtl?
end
def current_user_rtl?
SiteSetting.allow_user_locale && current_user.try(:locale).in?(rtl_locales)
end
def site_default_rtl?
!SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(rtl_locales)
end
def rtl_locales
%w(he ar)
end
def customization_disabled?
controller.class.name.split("::").first == "Admin" || session[:disable_customization]