diff --git a/app/controllers/my_profile/memberships_controller.rb b/app/controllers/my_profile/memberships_controller.rb index 7719736..5db0c7d 100644 --- a/app/controllers/my_profile/memberships_controller.rb +++ b/app/controllers/my_profile/memberships_controller.rb @@ -10,6 +10,7 @@ class MembershipsController < MyProfileController @to_join = Profile.find(params[:id]) if request.post? && params[:confirmation] @to_join.add_member(profile) + flash[:notice] = _('%s administrador still needs to accept you as member.') % @to_join.name if @to_join.closed? redirect_to @to_join.url end end diff --git a/app/views/profile_editor/_organization.rhtml b/app/views/profile_editor/_organization.rhtml index 4715e4b..484533c 100644 --- a/app/views/profile_editor/_organization.rhtml +++ b/app/views/profile_editor/_organization.rhtml @@ -6,3 +6,8 @@ <%= f.text_field(:economic_activity) %> <%= f.text_area(:management_information, :rows => 5) %> <%= f.text_area(:description, :rows => 5) if @profile.kind_of?(Community) %> +

<%= _('Moderation options') %>

+

+ <%= check_box 'profile_data', 'closed' %> + <%= _("Closed %s") % @profile.class.name.humanize.downcase %> +

diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 736de8e..60a2fa6 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -277,4 +277,11 @@ class ProfileEditorControllerTest < Test::Unit::TestCase post :edit, :profile => 'test_profile', :profile_data => { :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png') } } assert_not_nil assigns(:profile).image end + + should 'show field to set closed organization' do + org = Organization.create!(:name => 'test org', :identifier => 'testorg', :contact_person => 'my contact') + get :edit, :profile => 'testorg' + assert_tag :tag => 'input', :attributes => { :type => 'checkbox', :name => 'profile_data[closed]' } + end + end -- libgit2 0.21.2