statistics_helper.rb 887 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4 5 6 7 8 9 10 11 12 13 14 15
#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

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

Augier's avatar
Augier committed
16 17 18 19 20 21 22 23
  def registrations_status_class statistics
    if statistics.open_registrations?
      "serv-enabled"
    else
      "serv-disabled"
    end
  end

24
  def service_status service, available_services
25
    if available_services.include? service.to_s
26 27 28 29 30 31 32
      I18n.t('statistics.enabled')
    else
      I18n.t('statistics.disabled')
    end
  end

  def service_class service, available_services
33
    if available_services.include? service.to_s
34 35 36 37 38 39
      "serv-enabled"
    else
      "serv-disabled"
    end
  end
end