Module: Admin::OverviewHelper

Defined in:
app/helpers/admin/overview_helper.rb

Instance Method Summary collapse

Instance Method Details

#created_at_classes(object) ⇒ Object


2
3
4
5
6
7
8
9
# File 'app/helpers/admin/overview_helper.rb', line 2

def created_at_classes(object)
  today = Time.now.utc.midnight
  created = object.created_at.midnight
  [
    created == today ? 'today' : nil,
    created == today - 1.day ? 'yesterday' : nil,
  ]
end

11
12
13
14
15
16
17
# File 'app/helpers/admin/overview_helper.rb', line 11

def link_to_user_projects(user, language = nil)
  projects = user.projects
  if language
    projects = projects.where(:language => language)
  end
  link_to projects.size, admin_projects_path(:service => user.provider, :user => user.user_name, :language => language)
end