Commit 040b05e20cfbc9d522b8691b19cd24d264a67050
Exists in
master
and in
29 other branches
Merge branch 'master' of gitlab.com:noosfero/noosfero
Showing
5 changed files
with
18 additions
and
26 deletions
Show diff stats
app/controllers/public/profile_controller.rb
... | ... | @@ -304,14 +304,6 @@ class ProfileController < PublicController |
304 | 304 | end |
305 | 305 | end |
306 | 306 | |
307 | - def profile_info | |
308 | - begin | |
309 | - @block = profile.blocks.find(params[:block_id]) | |
310 | - rescue | |
311 | - render :text => _('Profile information could not be loaded') | |
312 | - end | |
313 | - end | |
314 | - | |
315 | 307 | def report_abuse |
316 | 308 | @abuse_report = AbuseReport.new |
317 | 309 | render :layout => false | ... | ... |
app/views/blocks/profile_image.rhtml
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 | |
17 | 17 | <% if !user.nil? and user.has_permission?('edit_profile', profile) %> |
18 | 18 | <div class='admin-link'> |
19 | - <%= link_to _('Control panel'), :controller => 'profile_editor' %> | |
19 | + <%= link_to _('Control panel'), block.owner.admin_url %> | |
20 | 20 | </div> |
21 | 21 | <% end %> |
22 | 22 | ... | ... |
app/views/blocks/profile_info.rhtml
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | <li><%= link_to(_('Products/Services'), :controller => 'catalog', :profile => block.owner.identifier) %></li> |
22 | 22 | <% end %> |
23 | 23 | <% if !user.nil? and user.has_permission?('edit_profile', profile) %> |
24 | - <li><%= link_to _('Control panel'), :controller => 'profile_editor' %></li> | |
24 | + <li><%= link_to _('Control panel'), block.owner.admin_url %></li> | |
25 | 25 | <% end %> |
26 | 26 | <% if profile.person? %> |
27 | 27 | <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li> |
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | <% end %> |
41 | 41 | |
42 | 42 | <div class="profile-info-options"> |
43 | - <%= render :file => view_for_profile_actions(@block.owner.class) %> | |
43 | + <%= render :file => view_for_profile_actions(block.owner.class) %> | |
44 | 44 | </div> |
45 | 45 | |
46 | 46 | </div><!-- end class="vcard" --> | ... | ... |
plugins/context_content/views/blocks/_more.rhtml
1 | 1 | <% if contents.total_pages > 1 %> |
2 | - <%= link_to_remote(nil, :url => {:id => block.id, :controller => 'context_content_plugin_profile', :action => 'view_content', :page => contents.previous_page, :article_id => article_id }, :html => {:class => "button icon-button icon-left #{contents.previous_page ? '':'disabled'}".strip}, :condition => "#{!contents.previous_page.nil?}", :success => "jQuery('#context_content_#{block.id}').effect('slide', {direction: 'left'});" )%> | |
3 | - <%= link_to_remote(nil, :url => {:id => block.id, :controller => 'context_content_plugin_profile', :action => 'view_content', :page => contents.next_page, :article_id => article_id }, :html => {:class => "button icon-button icon-right #{contents.next_page ? '':'disabled'}".strip}, :condition => "#{!contents.next_page.nil?}", :success => "jQuery('#context_content_#{block.id}').effect('slide', {direction: 'right'});" )%> | |
2 | + <%= link_to_remote(nil, :url => {:profile => block.owner.identifier, :id => block.id, :controller => 'context_content_plugin_profile', :action => 'view_content', :page => contents.previous_page, :article_id => article_id }, :html => {:class => "button icon-button icon-left #{contents.previous_page ? '':'disabled'}".strip}, :condition => "#{!contents.previous_page.nil?}", :success => "jQuery('#context_content_#{block.id}').effect('slide', {direction: 'left'});" )%> | |
3 | + <%= link_to_remote(nil, :url => {:profile => block.owner.identifier, :id => block.id, :controller => 'context_content_plugin_profile', :action => 'view_content', :page => contents.next_page, :article_id => article_id }, :html => {:class => "button icon-button icon-right #{contents.next_page ? '':'disabled'}".strip}, :condition => "#{!contents.next_page.nil?}", :success => "jQuery('#context_content_#{block.id}').effect('slide', {direction: 'right'});" )%> | |
4 | 4 | <% end %> | ... | ... |
test/functional/profile_controller_test.rb
... | ... | @@ -176,7 +176,7 @@ class ProfileControllerTest < ActionController::TestCase |
176 | 176 | should 'not show Leave This Community button for non-registered users' do |
177 | 177 | community = Community.create!(:name => 'my test community') |
178 | 178 | community.boxes.first.blocks << block = ProfileInfoBlock.create! |
179 | - get :profile_info, :profile => community.identifier, :block_id => block.id | |
179 | + get :index, :profile => community.identifier | |
180 | 180 | assert_no_match /\/profile\/#{@profile.identifier}\/leave/, @response.body |
181 | 181 | end |
182 | 182 | |
... | ... | @@ -206,7 +206,7 @@ class ProfileControllerTest < ActionController::TestCase |
206 | 206 | friend = create_user_full('friendtestuser').person |
207 | 207 | friend.user.activate |
208 | 208 | friend.boxes.first.blocks << block = ProfileInfoBlock.create! |
209 | - get :profile_info, :profile => friend.identifier, :block_id => block.id | |
209 | + get :index, :profile => friend.identifier | |
210 | 210 | assert_match /Add friend/, @response.body |
211 | 211 | end |
212 | 212 | |
... | ... | @@ -215,7 +215,7 @@ class ProfileControllerTest < ActionController::TestCase |
215 | 215 | friend = create_user_full('friendtestuser').person |
216 | 216 | friend.boxes.first.blocks << block = ProfileInfoBlock.create! |
217 | 217 | AddFriend.create!(:person => @profile, :friend => friend) |
218 | - get :profile_info, :profile => friend.identifier, :block_id => block.id | |
218 | + get :index, :profile => friend.identifier | |
219 | 219 | assert_no_match /Add friend/, @response.body |
220 | 220 | end |
221 | 221 | |
... | ... | @@ -226,7 +226,7 @@ class ProfileControllerTest < ActionController::TestCase |
226 | 226 | @profile.add_friend(friend) |
227 | 227 | @profile.friends.reload |
228 | 228 | assert @profile.is_a_friend?(friend) |
229 | - get :profile_info, :profile => friend.identifier, :block_id => block.id | |
229 | + get :index, :profile => friend.identifier | |
230 | 230 | assert_no_match /Add friend/, @response.body |
231 | 231 | end |
232 | 232 | |
... | ... | @@ -301,13 +301,13 @@ class ProfileControllerTest < ActionController::TestCase |
301 | 301 | should 'display contact us for enterprises' do |
302 | 302 | ent = Enterprise.create!(:name => 'my test enterprise', :identifier => 'my-test-enterprise') |
303 | 303 | ent.boxes.first.blocks << block = ProfileInfoBlock.create! |
304 | - get :profile_info, :profile => 'my-test-enterprise', :block_id => block.id | |
304 | + get :index, :profile => 'my-test-enterprise' | |
305 | 305 | assert_match /\/contact\/my-test-enterprise\/new/, @response.body |
306 | 306 | end |
307 | 307 | |
308 | 308 | should 'not display contact us for non-enterprises' do |
309 | 309 | @profile.boxes.first.blocks << block = ProfileInfoBlock.create! |
310 | - get :profile_info, :profile => @profile.identifier, :block_id => block.id | |
310 | + get :index, :profile => @profile.identifier | |
311 | 311 | assert_no_match /\/contact\/#{@profile.identifier}\/new/, @response.body |
312 | 312 | end |
313 | 313 | |
... | ... | @@ -315,7 +315,7 @@ class ProfileControllerTest < ActionController::TestCase |
315 | 315 | ent = Enterprise.create! :name => 'my test enterprise', :identifier => 'my-test-enterprise' |
316 | 316 | ent.boxes.first.blocks << block = ProfileInfoBlock.create! |
317 | 317 | ent.update_attribute(:enable_contact_us, false) |
318 | - get :profile_info, :profile => 'my-test-enterprise', :block_id => block.id | |
318 | + get :index, :profile => 'my-test-enterprise' | |
319 | 319 | assert_no_match /\/contact\/my-test-enterprise\/new/, @response.body |
320 | 320 | end |
321 | 321 | |
... | ... | @@ -328,7 +328,7 @@ class ProfileControllerTest < ActionController::TestCase |
328 | 328 | env.disable('disable_contact_person') |
329 | 329 | env.save! |
330 | 330 | login_as(@profile.identifier) |
331 | - get :profile_info, :profile => friend.identifier, :block_id => block.id | |
331 | + get :index, :profile => friend.identifier | |
332 | 332 | assert_match /\/contact\/#{friend.identifier}\/new/, @response.body |
333 | 333 | end |
334 | 334 | |
... | ... | @@ -336,7 +336,7 @@ class ProfileControllerTest < ActionController::TestCase |
336 | 336 | nofriend = create_user_full('no_friend').person |
337 | 337 | nofriend.boxes.first.blocks << block = ProfileInfoBlock.create! |
338 | 338 | login_as(@profile.identifier) |
339 | - get :profile_info, :profile => nofriend.identifier, :block_id => block.id | |
339 | + get :index, :profile => nofriend.identifier | |
340 | 340 | assert_no_match /\/contact\/#{nofriend.identifier}\/new/, @response.body |
341 | 341 | end |
342 | 342 | |
... | ... | @@ -349,7 +349,7 @@ class ProfileControllerTest < ActionController::TestCase |
349 | 349 | env.save! |
350 | 350 | @profile.add_friend(friend) |
351 | 351 | login_as(@profile.identifier) |
352 | - get :profile_info, :profile => friend.identifier, :block_id => block.id | |
352 | + get :index, :profile => friend.identifier | |
353 | 353 | assert_match /\/contact\/#{friend.identifier}\/new/, @response.body |
354 | 354 | end |
355 | 355 | |
... | ... | @@ -361,7 +361,7 @@ class ProfileControllerTest < ActionController::TestCase |
361 | 361 | env.save! |
362 | 362 | @profile.add_friend(friend) |
363 | 363 | login_as(@profile.identifier) |
364 | - get :profile_info, :profile => friend.identifier, :block_id => block.id | |
364 | + get :index, :profile => friend.identifier | |
365 | 365 | assert_no_match /\/contact\/#{friend.identifier}\/new/, @response.body |
366 | 366 | end |
367 | 367 | |
... | ... | @@ -373,7 +373,7 @@ class ProfileControllerTest < ActionController::TestCase |
373 | 373 | env.save! |
374 | 374 | community.add_member(@profile) |
375 | 375 | login_as(@profile.identifier) |
376 | - get :profile_info, :profile => community.identifier, :block_id => block.id | |
376 | + get :index, :profile => community.identifier | |
377 | 377 | assert_match /\/contact\/#{community.identifier}\/new/, @response.body |
378 | 378 | end |
379 | 379 | |
... | ... | @@ -385,7 +385,7 @@ class ProfileControllerTest < ActionController::TestCase |
385 | 385 | env.save! |
386 | 386 | community.add_member(@profile) |
387 | 387 | login_as(@profile.identifier) |
388 | - get :profile_info, :profile => community.identifier, :block_id => block.id | |
388 | + get :index, :profile => community.identifier | |
389 | 389 | assert_no_match /\/contact\/#{community.identifier}\/new/, @response.body |
390 | 390 | end |
391 | 391 | ... | ... |