2019-12-05 12:07:43 +00:00
- number_of_data_columns = @cohorts[:months_included] - 1
2017-03-30 15:48:33 +00:00
.bs-callout.clearfix
%p
2019-12-05 12:07:43 +00:00
= s_("Cohorts|User cohorts are shown for the last %{months_included} months. Only users with activity are counted in the 'New users' column; inactive users are counted separately.") % { months_included: @cohorts[:months_included] }
2021-12-23 03:10:23 +00:00
= link_to sprite_icon('question-o'), help_page_path('user/admin_area/user_cohorts', anchor: 'cohorts'), title: 'About this feature', target: '_blank', rel: 'noopener noreferrer'
2017-03-30 15:48:33 +00:00
2019-12-05 12:07:43 +00:00
.table-holder.d-xl-table
2017-03-30 15:48:33 +00:00
%table.table
%thead
%tr
2019-12-05 12:07:43 +00:00
%th.border-right.pt-4{ colspan: 3 }
%th.font-weight-bold.pt-4{ colspan: number_of_data_columns }
= s_("Cohorts|Returning users")
%tr
%th.border-top-0
= s_("Cohorts|Registration month")
%th.border-top-0
= s_("Cohorts|Inactive users")
%th.border-top-0.border-right
= s_("Cohorts|New users")
- number_of_data_columns.times do |i|
%th.border-top-0
= s_("Cohorts|Month %{month_index}") % { month_index: i + 1 }
2017-03-30 15:48:33 +00:00
%tbody
2017-04-06 12:12:12 +00:00
- @cohorts[:cohorts].each do |cohort|
2017-03-30 15:48:33 +00:00
%tr
2017-04-06 12:12:12 +00:00
%td= cohort[:registration_month]
%td= cohort[:inactive]
2019-12-05 12:07:43 +00:00
%td.border-right= cohort[:total]
2017-04-06 12:12:12 +00:00
- cohort[:activity_months].each do |activity_month|
2017-03-30 15:48:33 +00:00
%td
2017-04-06 12:12:12 +00:00
- next if cohort[:total] == '0'
= activity_month[:percentage]
2017-03-30 15:48:33 +00:00
%br
2017-04-06 12:12:12 +00:00
= activity_month[:total]