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 16 if profile.person?
17 17 blocks << FriendsBlock
18 18 blocks << FavoriteEnterprisesBlock
  19 + blocks << CommunitiesBlock
  20 + blocks << EnterprisesBlock
19 21 end
20 22  
21 23 # blocks exclusive for enterprises
... ...
app/models/communities_block.rb
1 1 class CommunitiesBlock < ProfileListBlock
2 2  
3   - settings_items :limit, :default => 3
4   -
5 3 def self.description
6 4 __('A block that displays your communities')
7 5 end
... ...
app/models/profile_list_block.rb
1 1 class ProfileListBlock < Block
2 2  
3   - settings_items :limit, :default => 6
  3 + settings_items :limit, :type => :integer, :default => 6
4 4  
5 5 def self.description
6 6 _('A block that displays random profiles')
... ...
app/views/box_organizer/_profile_list_block.rhtml 0 → 100644
... ... @@ -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 +
... ...