90-day signups <%= number_with_delimiter User.last.id %> total users
<%= area_chart @reports.limit(90).pluck(:day, :user_signups), colors: ['#2196F3'] %>
90-day monthly subscriptions <%= number_with_delimiter User.where(selected_billing_plan_id: 4).count %> current total
<%= area_chart [ { name: 'Started subscriptions', data: @reports.limit(90).pluck(:day, :new_monthly_subscriptions) }, { name: 'Ended subscriptions', data: @reports.limit(90).pluck(:day, :ended_monthly_subscriptions) } ], colors: ['#2196F3'] %>
90-day net: <%= sprintf "%+d", @reports.limit(90).sum(:new_monthly_subscriptions) - @reports.limit(90).sum(:ended_monthly_subscriptions) %> subscriptions
90-day trimonthly subscriptons <%= number_with_delimiter User.where(selected_billing_plan_id: 5).count %> current total
<%= area_chart [ { name: 'Started subscriptions', data: @reports.limit(90).pluck(:day, :new_trimonthly_subscriptions) }, { name: 'Ended subscriptions', data: @reports.limit(90).pluck(:day, :ended_trimonthly_subscriptions) } ], colors: ['#2196F3'] %>
90-day net: <%= sprintf "%+d", @reports.limit(90).sum(:new_trimonthly_subscriptions) - @reports.limit(90).sum(:ended_trimonthly_subscriptions) %> subscriptions
90-day annual subscriptions <%= number_with_delimiter User.where(selected_billing_plan_id: 6).count %> current total
<%= area_chart [ { name: 'Started subscriptions', data: @reports.limit(90).pluck(:day, :new_annual_subscriptions) }, { name: 'Ended subscriptions', data: @reports.limit(90).pluck(:day, :ended_annual_subscriptions) } ], colors: ['#2196F3'] %>
90-day net: <%= sprintf "%+d", @reports.limit(90).sum(:new_annual_subscriptions) - @reports.limit(90).sum(:ended_annual_subscriptions) %> subscriptions
<% Rails.application.config.content_types[:all].each do |content_type| %>
New <%= content_type.name.pluralize %> each day <%= number_with_delimiter content_type.last.id %> total
<%= area_chart @reports.pluck(:day, "#{content_type.name.downcase.pluralize}_created") .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [content_type.hex_color] %>
<% end %>
New timelines <%= number_with_delimiter Timeline.last.id %> total
<%= area_chart @reports.pluck(:day, :timelines_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [Timeline.hex_color] %>
New stream shares <%= number_with_delimiter ContentPageShare.last.id %> total
<%= area_chart @reports.pluck(:day, :stream_shares_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [ContentPageShare.hex_color] %>
New stream comments
<%= area_chart @reports.pluck(:day, :stream_comments) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [ContentPageShare.hex_color] %>
New collections <%= number_with_delimiter PageCollection.last.id %> total
<%= area_chart @reports.pluck(:day, :collections_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [PageCollection.hex_color] %>
New collection submissions <%= number_with_delimiter PageCollectionSubmission.last.id %> total
<%= area_chart @reports.pluck(:day, :collection_submissions_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [PageCollection.hex_color] %>
New discussion threads <%= number_with_delimiter Thredded::Topic.last.id %> total
<%= area_chart @reports.pluck(:day, :thredded_threads_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: ['#2196F3'] %>
New discussion replies <%= number_with_delimiter Thredded::Post.last.id %> total
<%= area_chart @reports.pluck(:day, :thredded_replies_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: ['#2196F3'] %>
New private discussions <%= number_with_delimiter Thredded::PrivateTopic.last.id %> total
<%= area_chart @reports.pluck(:day, :thredded_private_messages_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: ['#2196F3'] %>
New private replies <%= number_with_delimiter Thredded::PrivatePost.last.id %> total
<%= area_chart @reports.pluck(:day, :thredded_private_replies_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: ['#2196F3'] %>
New documents <%= number_with_delimiter Document.last.id %> total
<%= area_chart @reports.pluck(:day, :documents_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [Document.hex_color] %>
Updated documents
<%= area_chart @reports.pluck(:day, :documents_edited) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [Document.hex_color] %>
Document revisions <%= number_with_delimiter DocumentRevision.last.id %> total
<%= area_chart @reports.pluck(:day, :document_revisions_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [Document.hex_color] %>
New document analyses <%= number_with_delimiter DocumentAnalysis.last.id %> total
<%= area_chart @reports.pluck(:day, :document_analyses_created) .group_by { |date, total| date.year } .map { |year, data| totals_per_month = Hash.new(0) data.each { |date, count| totals_per_month[date.strftime("%b")] += (count || 0) } { name: year, data: Date::ABBR_MONTHNAMES.reject(&:nil?).map { |month| [month, totals_per_month[month]] } } }, colors: [Document.hex_color] %>