diff --git a/lib/software_communities_plugin.rb b/lib/software_communities_plugin.rb index 07ad801..1f2c36c 100644 --- a/lib/software_communities_plugin.rb +++ b/lib/software_communities_plugin.rb @@ -41,7 +41,8 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin CategoriesSoftwareBlock => { :type => [Environment] }, SearchCatalogBlock => { :type => [Environment] }, SoftwareHighlightsBlock => { :type => [Environment] }, - SoftwareTabDataBlock => {:type => [Community], :position => 1} + SoftwareTabDataBlock => {:type => [Community], :position => 1}, + WikiBlock => {:type => [Community]} } end diff --git a/lib/wiki_block.rb b/lib/wiki_block.rb new file mode 100644 index 0000000..3d7da90 --- /dev/null +++ b/lib/wiki_block.rb @@ -0,0 +1,30 @@ +class WikiBlock < Block + + attr_accessible :show_name, :wiki_link + settings_items :show_name, :type => :boolean, :default => false + settings_items :wiki_link, :type => :string, :default => "" + + def self.description + _('Wiki Link') + end + + def help + _('This block displays a link to the software wiki.') + end + + def content(args={}) + block = self + s = show_name + + lambda do |object| + render( + :file => 'blocks/wiki', + :locals => { :block => block, :show_name => s } + ) + end + end + + def cacheable? + true + end +end diff --git a/views/blocks/software_tab_data.html.erb b/views/blocks/software_tab_data.html.erb index 3438b0d..3b0a1ce 100644 --- a/views/blocks/software_tab_data.html.erb +++ b/views/blocks/software_tab_data.html.erb @@ -1,10 +1,13 @@ -