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]
|
||||
when "week"
|
||||
range = 1.week
|
||||
@segment = "week"
|
||||
@segment = t('admins.stats.week')
|
||||
when "2weeks"
|
||||
range = 2.weeks
|
||||
@segment = "2 week"
|
||||
@segment = t('admins.stats.2weeks')
|
||||
when "month"
|
||||
range = 1.month
|
||||
@segment = "month"
|
||||
@segment = t('admins.stats.month')
|
||||
else
|
||||
range = 1.day
|
||||
@segment = "daily"
|
||||
@segment = t('admins.stats.daily')
|
||||
end
|
||||
|
||||
[Post, Comment, AspectMembership, User].each do |model|
|
||||
|
|
|
|||
|
|
@ -1,31 +1,28 @@
|
|||
|
||||
.span-24
|
||||
= render :partial => 'admins/admin_bar'
|
||||
= render :partial => 'admins/admin_bar.haml'
|
||||
%br
|
||||
%br
|
||||
|
||||
.span-24.last
|
||||
%h1
|
||||
Usage Statistics
|
||||
= t('.usage_statistic')
|
||||
%div{:style => "float:right;"}
|
||||
= form_tag('/admins/stats', :method => 'get') do
|
||||
%select{:name => 'range'}
|
||||
%option{:value => 'daily', :selected => ('selected' if params[:range] == 'daily')}
|
||||
Daily
|
||||
= t('.daily')
|
||||
%option{:value => 'week', :selected => ('selected' if params[:range] == 'week')}
|
||||
Week
|
||||
= t('.week')
|
||||
%option{:value => '2weeks', :selected => ('selected' if params[:range] == '2weeks')}
|
||||
2 Weeks
|
||||
= t('.2weeks')
|
||||
%option{:value => 'month', :selected => ('selected' if params[:range] == 'month')}
|
||||
Month
|
||||
= t('.month')
|
||||
|
||||
= submit_tag 'go'
|
||||
= submit_tag t('.go')
|
||||
%br
|
||||
%h3
|
||||
Displaying results from the
|
||||
%b
|
||||
= @segment
|
||||
segment
|
||||
!= t('.display_results', :segment => @segment)
|
||||
|
||||
%br
|
||||
%br
|
||||
|
|
@ -38,11 +35,16 @@
|
|||
- [:posts, :comments, :aspect_memberships, :users].each do |name|
|
||||
- model = eval("@#{name.to_s}")
|
||||
- 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;'}
|
||||
= model[:yesterday]
|
||||
= name.to_s
|
||||
%h4
|
||||
= model[:day_before]
|
||||
|
|
@ -54,21 +56,12 @@
|
|||
%br
|
||||
%hr
|
||||
|
||||
|
||||
%p{:style => "text-align:center;"}
|
||||
The current segment is averaging
|
||||
%b
|
||||
#{@posts[:yesterday]/@user_count.to_f}
|
||||
posts per user, from
|
||||
%b
|
||||
#{@posts[:day_before]/@user_count.to_f}
|
||||
!= t('.current_segment', :post_yest => @posts[:yesterday]/@user_count.to_f, :post_day => @posts[:day_before]/@user_count.to_f)
|
||||
|
||||
.span-24.last
|
||||
%h3
|
||||
50 Most Popular Tags
|
||||
= t('.50_most')
|
||||
- @popular_tags.each do |name,count|
|
||||
Tag Name:
|
||||
%b= name
|
||||
Count:
|
||||
%b= count
|
||||
!= t('.tag_name', :name_tag => name, :count_tag => count)
|
||||
%br
|
||||
|
|
|
|||
|
|
@ -102,7 +102,44 @@ en:
|
|||
many: "%{count} users found"
|
||||
other: "%{count} users found"
|
||||
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:
|
||||
helper:
|
||||
unknown_person: "unknown person"
|
||||
|
|
|
|||
Loading…
Reference in a new issue