forked from e621ng/e621ng
parent
c3e0dd6588
commit
654023250f
@ -61,7 +61,8 @@ class StatsUpdater
|
||||
|
||||
stats[:total_forum_threads] = ForumTopic.count
|
||||
stats[:total_forum_posts] = ForumPost.maximum("id") || 0
|
||||
stats[:average_posts_per_thread] = (stats[:total_forum_posts] / stats[:total_forum_threads]).round
|
||||
stats[:average_posts_per_thread] = 0
|
||||
stats[:average_posts_per_thread] = (stats[:total_forum_posts] / stats[:total_forum_threads]).round if stats[:total_forum_threads] > 0
|
||||
stats[:average_forum_posts_per_day] = daily_average.call(stats[:total_forum_posts])
|
||||
|
||||
### Blips ###
|
||||
|
@ -12,7 +12,13 @@
|
||||
<td><%= data_title %></td>
|
||||
<td><%= del(@stats[data_or_stats_key]) || data_or_stats_key %></td>
|
||||
<% if data_total_key %>
|
||||
<td class="stats-pct"><%= (@stats[data_or_stats_key].to_f / @stats[data_total_key] * 100).round %>%</td>
|
||||
<td class="stats-pct">
|
||||
<% if @stats[data_total_key] > 0 %>
|
||||
<%= (@stats[data_or_stats_key].to_f / @stats[data_total_key] * 100).round %>%
|
||||
<% else %>
|
||||
0%
|
||||
<% end %>
|
||||
</td>
|
||||
<% else %>
|
||||
<td></td>
|
||||
<% end %>
|
||||
|
Loading…
Reference in New Issue
Block a user