From 856b590e1be1c2c534be9d80c436c7bbdda1d9af Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 11 Sep 2014 18:18:34 +0800 Subject: [PATCH] fixed delete and update user issue and also the language switch --- app/assets/stylesheets/basic/icon.css.erb | 12 ------------ app/controllers/admin/sites_controller.rb | 8 ++++++-- app/models/user.rb | 2 +- app/views/orbit_bar/index.html.erb | 2 +- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/app/assets/stylesheets/basic/icon.css.erb b/app/assets/stylesheets/basic/icon.css.erb index d825825..e433b58 100644 --- a/app/assets/stylesheets/basic/icon.css.erb +++ b/app/assets/stylesheets/basic/icon.css.erb @@ -18,17 +18,14 @@ /* Font Awesome styles ------------------------------------------------------- */ /* includes sprites.less reset */ -.ui-icon, [class^="icon-"], [class*=" icon-"] { font-family: 'FontAwesome'; } -.ui-icon, [class^="icons-"], [class*=" icons-"] { font-family: 'entypo'; } -.ui-icon, [class^="icon"], [class*=" icon"] { font-weight: normal; @@ -46,7 +43,6 @@ } -.ui-icon, [class^="icon"]:before, [class*=" icon"]:before { text-decoration: inherit; @@ -54,7 +50,6 @@ speak: none; } /* makes sure icons active on rollover in links */ -a .ui-icon, a [class^="icon"], a [class*=" icon"] { display: inline-block; @@ -64,8 +59,6 @@ a [class*=" icon"] { vertical-align: -10%; font-size: 1.3333333333333333em; } -.btn .ui-icon -.nav .ui-icon, .btn [class^="icon"], .nav [class^="icon"], .btn [class*=" icon"], @@ -74,22 +67,18 @@ a [class*=" icon"] { /* keeps button heights with and without icons the same */ line-height: .6em; } -.btn .ui-icon.icon-spin, -.nav .ui-icon.icon-spin, .btn [class^="icon"].icon-spin, .nav [class^="icon"].icon-spin, .btn [class*=" icon"].icon-spin, .nav [class*=" icon"].icon-spin { display: inline-block; } -li .ui-icon, li [class^="icon"], li [class*=" icon"] { display: inline-block; width: 1.25em; text-align: center; } -li .ui-icon.icon-large, li [class^="icon"].icon-large, li [class*=" icon"].icon-large { /* increased font size for icon-large */ @@ -100,7 +89,6 @@ ul.icons { list-style-type: none; text-indent: -0.75em; } -ul.icons li .ui-icon, ul.icons li [class^="icon"], ul.icons li [class*=" icon"] { width: .75em; diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 0050569..06559c9 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -69,8 +69,12 @@ class Admin::SitesController < OrbitAdminController elsif params[:site][:enable_language_detection].eql?("1") Site.update_all({:default_locale => nil}) end - - redirect_to :back + if !@site.in_use_locales.include?I18n.locale + I18n.locale = @site.in_use_locales.first + redirect_to admin_site_preference_path(current_site) + else + redirect_to :back + end end def update_manager diff --git a/app/models/user.rb b/app/models/user.rb index 5da338c..56019f4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -21,7 +21,7 @@ class User has_many :authorizations belongs_to :member_profile has_one :facebook, :autosave => true, :dependent => :destroy - has_one :desktop, :autosave => true, :dependent => :destroy + has_one :desktop, :dependent => :destroy validates :user_name, presence: true, uniqueness: true diff --git a/app/views/orbit_bar/index.html.erb b/app/views/orbit_bar/index.html.erb index 1f733df..a54d8b8 100644 --- a/app/views/orbit_bar/index.html.erb +++ b/app/views/orbit_bar/index.html.erb @@ -87,7 +87,7 @@ <% locale = session[:zh_cn] ? :zh_cn : I18n.locale %> <%= t((locale==:zh_tw ? :zh_tw_ : locale.to_s)) %>