Module: Interage::BootstrapHelper

Included in:
ApplicationHelper
Defined in:
lib/interage/bootstrap_helper.rb

Instance Method Summary collapse

Instance Method Details

#bootstrap_alert(type, message) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/interage/bootstrap_helper.rb', line 5

def bootstrap_alert(type, message)
  icon = t("bootstrap.alert.icons.#{type}", default: type)

   :div, class: "no-margin alert alert-#{type}" do
    app_icon_text(icon, message)
  end
end

#bootstrap_alert_danger(message) ⇒ Object



29
30
31
# File 'lib/interage/bootstrap_helper.rb', line 29

def bootstrap_alert_danger(message)
  bootstrap_alert(:danger, message)
end

#bootstrap_alert_default(message) ⇒ Object



13
14
15
# File 'lib/interage/bootstrap_helper.rb', line 13

def bootstrap_alert_default(message)
  bootstrap_alert(:default, message)
end

#bootstrap_alert_info(message) ⇒ Object



17
18
19
# File 'lib/interage/bootstrap_helper.rb', line 17

def bootstrap_alert_info(message)
  bootstrap_alert(:info, message)
end

#bootstrap_alert_not_found(gender, model) ⇒ Object



33
34
35
# File 'lib/interage/bootstrap_helper.rb', line 33

def bootstrap_alert_not_found(gender, model)
  bootstrap_alert_info(text_not_found(gender, model))
end

#bootstrap_alert_not_found_female(model) ⇒ Object



41
42
43
# File 'lib/interage/bootstrap_helper.rb', line 41

def bootstrap_alert_not_found_female(model)
  bootstrap_alert_not_found(:female, model)
end

#bootstrap_alert_not_found_male(model) ⇒ Object



37
38
39
# File 'lib/interage/bootstrap_helper.rb', line 37

def bootstrap_alert_not_found_male(model)
  bootstrap_alert_not_found(:male, model)
end

#bootstrap_alert_success(message) ⇒ Object



25
26
27
# File 'lib/interage/bootstrap_helper.rb', line 25

def bootstrap_alert_success(message)
  bootstrap_alert(:success, message)
end

#bootstrap_alert_warning(message) ⇒ Object



21
22
23
# File 'lib/interage/bootstrap_helper.rb', line 21

def bootstrap_alert_warning(message)
  bootstrap_alert(:warning, message)
end

#text_not_found(gender, model) ⇒ Object



45
46
47
48
49
50
# File 'lib/interage/bootstrap_helper.rb', line 45

def text_not_found(gender, model)
  default_not_found = t('bootstrap.alert.not_found', default: '')

  t("bootstrap.alert.#{gender}.not_found", model: tm(model).downcase,
                                           default: default_not_found)
end

#text_not_found_female(model) ⇒ Object



56
57
58
# File 'lib/interage/bootstrap_helper.rb', line 56

def text_not_found_female(model)
  text_not_found(:female, model)
end

#text_not_found_male(model) ⇒ Object



52
53
54
# File 'lib/interage/bootstrap_helper.rb', line 52

def text_not_found_male(model)
  text_not_found(:male, model)
end