50 lines
1.6 KiB
Text
50 lines
1.6 KiB
Text
- content_for :head do
|
|
= stylesheet_link_tag :admin
|
|
|
|
%h1= t(".usage_statistic")
|
|
|
|
.row
|
|
= form_tag("/admins/stats", method: "get", class: "col-sm-12 form-inline segment-selection") do
|
|
.col-sm-2.col-sm-push-8
|
|
%select.form-control{name: "range"}
|
|
- ["daily", "week", "2weeks", "month"].each do |range|
|
|
%option{value: range, selected: ("selected" if params[:range] == range)}
|
|
= t(".#{range}")
|
|
.col-sm-2.col-sm-push-8
|
|
= submit_tag t(".go"), class: "btn btn-primary btn-block"
|
|
|
|
.col-sm-8.col-sm-pull-4
|
|
%h4
|
|
!= t("admins.stats.display_results", segment: content_tag(:strong, @segment))
|
|
|
|
.row
|
|
- %i(posts comments aspect_memberships users).each do |name|
|
|
- model = instance_variable_get("@#{name}")
|
|
- if name == :aspect_memberships
|
|
- name = t(".shares", count: model[:yesterday])
|
|
- else
|
|
- name = t(".#{name}", count: model[:yesterday])
|
|
|
|
.col-md-3
|
|
%h2{style: "font-weight:bold;"}
|
|
= name.to_s
|
|
%h4
|
|
= model[:day_before]
|
|
%span.percent_change{class: (model[:change] > 0 ? "green" : "red")}
|
|
= "(#{model[:change]}%)"
|
|
|
|
.row
|
|
%p.col-md-12.alert.alert-info.text-center{role: "alert"}
|
|
!= t("admins.stats.current_segment",
|
|
post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f),
|
|
post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f))
|
|
|
|
.row
|
|
.col-md-12
|
|
%h3= t(".50_most")
|
|
%ul
|
|
- @popular_tags.each do |name, count|
|
|
%li
|
|
!= t("admins.stats.tag_name",
|
|
name_tag: content_tag(:strong, name),
|
|
count_tag: content_tag(:strong, count))
|