[Git][noosfero/noosfero][stable-1.7] Merge branch 'not-logged-join' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Mon May 8 15:31:50 BRT 2017


Rodrigo Souto pushed to branch stable-1.7 at Noosfero / noosfero


Commits:
ba321796 by Rodrigo Souto at 2017-05-08T18:31:43+00:00
Merge branch 'not-logged-join' into 'master'

Not logged join

See merge request !1204
- - - - -


3 changed files:

- app/controllers/public/profile_controller.rb
- app/helpers/memberships_helper.rb
- test/functional/profile_controller_test.rb


Changes:

=====================================
app/controllers/public/profile_controller.rb
=====================================
--- a/app/controllers/public/profile_controller.rb
+++ b/app/controllers/public/profile_controller.rb
@@ -130,7 +130,7 @@ class ProfileController < PublicController
     if user
       redirect_to :controller => 'profile', :action => 'join'
     else
-      redirect_to :controller => '/account', :action => 'login'
+      redirect_to :controller => '/account', :action => 'login', :return_to => profile.url
     end
   end
 


=====================================
app/helpers/memberships_helper.rb
=====================================
--- a/app/helpers/memberships_helper.rb
+++ b/app/helpers/memberships_helper.rb
@@ -5,6 +5,8 @@ module MembershipsHelper
 
     if show_confirmation_modal? profile
       modal_button :add, _('Join this community'), url, class: 'join-community'
+    elsif !options[:logged]
+      modal_button :add, _('Join this community'), url, class: 'join-community'
     else
       button :add, _('Join this community'), url, class: 'join-community'
     end


=====================================
test/functional/profile_controller_test.rb
=====================================
--- a/test/functional/profile_controller_test.rb
+++ b/test/functional/profile_controller_test.rb
@@ -498,7 +498,7 @@ class ProfileControllerTest < ActionController::TestCase
     get :join_not_logged, :profile => community.identifier
 
     assert_equal community.identifier, @request.session[:join]
-    assert_redirected_to :controller => :account, :action => :login
+    assert_redirected_to :controller => :account, :action => :login, :return_to => community.url
   end
 
   should 'redirect to join after user logged asks to join_not_logged a community' do



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/ba32179611b960acf2f8a25f434da88461e3b3b6

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/ba32179611b960acf2f8a25f434da88461e3b3b6
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/20170508/a19e63ac/attachment-0001.html>


More information about the Noosfero-dev mailing list