From 21153d137c8b6adb78a88bd3dea86860e8e8e1be Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 17 Jun 2014 12:21:35 -0300 Subject: [PATCH] rails3: fix change image from profile --- app/models/person.rb | 2 +- app/views/shared/_change_image.html.erb | 5 +---- app/views/shared/_show_thumbnail.html.erb | 15 ++++++++++----- plugins/require_auth_to_comment/lib/ext/profile.rb | 1 + 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index dd33c4d..bc5ec7d 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -1,7 +1,7 @@ # A person is the profile of an user holding all relationships with the rest of the system class Person < Profile - attr_accessible :organization, :contact_information, :sex, :birth_date + attr_accessible :organization, :contact_information, :sex, :birth_date, :professional_activity SEARCH_FILTERS += %w[ more_popular diff --git a/app/views/shared/_change_image.html.erb b/app/views/shared/_change_image.html.erb index 3298b12..bbe353e 100644 --- a/app/views/shared/_change_image.html.erb +++ b/app/views/shared/_change_image.html.erb @@ -1,5 +1,2 @@ <%= i.file_field( :uploaded_data, { :onchange => 'updateImg(this.value)' } ) %> - <%= link_to_function(_('Cancel'), nil, :id => 'cancel-change-image-link', :class => 'button icon-cancel with-text', :style => 'display: none') do |page| - page['change-image-link'].show - page['change-image'].replace_html '' - end %> + <%= link_to_function(_('Cancel'), "jQuery('#change-image-link').show(); jQuery('#change-image').html('')", :id => 'cancel-change-image-link', :class => 'button icon-cancel with-text', :style => 'display: none') %> diff --git a/app/views/shared/_show_thumbnail.html.erb b/app/views/shared/_show_thumbnail.html.erb index a4f05e6..562eb51 100644 --- a/app/views/shared/_show_thumbnail.html.erb +++ b/app/views/shared/_show_thumbnail.html.erb @@ -2,10 +2,15 @@
- <%= link_to_function(_('Change image'), nil, :id => 'change-image-link', :class => 'button icon-photos with-text') do |page| - page['change-image'].replace_html :partial => 'shared/change_image', :locals => { :i => i, :image => image } - page['change-image-link'].hide - page['cancel-change-image-link'].show - end %> + <%= link_to_function(_('Change image'), 'display_change_image()', :id => 'change-image-link', :class => 'button icon-photos with-text') %> + +

diff --git a/plugins/require_auth_to_comment/lib/ext/profile.rb b/plugins/require_auth_to_comment/lib/ext/profile.rb index 9847e7b..c9871e3 100644 --- a/plugins/require_auth_to_comment/lib/ext/profile.rb +++ b/plugins/require_auth_to_comment/lib/ext/profile.rb @@ -2,4 +2,5 @@ require_dependency 'profile' class Profile settings_items :allow_unauthenticated_comments, :type => :boolean + attr_accessible :allow_unauthenticated_comments end -- libgit2 0.21.2