Commit 0de6b0fe8f2b9a014bfc1400abf6366363d46a1d

Authored by Antonio Terceiro
1 parent 3def26ed

ActionItem1043: allowing to edit the limit of profile list block

app/controllers/my_profile/profile_design_controller.rb
@@ -16,6 +16,8 @@ class ProfileDesignController < BoxOrganizerController @@ -16,6 +16,8 @@ class ProfileDesignController < BoxOrganizerController
16 if profile.person? 16 if profile.person?
17 blocks << FriendsBlock 17 blocks << FriendsBlock
18 blocks << FavoriteEnterprisesBlock 18 blocks << FavoriteEnterprisesBlock
  19 + blocks << CommunitiesBlock
  20 + blocks << EnterprisesBlock
19 end 21 end
20 22
21 # blocks exclusive for enterprises 23 # blocks exclusive for enterprises
app/models/communities_block.rb
1 class CommunitiesBlock < ProfileListBlock 1 class CommunitiesBlock < ProfileListBlock
2 2
3 - settings_items :limit, :default => 3  
4 -  
5 def self.description 3 def self.description
6 __('A block that displays your communities') 4 __('A block that displays your communities')
7 end 5 end
app/models/profile_list_block.rb
1 class ProfileListBlock < Block 1 class ProfileListBlock < Block
2 2
3 - settings_items :limit, :default => 6 3 + settings_items :limit, :type => :integer, :default => 6
4 4
5 def self.description 5 def self.description
6 _('A block that displays random profiles') 6 _('A block that displays random profiles')
app/views/box_organizer/_profile_list_block.rhtml 0 → 100644
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
  1 +<div id='edit-profile-list-block'>
  2 + <%= labelled_form_field _('Limit of items'), text_field(:block, :limit, :size => 3) %>
  3 +</div>
  4 +