Commit 37c976efc3742aaf9ffe2c9aa56d18722389f083

Authored by AntonioTerceiro
1 parent 2e999a09

ActionItem152: adding RecentDocumentsBlock (now with title) to list of blocks available to profiles


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1264 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/my_profile/profile_design_controller.rb
... ... @@ -3,7 +3,7 @@ class ProfileDesignController < BoxOrganizerController
3 3 needs_profile
4 4  
5 5 def available_blocks
6   - @available_blocks ||= [ Block, ArticleBlock, TagsBlock ]
  6 + @available_blocks ||= [ Block, ArticleBlock, TagsBlock, RecentDocumentsBlock ]
7 7 end
8 8  
9 9 end
... ...
app/models/recent_documents_block.rb
... ... @@ -14,6 +14,7 @@ class RecentDocumentsBlock < Block
14 14 owner.recent_documents(self.limit)
15 15 end
16 16  
  17 + content_tag('h3', _('Recent content'), :class => 'block-title') +
17 18 content_tag('ul', docs.map {|item| content_tag('li', link_to(item.title, item.url))}.join("\n"))
18 19  
19 20 end
... ...