diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index ccef0d5..2ea5d57 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -219,7 +219,8 @@ class MpogSoftwarePlugin < Noosfero::Plugin def self.extra_blocks { - SoftwaresBlock => {:type => [Environment, Person] } + SoftwaresBlock => {:type => [Environment, Person] }, + SoftwareInformationBlock => {:type => [Community] } } end diff --git a/lib/software_information_block.rb b/lib/software_information_block.rb new file mode 100644 index 0000000..6f29c37 --- /dev/null +++ b/lib/software_information_block.rb @@ -0,0 +1,25 @@ +class SoftwareInformationBlock < Block + + def self.description + _('Basic Software Information') + end + + def help + _('This block displays the basic information of a software profile.') + end + + def content(args={}) + block = self + s = show_name + lambda do |object| + render( + :file => 'blocks/software_information', + :locals => { :block => block, :show_name => s } + ) + end + end + + def cacheable? + false + end +end diff --git a/views/blocks/software_information.html.erb b/views/blocks/software_information.html.erb new file mode 100644 index 0000000..6cf4b75 --- /dev/null +++ b/views/blocks/software_information.html.erb @@ -0,0 +1,45 @@ +
+ +<% if block.owner.software_info.nil? %> + <%= _("This community needs a software to use this block") %> + +<% else %> + + + + + + + + + + + +
+
+
+ + <%= link_to profile_image(block.owner, :big) +"\n", profile.url %> + +
+
+
+

+ <%= _("#{block.owner.software_info.acronym} - ") unless block.owner.software_info.acronym.blank? %> + <%= _("#{block.owner.name}") %> +

+ + + <%= block.owner.software_info.finality %> + +
+ <% identifier_name = block.owner.software_info.acronym.blank? ? block.owner.name : block.owner.software_info.acronym %> + <%= _("For more detailed information see ") %> + <%= link_to(_("#{block.owner.name} profile"), {:controller => 'profile', :action => "index", :profile => block.owner.identifier}) %> +
+ + <%= _("Licensed by ") %> + <%= link_to block.owner.software_info.license_info.version, block.owner.software_info.license_info.link %> + +
+<% end %> -- libgit2 0.21.2