Rebase Add translation app/views/admins/stats.html.haml for Admin Panel
This commit is contained in:
parent
9950342599
commit
a3daa00a41
3 changed files with 62 additions and 32 deletions
|
|
@ -52,16 +52,16 @@ class AdminsController < ApplicationController
|
||||||
case params[:range]
|
case params[:range]
|
||||||
when "week"
|
when "week"
|
||||||
range = 1.week
|
range = 1.week
|
||||||
@segment = "week"
|
@segment = t('admins.stats.week')
|
||||||
when "2weeks"
|
when "2weeks"
|
||||||
range = 2.weeks
|
range = 2.weeks
|
||||||
@segment = "2 week"
|
@segment = t('admins.stats.2weeks')
|
||||||
when "month"
|
when "month"
|
||||||
range = 1.month
|
range = 1.month
|
||||||
@segment = "month"
|
@segment = t('admins.stats.month')
|
||||||
else
|
else
|
||||||
range = 1.day
|
range = 1.day
|
||||||
@segment = "daily"
|
@segment = t('admins.stats.daily')
|
||||||
end
|
end
|
||||||
|
|
||||||
[Post, Comment, AspectMembership, User].each do |model|
|
[Post, Comment, AspectMembership, User].each do |model|
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,29 @@
|
||||||
|
|
||||||
.span-24
|
.span-24
|
||||||
= render :partial => 'admins/admin_bar'
|
= render :partial => 'admins/admin_bar.haml'
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
|
||||||
.span-24.last
|
.span-24.last
|
||||||
%h1
|
%h1
|
||||||
Usage Statistics
|
= t('.usage_statistic')
|
||||||
%div{:style => "float:right;"}
|
%div{:style => "float:right;"}
|
||||||
= form_tag('/admins/stats', :method => 'get') do
|
= form_tag('/admins/stats', :method => 'get') do
|
||||||
%select{:name => 'range'}
|
%select{:name => 'range'}
|
||||||
%option{:value => 'daily', :selected => ('selected' if params[:range] == 'daily')}
|
%option{:value => 'daily', :selected => ('selected' if params[:range] == 'daily')}
|
||||||
Daily
|
= t('.daily')
|
||||||
%option{:value => 'week', :selected => ('selected' if params[:range] == 'week')}
|
%option{:value => 'week', :selected => ('selected' if params[:range] == 'week')}
|
||||||
Week
|
= t('.week')
|
||||||
%option{:value => '2weeks', :selected => ('selected' if params[:range] == '2weeks')}
|
%option{:value => '2weeks', :selected => ('selected' if params[:range] == '2weeks')}
|
||||||
2 Weeks
|
= t('.2weeks')
|
||||||
%option{:value => 'month', :selected => ('selected' if params[:range] == 'month')}
|
%option{:value => 'month', :selected => ('selected' if params[:range] == 'month')}
|
||||||
Month
|
= t('.month')
|
||||||
|
|
||||||
= submit_tag 'go'
|
= submit_tag t('.go')
|
||||||
%br
|
%br
|
||||||
%h3
|
%h3
|
||||||
Displaying results from the
|
!= t('.display_results', :segment => @segment)
|
||||||
%b
|
|
||||||
= @segment
|
|
||||||
segment
|
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
|
@ -38,11 +35,16 @@
|
||||||
- [:posts, :comments, :aspect_memberships, :users].each do |name|
|
- [:posts, :comments, :aspect_memberships, :users].each do |name|
|
||||||
- model = eval("@#{name.to_s}")
|
- model = eval("@#{name.to_s}")
|
||||||
- if name == :aspect_memberships
|
- if name == :aspect_memberships
|
||||||
- name = :shares
|
- 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])
|
||||||
|
|
||||||
.span-6{:class => ('last' if name == :users)}
|
.span-6{:class => ('last' if name == t('.users', :count => model[:yesterday]))}
|
||||||
%h2{:style => 'font-weight:bold;'}
|
%h2{:style => 'font-weight:bold;'}
|
||||||
= model[:yesterday]
|
|
||||||
= name.to_s
|
= name.to_s
|
||||||
%h4
|
%h4
|
||||||
= model[:day_before]
|
= model[:day_before]
|
||||||
|
|
@ -54,21 +56,12 @@
|
||||||
%br
|
%br
|
||||||
%hr
|
%hr
|
||||||
|
|
||||||
|
|
||||||
%p{:style => "text-align:center;"}
|
%p{:style => "text-align:center;"}
|
||||||
The current segment is averaging
|
!= t('.current_segment', :post_yest => @posts[:yesterday]/@user_count.to_f, :post_day => @posts[:day_before]/@user_count.to_f)
|
||||||
%b
|
|
||||||
#{@posts[:yesterday]/@user_count.to_f}
|
|
||||||
posts per user, from
|
|
||||||
%b
|
|
||||||
#{@posts[:day_before]/@user_count.to_f}
|
|
||||||
|
|
||||||
.span-24.last
|
.span-24.last
|
||||||
%h3
|
%h3
|
||||||
50 Most Popular Tags
|
= t('.50_most')
|
||||||
- @popular_tags.each do |name,count|
|
- @popular_tags.each do |name,count|
|
||||||
Tag Name:
|
!= t('.tag_name', :name_tag => name, :count_tag => count)
|
||||||
%b= name
|
|
||||||
Count:
|
|
||||||
%b= count
|
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,44 @@ en:
|
||||||
many: "%{count} users found"
|
many: "%{count} users found"
|
||||||
other: "%{count} users found"
|
other: "%{count} users found"
|
||||||
stats:
|
stats:
|
||||||
go: go
|
week: "Week"
|
||||||
|
2weeks: "2 Week"
|
||||||
|
month: "Month"
|
||||||
|
daily: "Daily"
|
||||||
|
usage_statistic: "Usage Statistics"
|
||||||
|
go: "go"
|
||||||
|
display_results: "Displaying results from the <b>%{segment}</b> segment"
|
||||||
|
posts:
|
||||||
|
zero: "%{count} posts"
|
||||||
|
one: "%{count} post"
|
||||||
|
two: "%{count} posts"
|
||||||
|
few: "%{count} posts"
|
||||||
|
many: "%{count} posts"
|
||||||
|
other: "%{count} posts"
|
||||||
|
comments:
|
||||||
|
zero: "%{count} comments"
|
||||||
|
one: "%{count} comment"
|
||||||
|
two: "%{count} comments"
|
||||||
|
few: "%{count} comments"
|
||||||
|
many: "%{count} comments"
|
||||||
|
other: "%{count} comments"
|
||||||
|
shares:
|
||||||
|
zero: "%{count} shares"
|
||||||
|
one: "%{count} share"
|
||||||
|
two: "%{count} shares"
|
||||||
|
few: "%{count} shares"
|
||||||
|
many: "%{count} shares"
|
||||||
|
other: "%{count} shares"
|
||||||
|
users:
|
||||||
|
zero: "%{count} users"
|
||||||
|
one: "%{count} user"
|
||||||
|
two: "%{count} users"
|
||||||
|
few: "%{count} users"
|
||||||
|
many: "%{count} users"
|
||||||
|
other: "%{count} users"
|
||||||
|
current_segment: "The current segment is averaging <b>%{post_yest}</b> posts per user, from <b>%{post_day}</b>"
|
||||||
|
50_most: "50 Most Popular Tags"
|
||||||
|
tag_name: "Tag Name: <b>%{name_tag}</b> Count: <b>%{count_tag}</b>"
|
||||||
application:
|
application:
|
||||||
helper:
|
helper:
|
||||||
unknown_person: "unknown person"
|
unknown_person: "unknown person"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue