[Git][noosfero/noosfero][master] 3 commits: Correção no comportamento de entrar na comunidade quando usuário não está logado
Rodrigo Souto
gitlab at mg.gitlab.com
Mon May 8 15:30:58 BRT 2017
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
56e5c90c by Raphael Matos da Costa at 2017-05-08T10:01:39-03:00
Correção no comportamento de entrar na comunidade quando usuário não está logado
- - - - -
dcf75995 by Rodrigo Souto at 2017-05-08T12:07:03-03:00
join-not-logged: return to the profile page after login
- - - - -
132f91d3 by Rodrigo Souto at 2017-05-08T18:30:42+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
@@ -139,7 +139,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
@@ -497,7 +497,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/compare/210613efe274dd9d4d5906004fb936ea06f7de44...132f91d390682fc363cbb7c178726bccdc6c58f1
---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/210613efe274dd9d4d5906004fb936ea06f7de44...132f91d390682fc363cbb7c178726bccdc6c58f1
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/581f80e0/attachment-0001.html>
More information about the Noosfero-dev
mailing list