Module: Gaku::AdminHelper

Includes:
PresetsHelper, SharedHelper
Defined in:
app/helpers/gaku/admin_helper.rb

Instance Method Summary collapse

Methods included from SharedHelper

#can_edit?, #disabled?, #genders, #render_flash, #state_load

Methods included from PresetsHelper

#preset_checked?

Instance Method Details

#badge_count(count, text, css_class) ⇒ Object



18
19
20
21
22
23
24
# File 'app/helpers/gaku/admin_helper.rb', line 18

def badge_count(count, text, css_class)
  if count != 0
    "#{text}<span class='badge pull-right #{css_class}'>#{count}</span>".html_safe
  else
    "#{text}<span class='badge pull-right #{css_class}'></span>".html_safe
  end
end

#grading_methods_with_i18nObject



11
12
13
14
15
16
# File 'app/helpers/gaku/admin_helper.rb', line 11

def grading_methods_with_i18n
  Hash[*Gaku::GradingMethod::Types.map do |k|
    [I18n.t("grading_method.#{k}"), k.to_s]
  end.flatten]

end

#nested_header(text) ⇒ Object



7
8
9
# File 'app/helpers/gaku/admin_helper.rb', line 7

def nested_header(text)
   :h4, text
end