Comment 4 for bug 1069808

Revision history for this message
Chris Luke (chrisy) wrote :

This patch seems to fix the plugin for rm 2.1.x. Fixes the naming of the two templates, and makes my/avatar a full page rather than a partial (there was no parent page for it to be a partial of):

=== renamed file 'app/views/hooks/redmine_local_avatars/_view_my_account_contextual.erb.html' => 'app/views/hooks/redmine_local_avatars/_view_my_account_contextual.html.erb'
=== added directory 'app/views/my'
=== renamed file 'app/views/users/_avatar.erb.html' => 'app/views/my/avatar.html.erb'
--- app/views/users/_avatar.erb.html 2012-08-13 15:03:33 +0000
+++ app/views/my/avatar.html.erb 2012-10-24 19:09:00 +0000
@@ -1,11 +1,17 @@
 <div class="box">
-<h3><%= l(:label_avatar)%></h3>
+
+<h2><%= l(:label_avatar)%></h2>
+
 <div style="width: 128px; height: 128px; border: 1px silver solid;">
 <%= avatar(@user, :size => "128") %>
 </div><br>
-<%= form_tag( { :action => 'save_avatar', :id => @user }, :multipart => true) do %>
+
+<%= form_tag( { :action => 'save_avatar', :id => @user.id }, :multipart => true) do %>
     <%= file_field_tag "avatar" %><br />
     <%= submit_tag l(:button_save) %>
   <%= submit_tag l(:button_delete), :confirm => l(:are_you_sure_delete_avatar) %>
 <% end %>
+
 </div>
+
+<% html_title(l(:label_avatar)) -%>

=== removed directory 'app/views/users'
=== modified file 'lib/my_controller_patch.rb'
--- lib/my_controller_patch.rb 2010-12-26 04:26:55 +0000
+++ lib/my_controller_patch.rb 2012-10-24 19:03:39 +0000
@@ -31,7 +31,6 @@

   def avatar
    @user = User.current
- render :partial => 'users/avatar', :layout => true
   end

   def save_avatar