Commit 1987d87da8e7274a3a6a7826e899158f85ab2351
1 parent
18e182fd
Exists in
master
and in
29 other branches
ActionItem85: adding block
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@796 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
23 additions
and
2 deletions
Show diff stats
app/controllers/profile_admin/profile_editor_controller.rb
| ... | ... | @@ -9,9 +9,9 @@ class ProfileEditorController < ProfileAdminController |
| 9 | 9 | |
| 10 | 10 | def block_types |
| 11 | 11 | { |
| 12 | - 'ListBlock' => _("List Block"), | |
| 12 | + 'ListBlock' => _("List of People"), | |
| 13 | + 'EnterprisesBlock' => _("List of Enterprises"), | |
| 13 | 14 | 'LinkBlock' => _("Link Block"), |
| 14 | - 'Design::MainBlock' => _('Main content block'), | |
| 15 | 15 | 'RecentDocumentsBlock' => _("Recent documents block") |
| 16 | 16 | } |
| 17 | 17 | end | ... | ... |
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +class EnterprisesBlock < Design::Block | |
| 2 | + | |
| 3 | + def content | |
| 4 | + | |
| 5 | + lambda do | |
| 6 | + content_tag( | |
| 7 | + 'ul', | |
| 8 | + Enterprise.find(:all).map do |p| | |
| 9 | + content_tag( | |
| 10 | + 'li', | |
| 11 | + content_tag( | |
| 12 | + 'span', | |
| 13 | + link_to( p.name, :profile => p.identifier) | |
| 14 | + )) | |
| 15 | + end | |
| 16 | + ) | |
| 17 | + end | |
| 18 | + | |
| 19 | + end | |
| 20 | + | |
| 21 | +end | ... | ... |