Module: Interage::BootstrapAlertHelper

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

Instance Method Summary collapse

Instance Method Details

#bootstrap_alert(type, message) ⇒ Object Also known as: bs_alert



5
6
7
8
9
10
11
12
13
14
# File 'lib/interage/bootstrap_alert_helper.rb', line 5

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

  tag.div class: "alert alert-#{type} m-0" do
    concat app_icon(icon)
    concat tag.b(" #{subtitles}: ") if subtitles.present?
    concat message
  end
end

#bootstrap_alert_danger(message) ⇒ Object Also known as: bs_alert_danger



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

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

#bootstrap_alert_default(message) ⇒ Object Also known as: bs_alert_default



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

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

#bootstrap_alert_info(message) ⇒ Object Also known as: bs_alert_info



22
23
24
# File 'lib/interage/bootstrap_alert_helper.rb', line 22

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

#bootstrap_alert_not_found(gender, model) ⇒ Object Also known as: bs_text404



42
43
44
# File 'lib/interage/bootstrap_alert_helper.rb', line 42

def bootstrap_alert_not_found(gender, model)
  bs_alert_info(text404(gender, model))
end

#bootstrap_alert_not_found_female(model) ⇒ Object Also known as: bs_female404



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

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

#bootstrap_alert_not_found_male(model) ⇒ Object Also known as: bs_male404



47
48
49
# File 'lib/interage/bootstrap_alert_helper.rb', line 47

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

#bootstrap_alert_success(message) ⇒ Object Also known as: bs_alert_success



32
33
34
# File 'lib/interage/bootstrap_alert_helper.rb', line 32

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

#bootstrap_alert_warning(message) ⇒ Object Also known as: bs_alert_warning



27
28
29
# File 'lib/interage/bootstrap_alert_helper.rb', line 27

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

#default_not_foundObject Also known as: default404



64
65
66
# File 'lib/interage/bootstrap_alert_helper.rb', line 64

def default_not_found
  t('bootstrap.alert.not_found', default: '')
end

#text_not_found(gender, model) ⇒ Object Also known as: text404



57
58
59
60
61
# File 'lib/interage/bootstrap_alert_helper.rb', line 57

def text_not_found(gender, model)
  attributes = { model: tm(model).downcase, default: default404 }

  t("bootstrap.alert.#{gender}.not_found", **attributes)
end

#text_not_found_female(model) ⇒ Object Also known as: female404



74
75
76
# File 'lib/interage/bootstrap_alert_helper.rb', line 74

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

#text_not_found_male(model) ⇒ Object Also known as: male404



69
70
71
# File 'lib/interage/bootstrap_alert_helper.rb', line 69

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