Commit 1eb7f90295f07aabd220dbcde0753f2245b0923b
Exists in
staging
and in
30 other branches
Merge branch 'refactor_statistics_pugin' into 'master'
Remove StatisticsBlock#content method It is no longer necessary given the new BoxesHelper structure. This just required a view rename in order to properly work with it. See merge request !905
Showing
3 changed files
with
39 additions
and
47 deletions
Show diff stats
plugins/statistics/lib/statistics_block.rb
... | ... | @@ -0,0 +1,39 @@ |
1 | +<h3 class="block-title"> | |
2 | + <span><%=block.title%></span> | |
3 | +</h3> | |
4 | +<div class="statistics-block-data"> | |
5 | + <ul> | |
6 | + <% if block.is_visible?('user_counter') %> | |
7 | + <li class="users"><span class="amount"><%= block.users%> </span><span class="label"><%= _('users')%></span></li> | |
8 | + <% end %> | |
9 | + <% if block.is_visible?('enterprise_counter') && !block.environment.enabled?('disable_asset_enterprises') %> | |
10 | + <li class="enterprises"><span class="amount"><%= block.enterprises%> </span><span class="label"><%= _('enterprises')%></span></li> | |
11 | + <% end %> | |
12 | + <% if block.is_visible?('product_counter') && block.environment.enabled?('products_for_enterprises') %> | |
13 | + <li class="products"><span class="amount"><%= block.products%> </span><span class="label"><%= _('products')%></span></li> | |
14 | + <% end %> | |
15 | + <% if block.is_visible?('community_counter') %> | |
16 | + <li class="communities"><span class="amount"><%= block.communities%> </span><span class="label"><%= _('communities')%></span></li> | |
17 | + <% end %> | |
18 | + <% if block.is_visible?('category_counter') %> | |
19 | + <li class="categories"><span class="amount"><%= block.categories%> </span><span class="label"><%= _('categories')%></span></li> | |
20 | + <% end %> | |
21 | + <% if block.is_visible?('tag_counter') %> | |
22 | + <li class="tags"><span class="amount"><%= block.tags%> </span><span class="label"><%= c_('tags')%></span></li> | |
23 | + <% end %> | |
24 | + <% if block.is_visible?('comment_counter') %> | |
25 | + <li class="comments"><span class="amount"><%= block.comments%> </span><span class="label"><%= c_('comments')%></span></li> | |
26 | + <% end %> | |
27 | + <% if block.is_visible?('hit_counter') %> | |
28 | + <li class="hits"><span class="amount"><%= block.hits%> </span><span class="label"><%= _('hits')%></span></li> | |
29 | + <% end %> | |
30 | + | |
31 | + <% if block.owner.kind_of?(Environment) then %> | |
32 | + <% block.templates.each do |item| %> | |
33 | + <% if block.is_template_counter_active? item.id %> | |
34 | + <li class="<%= item.name.to_slug%>"><span class="amount"><%= block.template_counter_count(item.id)%> </span><span class="label"><%= item.name%></span></li> | |
35 | + <% end %> | |
36 | + <% end %> | |
37 | + <% end %> | |
38 | + </ul> | |
39 | +</div> | ... | ... |
plugins/statistics/views/statistics_block.html.erb
... | ... | @@ -1,39 +0,0 @@ |
1 | -<h3 class="block-title"> | |
2 | - <span><%=block.title%></span> | |
3 | -</h3> | |
4 | -<div class="statistics-block-data"> | |
5 | - <ul> | |
6 | - <% if block.is_visible?('user_counter') %> | |
7 | - <li class="users"><span class="amount"><%= block.users%> </span><span class="label"><%= _('users')%></span></li> | |
8 | - <% end %> | |
9 | - <% if block.is_visible?('enterprise_counter') && !block.environment.enabled?('disable_asset_enterprises') %> | |
10 | - <li class="enterprises"><span class="amount"><%= block.enterprises%> </span><span class="label"><%= _('enterprises')%></span></li> | |
11 | - <% end %> | |
12 | - <% if block.is_visible?('product_counter') && block.environment.enabled?('products_for_enterprises') %> | |
13 | - <li class="products"><span class="amount"><%= block.products%> </span><span class="label"><%= _('products')%></span></li> | |
14 | - <% end %> | |
15 | - <% if block.is_visible?('community_counter') %> | |
16 | - <li class="communities"><span class="amount"><%= block.communities%> </span><span class="label"><%= _('communities')%></span></li> | |
17 | - <% end %> | |
18 | - <% if block.is_visible?('category_counter') %> | |
19 | - <li class="categories"><span class="amount"><%= block.categories%> </span><span class="label"><%= _('categories')%></span></li> | |
20 | - <% end %> | |
21 | - <% if block.is_visible?('tag_counter') %> | |
22 | - <li class="tags"><span class="amount"><%= block.tags%> </span><span class="label"><%= c_('tags')%></span></li> | |
23 | - <% end %> | |
24 | - <% if block.is_visible?('comment_counter') %> | |
25 | - <li class="comments"><span class="amount"><%= block.comments%> </span><span class="label"><%= c_('comments')%></span></li> | |
26 | - <% end %> | |
27 | - <% if block.is_visible?('hit_counter') %> | |
28 | - <li class="hits"><span class="amount"><%= block.hits%> </span><span class="label"><%= _('hits')%></span></li> | |
29 | - <% end %> | |
30 | - | |
31 | - <% if block.owner.kind_of?(Environment) then %> | |
32 | - <% block.templates.each do |item| %> | |
33 | - <% if block.is_template_counter_active? item.id %> | |
34 | - <li class="<%= item.name.to_slug%>"><span class="amount"><%= block.template_counter_count(item.id)%> </span><span class="label"><%= item.name%></span></li> | |
35 | - <% end %> | |
36 | - <% end %> | |
37 | - <% end %> | |
38 | - </ul> | |
39 | -</div> |