PRODUCTION V DEVELOPMENT, ROUND 3 FIGHT

This commit is contained in:
Yuki 2015-08-26 00:45:08 +05:30
parent bee62c2139
commit 7c68b2a167
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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?