diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index d2cfe93c..e7550cf9 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -138,12 +138,12 @@ class UserController < ApplicationController if current_user.theme.save flash[:success] = 'Theme saved.' else - flash[:error] = 'Theme saving failed.' + flash[:error] = 'Theme saving failed. ' + current_user.theme.errors.messages.values.flatten.join ' ' end elsif current_user.theme.update_attributes(update_attributes) flash[:success] = 'Theme saved.' else - flash[:error] = 'Theme saving failed.' + flash[:error] = 'Theme saving failed. ' + current_user.theme.errors.messages.values.flatten.join ' ' end redirect_to edit_user_theme_path end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index fdcb44db..b117453c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -12,11 +12,10 @@ %title= yield(:title) = javascript_include_tag 'i18n', 'data-turbolinks-track' => true = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true - - if @user.present? and @user.theme.present? and (if user_signed_in? then current_user.show_foreign_themes? else true end) - %link{rel: 'stylesheet', href: @user.theme.css.url, media: :all, 'data-turbolinks-track' => true} - - elsif user_signed_in? and current_user.theme.present? + - if user_signed_in? and not current_user.theme.nil? %link{rel: 'stylesheet', href: current_user.theme.css.url, media: :all, 'data-turbolinks-track' => true} - - else + - if (not @user.nil?) and (not @user.theme.nil?) and (if user_signed_in? then current_user.show_foreign_themes? else true end) + %link{rel: 'stylesheet', href: @user.theme.css.url, media: :all, 'data-turbolinks-track' => true} = javascript_include_tag 'application', 'data-turbolinks-track' => true - if user_signed_in? - if current_user.mod?