fixed profile headers
This commit is contained in:
parent
0145b36510
commit
91be970cb9
|
@ -25,7 +25,7 @@ class UserController < ApplicationController
|
||||||
|
|
||||||
def update
|
def update
|
||||||
user_attributes = params.require(:user).permit(:display_name, :profile_picture, :profile_header, :motivation_header, :website,
|
user_attributes = params.require(:user).permit(:display_name, :profile_picture, :profile_header, :motivation_header, :website,
|
||||||
:location, :bio, :crop_x, :crop_y, :crop_w, :crop_h)
|
:location, :bio, :crop_x, :crop_y, :crop_w, :crop_h, :crop_h_x, :crop_h_y, :crop_h_w, :crop_h_h)
|
||||||
if current_user.update_attributes(user_attributes)
|
if current_user.update_attributes(user_attributes)
|
||||||
text = 'Your profile has been updated!'
|
text = 'Your profile has been updated!'
|
||||||
text += ' It might take a few minutes until your new profile picture is shown everywhere.' if user_attributes[:profile_picture]
|
text += ' It might take a few minutes until your new profile picture is shown everywhere.' if user_attributes[:profile_picture]
|
||||||
|
|
|
@ -14,7 +14,12 @@ module Paperclip
|
||||||
def crop_command
|
def crop_command
|
||||||
target = @attachment.instance
|
target = @attachment.instance
|
||||||
if target.cropping?
|
if target.cropping?
|
||||||
['-crop', "'#{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i}'"]
|
case @attachment.name
|
||||||
|
when :profile_picture
|
||||||
|
['-crop', "'#{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i}'"]
|
||||||
|
when :profile_header
|
||||||
|
['-crop', "'#{target.crop_h_w.to_i}x#{target.crop_h_h.to_i}+#{target.crop_h_x.to_i}+#{target.crop_h_y.to_i}'"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue