diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 58097ec..e36543b 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -37,24 +37,20 @@ end end - - -def get_theme - -# if params[:theme]== "default" || params[:theme]=="2003" || params[:theme].nil? -# params[:theme]="blue1" -# end - if ThemesForRails.available_theme_names.include?(params[:theme]) and can? :showintern,Thema - params[:theme] + def get_theme +u=current_user + if ! u.try(:preferredtheme).nil? and ThemesForRails.available_theme_names.include?(u.preferredtheme) + u.preferredtheme else "blue1" end -end + + end def current_ability @current_ability ||= Ability.new(current_user, request) end def default_url_options - {locale: I18n.locale, theme: (theme_name=="blue1") ? nil : theme_name , ansicht: nil} + {locale: I18n.locale, theme: nil , ansicht: nil} end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1bfe832..7a1f425 100755 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -113,4 +113,17 @@ m.save url.path=path return url end + + def get_theme_help(u) + +# if params[:theme]== "default" || params[:theme]=="2003" || params[:theme].nil? +# params[:theme]="blue1" +# end + if ! u.try(:preferredtheme).nil? and ThemesForRails.available_theme_names.include?(u.preferredtheme) + u.preferredtheme + else + "blue1" + end +end + end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8993188..52b01f4 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -28,7 +28,7 @@