mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
430 lines
17 KiB
Plaintext
430 lines
17 KiB
Plaintext
<div class="row">
|
|
<div class="col s12">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
90-day signups
|
|
<span class="right grey-text">
|
|
<%= number_with_delimiter User.last.id %> total users
|
|
</span>
|
|
</div>
|
|
<%= area_chart @reports.limit(90).pluck(:day, :user_signups), colors: ['#2196F3'] %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
90-day monthly subscriptions
|
|
<span class="right grey-text">
|
|
<%= number_with_delimiter User.where(selected_billing_plan_id: 4).count %> current total
|
|
</span>
|
|
</div>
|
|
<%=
|
|
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']
|
|
%>
|
|
<div>
|
|
90-day net:
|
|
<%= sprintf "%+d", @reports.limit(90).sum(:new_monthly_subscriptions) - @reports.limit(90).sum(:ended_monthly_subscriptions) %>
|
|
subscriptions
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
90-day trimonthly subscriptons
|
|
<span class="right grey-text">
|
|
<%= number_with_delimiter User.where(selected_billing_plan_id: 5).count %> current total
|
|
</span>
|
|
</div>
|
|
<%=
|
|
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']
|
|
%>
|
|
<div>
|
|
90-day net:
|
|
<%= sprintf "%+d", @reports.limit(90).sum(:new_trimonthly_subscriptions) - @reports.limit(90).sum(:ended_trimonthly_subscriptions) %>
|
|
subscriptions
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
90-day annual subscriptions
|
|
<span class="right grey-text">
|
|
<%= number_with_delimiter User.where(selected_billing_plan_id: 6).count %> current total
|
|
</span>
|
|
</div>
|
|
<%=
|
|
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']
|
|
%>
|
|
<div>
|
|
90-day net:
|
|
<%= sprintf "%+d", @reports.limit(90).sum(:new_annual_subscriptions) - @reports.limit(90).sum(:ended_annual_subscriptions) %>
|
|
subscriptions
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<% Rails.application.config.content_types[:all].each do |content_type| %>
|
|
<div class="col s12 m12 l4">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New <%= content_type.name.pluralize %> each day
|
|
<span class="right grey-text"><%= number_with_delimiter content_type.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<div class="col s12 m12 l4">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New timelines
|
|
<span class="right grey-text"><%= number_with_delimiter Timeline.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New stream shares
|
|
<span class="right grey-text"><%= number_with_delimiter ContentPageShare.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New stream comments
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New collections
|
|
<span class="right grey-text"><%= number_with_delimiter PageCollection.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New collection submissions
|
|
<span class="right grey-text"><%= number_with_delimiter PageCollectionSubmission.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New discussion threads
|
|
<span class="right grey-text"><%= number_with_delimiter Thredded::Topic.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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']
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New discussion replies
|
|
<span class="right grey-text"><%= number_with_delimiter Thredded::Post.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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']
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New private discussions
|
|
<span class="right grey-text"><%= number_with_delimiter Thredded::PrivateTopic.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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']
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12 m12 l6">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New private replies
|
|
<span class="right grey-text"><%= number_with_delimiter Thredded::PrivatePost.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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']
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12 m12 l4">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New documents
|
|
<span class="right grey-text"><%= number_with_delimiter Document.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12 m12 l4">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
Updated documents
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12 m12 l4">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
Document revisions
|
|
<span class="right grey-text"><%= number_with_delimiter DocumentRevision.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col s12 m12 l4">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="card-title">
|
|
New document analyses
|
|
<span class="right grey-text"><%= number_with_delimiter DocumentAnalysis.last.id %> total</span>
|
|
</div>
|
|
<%=
|
|
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]
|
|
%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|