Commit 31416a5522151b9764377275e5a5bb482440c6e7
1 parent
2ecd34a0
Exists in
staging
and in
42 other branches
ActionItem900: some usability changes
Showing
6 changed files
with
33 additions
and
10 deletions
Show diff stats
app/controllers/public/profile_controller.rb
| @@ -49,7 +49,9 @@ class ProfileController < PublicController | @@ -49,7 +49,9 @@ class ProfileController < PublicController | ||
| 49 | flash[:notice] = _('%s administrator still needs to accept you as member.') % profile.name if profile.closed? | 49 | flash[:notice] = _('%s administrator still needs to accept you as member.') % profile.name if profile.closed? |
| 50 | redirect_to profile.url | 50 | redirect_to profile.url |
| 51 | else | 51 | else |
| 52 | - render :layout => false | 52 | + if request.xhr? |
| 53 | + render :layout => false | ||
| 54 | + end | ||
| 53 | end | 55 | end |
| 54 | end | 56 | end |
| 55 | 57 |
app/views/profile/join.rhtml
| @@ -7,5 +7,9 @@ | @@ -7,5 +7,9 @@ | ||
| 7 | <% form_tag do %> | 7 | <% form_tag do %> |
| 8 | <%= hidden_field_tag(:confirmation, 1) %> | 8 | <%= hidden_field_tag(:confirmation, 1) %> |
| 9 | <%= submit_button(:ok, _("Yes, I want to join.") % profile.name) %> | 9 | <%= submit_button(:ok, _("Yes, I want to join.") % profile.name) %> |
| 10 | - <%= lightbox_close_button(_("No, I don't want."), :action => 'index') %> | 10 | + <% if logged_in? && request.xhr? %> |
| 11 | + <%= lightbox_close_button(_("No, I don't want")) %> | ||
| 12 | + <% else %> | ||
| 13 | + <%= button(:cancel, _("No, I don't want."), profile.url) %> | ||
| 14 | + <% end %> | ||
| 11 | <% end %> | 15 | <% end %> |
app/views/shared/join_community_popup.rhtml
| @@ -2,7 +2,11 @@ | @@ -2,7 +2,11 @@ | ||
| 2 | <h3> <%= __('Do you want to join this community?') %> </h3> | 2 | <h3> <%= __('Do you want to join this community?') %> </h3> |
| 3 | 3 | ||
| 4 | <% button_bar do %> | 4 | <% button_bar do %> |
| 5 | - <%= lightbox_button(:ok, _('Yes'), :controller => 'profile', :action => 'join', :profile => profile.identifier) %> | 5 | + <% if logged_in? %> |
| 6 | + <%= lightbox_button(:ok, _('Yes'), :controller => 'profile', :action => 'join', :profile => profile.identifier) %> | ||
| 7 | + <% else %> | ||
| 8 | + <%= button(:ok, _('Yes'), :controller => 'profile', :action => 'join', :profile => profile.identifier) %> | ||
| 9 | + <% end %> | ||
| 6 | <%= button_to_function(:cancel, _('Not now'), "$('join-community-popup').hide()") %> | 10 | <%= button_to_function(:cancel, _('Not now'), "$('join-community-popup').hide()") %> |
| 7 | <%= button(:cancel, _('No and don\'t ask again'), :controller => 'profile', :action => 'refuse_join', :profile => profile.identifier) %> | 11 | <%= button(:cancel, _('No and don\'t ask again'), :controller => 'profile', :action => 'refuse_join', :profile => profile.identifier) %> |
| 8 | <% end %> | 12 | <% end %> |
public/stylesheets/common.css
| @@ -401,7 +401,7 @@ div.pending-tasks { | @@ -401,7 +401,7 @@ div.pending-tasks { | ||
| 401 | 401 | ||
| 402 | /* theme test panel */ | 402 | /* theme test panel */ |
| 403 | #theme-test-panel { | 403 | #theme-test-panel { |
| 404 | - z-index: 1000; | 404 | + z-index: 150; |
| 405 | position: absolute; | 405 | position: absolute; |
| 406 | width: 300px; | 406 | width: 300px; |
| 407 | height: 180; | 407 | height: 180; |
| @@ -421,7 +421,7 @@ div.pending-tasks { | @@ -421,7 +421,7 @@ div.pending-tasks { | ||
| 421 | 421 | ||
| 422 | /* join community popup */ | 422 | /* join community popup */ |
| 423 | #join-community-popup { | 423 | #join-community-popup { |
| 424 | - z-index: 1000; | 424 | + z-index: 150; |
| 425 | position: absolute; | 425 | position: absolute; |
| 426 | width: 350px; | 426 | width: 350px; |
| 427 | height: 180; | 427 | height: 180; |
public/stylesheets/thickbox.css
| @@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
| 27 | /* ----------------------------------------------------------------------------------------------------------------*/ | 27 | /* ----------------------------------------------------------------------------------------------------------------*/ |
| 28 | #TB_overlay { | 28 | #TB_overlay { |
| 29 | position: fixed; | 29 | position: fixed; |
| 30 | - z-index:100; | 30 | + z-index:200; |
| 31 | top: 0px; | 31 | top: 0px; |
| 32 | left: 0px; | 32 | left: 0px; |
| 33 | height:100%; | 33 | height:100%; |
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | #TB_window { | 50 | #TB_window { |
| 51 | position: fixed; | 51 | position: fixed; |
| 52 | background: white; | 52 | background: white; |
| 53 | - z-index: 102; | 53 | + z-index: 202; |
| 54 | color:#000000; | 54 | color:#000000; |
| 55 | display:none; | 55 | display:none; |
| 56 | border: 4px solid #525252; | 56 | border: 4px solid #525252; |
| @@ -124,7 +124,7 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d | @@ -124,7 +124,7 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d | ||
| 124 | display:none; | 124 | display:none; |
| 125 | height:13px; | 125 | height:13px; |
| 126 | width:208px; | 126 | width:208px; |
| 127 | - z-index:103; | 127 | + z-index:203; |
| 128 | top: 50%; | 128 | top: 50%; |
| 129 | left: 50%; | 129 | left: 50%; |
| 130 | margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ | 130 | margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ |
| @@ -136,7 +136,7 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d | @@ -136,7 +136,7 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d | ||
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | #TB_HideSelect{ | 138 | #TB_HideSelect{ |
| 139 | - z-index:99; | 139 | + z-index:199; |
| 140 | position:fixed; | 140 | position:fixed; |
| 141 | top: 0; | 141 | top: 0; |
| 142 | left: 0; | 142 | left: 0; |
test/functional/profile_controller_test.rb
| @@ -63,15 +63,28 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -63,15 +63,28 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
| 63 | assert_kind_of Array, assigns(:favorite_enterprises) | 63 | assert_kind_of Array, assigns(:favorite_enterprises) |
| 64 | end | 64 | end |
| 65 | 65 | ||
| 66 | - should 'render join template without layout when not' do | 66 | + should 'render join template without layout when called with AJAX' do |
| 67 | community = Community.create!(:name => 'my test community') | 67 | community = Community.create!(:name => 'my test community') |
| 68 | login_as(@profile.identifier) | 68 | login_as(@profile.identifier) |
| 69 | + @request.expects(:xhr?).returns(true) | ||
| 70 | + | ||
| 69 | get :join, :profile => community.identifier | 71 | get :join, :profile => community.identifier |
| 70 | assert_response :success | 72 | assert_response :success |
| 71 | assert_template 'join' | 73 | assert_template 'join' |
| 72 | assert_no_tag :tag => 'html' | 74 | assert_no_tag :tag => 'html' |
| 73 | end | 75 | end |
| 74 | 76 | ||
| 77 | + should 'render join template with layout in general' do | ||
| 78 | + community = Community.create!(:name => 'my test community') | ||
| 79 | + login_as(@profile.identifier) | ||
| 80 | + @request.expects(:xhr?).returns(false) | ||
| 81 | + | ||
| 82 | + get :join, :profile => community.identifier | ||
| 83 | + assert_response :success | ||
| 84 | + assert_template 'join' | ||
| 85 | + assert_tag :tag => 'html' | ||
| 86 | + end | ||
| 87 | + | ||
| 75 | should 'show Join This Community button for non-member users' do | 88 | should 'show Join This Community button for non-member users' do |
| 76 | login_as(@profile.identifier) | 89 | login_as(@profile.identifier) |
| 77 | community = Community.create!(:name => 'my test community') | 90 | community = Community.create!(:name => 'my test community') |