noosfero | 3 new commits pushed to repository

Leandro Nunes gitlab at gitlab.com
Tue Mar 17 21:37:58 BRT 2015


Leandro Nunes pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>

Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/0da263565bd1eb370f230426a55ca5acb1c1b4b6">0da26356</a> by Evandro Junior
guarantee main block is always visible to everybody

- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/54002230194b306ec1419556e6d2e96713ea5b18">54002230</a> by Leandro Nunes dos Santos
Merge branch 'master' into P398-main-block-should-not-be-invible

- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/e6dbb3e982d90eb7433f98d0ef7888e0aa18da04">e6dbb3e9</a> by Leandro Nunes
Merge branch 'P398-main-block-should-not-be-invible' into 'master'

Main block should not be invisible

There used to happen a situation that visitors see an empty profile since the main block was not visible for all users.

Now the main block user visibility can not be set for logged, not_logged or followers anymore, only to "All users".

See merge request !499

- - - - -


Changes:

=====================================
app/models/main_block.rb
=====================================
--- a/app/models/main_block.rb
+++ b/app/models/main_block.rb
@@ -24,4 +24,10 @@ class MainBlock < Block
     ['always', 'except_home_page']
   end
 
+  def display_user_options
+    @display_user_options = {
+      'all'            => _('All users')
+    }
+  end
+
 end

=====================================
test/functional/profile_design_controller_test.rb
=====================================
--- a/test/functional/profile_design_controller_test.rb
+++ b/test/functional/profile_design_controller_test.rb
@@ -755,4 +755,12 @@ class ProfileDesignControllerTest < ActionController::TestCase
     assert_response :forbidden
   end
 
+  should 'guarantee main block is always visible to everybody' do
+    get :edit, :profile => 'designtestuser', :id => @b4.id
+    %w[logged not_logged followers].each do |option|
+    assert_no_tag :select, :attributes => {:name => 'block[display_user]'},
+     :descendant => {:tag => 'option', :attributes => {:value => option}}
+    end
+  end
+
 end

=====================================
test/unit/main_block_test.rb
=====================================
--- a/test/unit/main_block_test.rb
+++ b/test/unit/main_block_test.rb
@@ -29,4 +29,8 @@ class MainBlockTest < ActiveSupport::TestCase
     assert !block.visible?
   end
 
+  should 'guarantee main block is always visible to everybody' do
+    assert_equal MainBlock.new.display_user_options, {"all"=>_('All users')}
+  end
+
 end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150318/4ca3282e/attachment.html>


More information about the Noosfero-dev mailing list