Commit 66eabb2c1a84442a50add99e3aa35c6828815ca9

Authored by Rafael Reggiani Manzo
1 parent b9867847

Remove OrganizationRatings#content

This method is no longer necessary (and violates MVC) with the new
structure at BoxesHelper being enough for such job.

The view just required a rename to get into the standards.
plugins/organization_ratings/lib/organization_ratings_block.rb
@@ -9,17 +9,6 @@ class OrganizationRatingsBlock < Block @@ -9,17 +9,6 @@ class OrganizationRatingsBlock < Block
9 _('This block displays the organization ratings.') 9 _('This block displays the organization ratings.')
10 end 10 end
11 11
12 - def content(args = {})  
13 - block = self  
14 -  
15 - proc do  
16 - render(  
17 - :file => 'blocks/organization_ratings_block',  
18 - :locals => {:block => block}  
19 - )  
20 - end  
21 - end  
22 -  
23 def limit_number_of_ratings 12 def limit_number_of_ratings
24 env_organization_ratings_config.per_page 13 env_organization_ratings_config.per_page
25 end 14 end
plugins/organization_ratings/views/blocks/organization_ratings.html.erb 0 → 100644
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
  1 +<div class="ratings-title">
  2 + <%= block_title(block.title, block.subtitle) %>
  3 + <% if block.get_ratings(block.owner.id).empty? %>
  4 + <div class="ratings-list">
  5 + <%= render :partial => 'shared/make_report_block' %>
  6 + </div>
  7 + <% else %>
  8 + <div class="ratings-list">
  9 + <% block.get_ratings(block.owner.id).each_with_index do |r, index| %>
  10 + <% break if index >= block.limit_number_of_ratings %>
  11 + <%= render :partial => "shared/user_rating_container", :locals => {:user_rate => r} %>
  12 + <% end %>
  13 +
  14 + <%= render :partial => 'shared/make_report_block' %>
  15 +
  16 + <div class="see-more">
  17 + <%= link_to _('See more'), url_for(:controller => 'organization_ratings_plugin_profile', :action => 'new_rating'), :class => 'icon-arrow-right-p' %>
  18 + </div>
  19 + </div>
  20 + <% end %>
  21 +</div>
plugins/organization_ratings/views/blocks/organization_ratings_block.html.erb
@@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
1 -<div class="ratings-title">  
2 - <%= block_title(block.title, block.subtitle) %>  
3 - <% if block.get_ratings(block.owner.id).empty? %>  
4 - <div class="ratings-list">  
5 - <%= render :partial => 'shared/make_report_block' %>  
6 - </div>  
7 - <% else %>  
8 - <div class="ratings-list">  
9 - <% block.get_ratings(block.owner.id).each_with_index do |r, index| %>  
10 - <% break if index >= block.limit_number_of_ratings %>  
11 - <%= render :partial => "shared/user_rating_container", :locals => {:user_rate => r} %>  
12 - <% end %>  
13 -  
14 - <%= render :partial => 'shared/make_report_block' %>  
15 -  
16 - <div class="see-more">  
17 - <%= link_to _('See more'), url_for(:controller => 'organization_ratings_plugin_profile', :action => 'new_rating'), :class => 'icon-arrow-right-p' %>  
18 - </div>  
19 - </div>  
20 - <% end %>  
21 -</div>