<%= @content_type.count %>

total all time

<%= @content_type.where('created_at > ? ', DateTime.now.beginning_of_month).count %>

total this month

<%= @content_type.where('created_at > ? ', DateTime.now.beginning_of_week).count %>

total this week

<%= @content_type.where('created_at > ? ', DateTime.now.beginning_of_day).count %>

total today
All-time creations
<%= area_chart @content_type.group_by_day(:created_at) %>
7-day creations
<%= area_chart @content_type.where('created_at > ?', DateTime.now - 7.days).group_by_day(:created_at) %>
30-day creations
<%= area_chart @content_type.where('created_at > ?', DateTime.now - 30.days).group_by_day(:created_at) %>
<%= @content_type.name.pluralize %> per user
<%= column_chart User.joins(@relation_name).group(:user_id).count().group_by { |n| n.last }.each_with_object({}) { |(content_count, ids), h| h[content_count] = ids.count } %>
<% unless @content_type == Universe %>
<%= @content_type.name.pluralize %> per universe
<%= column_chart Universe.joins(@relation_name).group(:universe_id).count().group_by { |n| n.last }.each_with_object({}) { |(content_count, ids), h| h[content_count] = ids.count } %>
<% end %>
<%= @content_type.name %> privacy
<%= pie_chart @content_type.where.not(privacy: "").group(:privacy).count() %>
<% @content_type.attribute_categories(User.new).each do |category| %> <% next if ['Changelog', 'Gallery', 'Notes', 'Settings', 'Contributors'].include?(category.label) %>
<%= category.label %>
<% category.attribute_fields.each do |attribute| %> <% column = attribute.label.underscore.gsub(' ', '_').to_sym %> <% next unless @content_type.columns.map(&:name).include? column.to_s %> <%= attribute.label %> <%= begin bar_chart @content_type.where.not("#{column}": "").group(column).order('count_all desc').limit(5).count() rescue end %> <% end %>
<% end %>