cirandas.net

ref: master

plugins/organization_ratings/views/blocks/average_rating.html.erb


<% statistics = OrganizationRating.statistics_for_profile block.owner %>

<% if statistics[:average] %>
<%= _("Rating: ") %>
<% (1..5).each do |star_number| %> <% if star_number <= statistics[:average] %>
<% else %>
<% end %> <% end %>
<%= link_to url_for(:controller => 'organization_ratings_plugin_profile', :action => 'new_rating', :anchor => 'ratings-list') do %> <% if(statistics[:total] > 10000) %> <%= "(10000+)" %> <% else %> <%= "(#{statistics[:total]})" %> <% end %> <% end %>
<% else %>
<%= _("Be the first to rate!") %>
<% end %>
<%= link_to _("Rate this %s") % _(block.owner.class.name), url_for(:controller => "organization_ratings_plugin_profile", :action => "new_rating", :profile => block.owner.identifier) %>