[Git][noosfero/noosfero][master] 2 commits: Fix double crop on profile update

Rodrigo Souto gitlab at mg.gitlab.com
Fri Jun 8 11:25:22 BRT 2018


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
d189e9a2 by Iasmin Mendes at 2018-06-08T14:25:15Z
Fix double crop on profile update

- - - - -
015e30d6 by Rodrigo Souto at 2018-06-08T14:25:15Z
Merge branch 'crop-image-adjustments' into 'master'

Fix double crop on profile update

See merge request noosfero/noosfero!1506
- - - - -


4 changed files:

- app/controllers/my_profile/profile_editor_controller.rb
- app/models/control_panel/location.rb
- app/views/profile_editor/informations.html.erb
- app/views/profile_editor/location.html.erb → app/views/profile_editor/locality.html.erb


Changes:

=====================================
app/controllers/my_profile/profile_editor_controller.rb
=====================================
--- a/app/controllers/my_profile/profile_editor_controller.rb
+++ b/app/controllers/my_profile/profile_editor_controller.rb
@@ -8,7 +8,7 @@ class ProfileEditorController < MyProfileController
   before_filter :back_to
   before_filter :forbid_destroy_profile, :only => [:destroy_profile]
   before_filter :check_user_can_edit_header_footer, :only => [:header_footer]
-  before_filter :location_active, :only => [:location]
+  before_filter :location_active, :only => [:locality]
 
   helper_method :has_welcome_page
   helper CustomFieldsHelper
@@ -100,7 +100,7 @@ class ProfileEditorController < MyProfileController
     update_profile_data
   end
 
-  def location
+  def locality
     @profile_data = profile
     if request.post?
       begin


=====================================
app/models/control_panel/location.rb
=====================================
--- a/app/models/control_panel/location.rb
+++ b/app/models/control_panel/location.rb
@@ -21,7 +21,7 @@ class ControlPanel::Location < ControlPanel::Entry
     end
 
     def url(profile)
-      {:controller => 'profile_editor', :action => 'location'}
+      {:controller => 'profile_editor', :action => 'locality'}
     end
 
     def display?(user, profile, context={})


=====================================
app/views/profile_editor/informations.html.erb
=====================================
--- a/app/views/profile_editor/informations.html.erb
+++ b/app/views/profile_editor/informations.html.erb
@@ -14,7 +14,8 @@
     <span><%= unchangeable_privacy_field @profile %></span>
   </div>
   <div id="profile_change_picture">
-    <%= file_field_or_thumbnail(_('Image:'), @profile.image, 'profile_data[image_builder]') %><%= _("Max size: %s (.jpg, .gif, .png)").html_safe % Image.max_size.to_humanreadable %>
+    <%= file_field_or_thumbnail(_('Image:'), @profile.image, 'profile_data[image_builder]', 'profile') %>
+    <%= _("Max size: %s (.jpg, .gif, .png)").html_safe % Image.max_size.to_humanreadable %>
   </div>
 
   <%=


=====================================
app/views/profile_editor/location.html.erb → app/views/profile_editor/locality.html.erb
=====================================
--- a/app/views/profile_editor/location.html.erb
+++ b/app/views/profile_editor/locality.html.erb
@@ -2,7 +2,7 @@
 
 <%= error_messages_for :profile_data %>
 
-<%= labelled_form_for :profile_data, :url => {:action => 'location'}, :html => {:id => 'location-form'} do |f| %>
+<%= labelled_form_for :profile_data, :url => {:action => 'locality'}, :html => {:id => 'location-form'} do |f| %>
   <div class="error">
     <%= flash[:error] %>
   </div>



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/7fe2b5960b5840b15b9a1d02a5a537b7aed8f60f...015e30d6aa6eba416d1c8143c405fb80b9fe22f0

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/7fe2b5960b5840b15b9a1d02a5a537b7aed8f60f...015e30d6aa6eba416d1c8143c405fb80b9fe22f0
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180608/1ce77099/attachment-0001.html>


More information about the Noosfero-dev mailing list