Module: StatisticsHelper

Defined in:
app/helpers/statistics_helper.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#registrations_status(statistics) ⇒ Object


8
9
10
11
12
13
14
# File 'app/helpers/statistics_helper.rb', line 8

def registrations_status statistics
  if statistics.open_registrations?
    I18n.t('statistics.open')
  else
    I18n.t('statistics.closed')
  end
end

#registrations_status_class(statistics) ⇒ Object


16
17
18
19
20
21
22
# File 'app/helpers/statistics_helper.rb', line 16

def registrations_status_class statistics
  if statistics.open_registrations?
    "serv-enabled"
  else
    "serv-disabled"
  end
end

#service_class(service, available_services) ⇒ Object


32
33
34
35
36
37
38
# File 'app/helpers/statistics_helper.rb', line 32

def service_class service, available_services
  if available_services.include? service.to_s
    "serv-enabled"
  else
    "serv-disabled"
  end
end

#service_status(service, available_services) ⇒ Object


24
25
26
27
28
29
30
# File 'app/helpers/statistics_helper.rb', line 24

def service_status service, available_services
  if available_services.include? service.to_s
    I18n.t('statistics.enabled')
  else
    I18n.t('statistics.disabled')
  end
end