diff --git a/lib/software_communities_plugin.rb b/lib/software_communities_plugin.rb index 0c95372..68c6063 100644 --- a/lib/software_communities_plugin.rb +++ b/lib/software_communities_plugin.rb @@ -70,6 +70,12 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin ) end + module Hotspots + def display_community_average_rating community + nil + end + end + def communities_ratings_plugin_comments_extra_fields if context.profile.software? Proc::new { render :file => 'comments_extra_fields' } diff --git a/lib/software_information_block.rb b/lib/software_information_block.rb index 7a17b44..a398c96 100644 --- a/lib/software_information_block.rb +++ b/lib/software_information_block.rb @@ -15,12 +15,11 @@ class SoftwareInformationBlock < Block def content(args={}) block = self s = show_name - average_rating = CommunityRating.average_rating block.owner.id lambda do |object| render( :file => 'blocks/software_information', - :locals => { :block => block, :show_name => s, :average_rating => average_rating} + :locals => { :block => block, :show_name => s} ) end end diff --git a/views/blocks/software_information.html.erb b/views/blocks/software_information.html.erb index 70ba995..097899c 100644 --- a/views/blocks/software_information.html.erb +++ b/views/blocks/software_information.html.erb @@ -27,27 +27,8 @@ <%= block.owner.software_info.finality %> -
- <% if average_rating %> -
<%= _("Rate") %>
-
- <% (1..5).each do |star_number| %> - <% if star_number <= average_rating %> -
- <% else %> -
- <% end %> - <% end %> -
- <% else %> - <%= _("Be the first to rate this software") %> - <% end %> - -
- <%= link_to _('Rate this software'), url_for(:controller => 'communities_ratings_plugin_profile', :action => 'new_rating', :profile=>block.owner.identifier) %> -
-
+ <%= @plugins.dispatch(:display_community_average_rating, block.owner).collect { |content| instance_exec(&content) }.join("") %> -- libgit2 0.21.2