diff --git a/app/controllers/my_profile/profile_design_controller.rb b/app/controllers/my_profile/profile_design_controller.rb index 6101709..9abee36 100644 --- a/app/controllers/my_profile/profile_design_controller.rb +++ b/app/controllers/my_profile/profile_design_controller.rb @@ -5,7 +5,7 @@ class ProfileDesignController < BoxOrganizerController protect 'edit_profile_design', :profile def available_blocks - blocks = [ ArticleBlock, TagsBlock, RecentDocumentsBlock, ProfileInfoBlock, LinkListBlock ] + blocks = [ ArticleBlock, TagsBlock, RecentDocumentsBlock, ProfileInfoBlock, LinkListBlock, MyNetworkBlock ] # blocks exclusive for organizations if profile.has_members? @@ -16,7 +16,6 @@ class ProfileDesignController < BoxOrganizerController if profile.person? blocks << FriendsBlock blocks << FavoriteEnterprisesBlock - blocks << MyNetworkBlock end # product block exclusive for enterprises in environments that permits it diff --git a/app/models/my_network_block.rb b/app/models/my_network_block.rb index 9bae64c..1c37987 100644 --- a/app/models/my_network_block.rb +++ b/app/models/my_network_block.rb @@ -15,18 +15,13 @@ class MyNetworkBlock < Block end def content - block_title(title) + - content_tag( - 'ul', - content_tag('li', link_to(n_( 'One article published', '%s articles published', owner.articles.count) % - content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') )) + - content_tag('li', link_to(n__('One friend', '%s friends', owner.friends.count) % - content_tag('b', owner.friends.count), owner.public_profile_url.merge(:action => 'friends'))) + - content_tag('li', link_to(n__('One community', '%s communities', owner.communities.size) % - content_tag('b', owner.communities.size), owner.public_profile_url.merge(:action => 'communities'))) + - content_tag('li', link_to(n_('One tag', '%s tags', owner.tags.size) % - content_tag('b', owner.tags.size), owner.public_profile_url.merge(:action => 'tags'))) - ) + block = self + lambda do + render :file => 'blocks/my_network', :locals => { + :title => block.title, + :owner => block.owner + } + end end end diff --git a/app/views/blocks/my_network.rhtml b/app/views/blocks/my_network.rhtml new file mode 100644 index 0000000..46ae190 --- /dev/null +++ b/app/views/blocks/my_network.rhtml @@ -0,0 +1,15 @@ +<%= block_title(title) %> + +<%= render :file => 'blocks/my_network/' + owner.class.name.underscore, :locals => { :owner => owner } %> + + + +
+ <%= render :file => 'blocks/profile_info_actions/' + owner.class.name.underscore %> +
diff --git a/app/views/blocks/my_network/community.rhtml b/app/views/blocks/my_network/community.rhtml new file mode 100644 index 0000000..e3b68d8 --- /dev/null +++ b/app/views/blocks/my_network/community.rhtml @@ -0,0 +1,8 @@ + diff --git a/app/views/blocks/my_network/enterprise.rhtml b/app/views/blocks/my_network/enterprise.rhtml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/views/blocks/my_network/enterprise.rhtml diff --git a/app/views/blocks/my_network/organization.rhtml b/app/views/blocks/my_network/organization.rhtml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/views/blocks/my_network/organization.rhtml diff --git a/app/views/blocks/my_network/person.rhtml b/app/views/blocks/my_network/person.rhtml new file mode 100644 index 0000000..8a79188 --- /dev/null +++ b/app/views/blocks/my_network/person.rhtml @@ -0,0 +1,10 @@ + diff --git a/app/views/blocks/profile_info.rhtml b/app/views/blocks/profile_info.rhtml index aee81f5..1a15b00 100644 --- a/app/views/blocks/profile_info.rhtml +++ b/app/views/blocks/profile_info.rhtml @@ -14,7 +14,6 @@ -