Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
maxwell 2011-01-13 16:29:30 -08:00
commit 600e67d5d1
2 changed files with 10 additions and 6 deletions

View file

@ -5,6 +5,11 @@
module ApplicationHelper
@@youtube_title_cache = Hash.new("no-title")
def timeago(time, options = {})
options[:class] ||= "timeago"
content_tag(:abbr, time.to_s, options.merge(:title => time.getutc.iso8601)) if time
end
def modern_browser?
false
end
@ -95,14 +100,15 @@ module ApplicationHelper
def mine?(post)
current_user.owns? post
end
def type_partial(post)
class_name = post.class.name.to_s.underscore
"#{class_name.pluralize}/#{class_name}"
end
def how_long_ago(obj)
I18n.t('ago', :time => time_ago_in_words(obj.created_at, true))
timeago(obj.created_at)
#I18n.t('ago', :time => time_ago_in_words(obj.created_at, true))
end
def person_url(person)

View file

@ -17,10 +17,8 @@ namespace :statistics do
"last_7d=#{User.where(:current_sign_in_at.gt => Time.now - 7.days).count}, " +
"notification_off=#{User.where(:disable_mail=>true).count}, "+
"notification_off_%=#{User.where(:disable_mail=>true).count.to_f/User.count}, "+
"no_invites=#{User.where(:invites => 0).count} "
puts "event=statistic, type=users, last_7d_%=#{User.where(:current_sign_in_at.gt => Time.now - 7.days).count.to_f/User.count}, " +
"no_invites=#{User.where(:invites => 0).count}, "+
"last_7d_%=#{User.where(:current_sign_in_at.gt => Time.now - 7.days).count.to_f/User.count}, " +
"last_7d_and_notifications_off_%=#{User.where(:current_sign_in_at.gt => Time.now - 7.days, :disable_mail => true).count.to_f/User.where(:disable_mail=>true).count}, " +
"last_7d_and_no_invites_%=#{User.where(:current_sign_in_at.gt => Time.now - 7.days, :invites => 0).count.to_f/User.where(:invites => 0).count}"