.col-md-9 %h1= t(".usage_statistic") %div = form_tag("/admins/stats", method: "get", class: "form-inline") do %select.form-control{name: "range"} %option{value: "daily", selected: ("selected" if params[:range] == "daily")} = t(".daily") %option{value: "week", selected: ("selected" if params[:range] == "week")} = t(".week") %option{value: "2weeks", selected: ("selected" if params[:range] == "2weeks")} = t(".2weeks") %option{value: "month", selected: ("selected" if params[:range] == "month")} = t(".month") = submit_tag t(".go"), class: "btn btn-primary btn-block" %h3 != 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]) - if name == :posts - name = t(".posts", count: model[:yesterday]) - if name == :comments - name = t(".comments", count: model[:yesterday]) - if name == :users - name = t(".users", 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 .col-md-12 %p.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))