Module: Golden::Theme::Bootstrap::ModalHelper

Defined in:
lib/golden/theme/bootstrap/modal_helper.rb

Instance Method Summary collapse

Instance Method Details

#bootstrap_modal_close_buttonObject



42
43
44
45
46
47
48
49
50
# File 'lib/golden/theme/bootstrap/modal_helper.rb', line 42

def bootstrap_modal_close_button
  options = {
    type: 'button',
    name: nil,
    data: { dismiss: 'modal' },
    class: 'btn btn-default'
  }
  button_tag t('helpers.close'), options
end

#bootstrap_modal_close_iconObject



52
53
54
55
56
57
58
59
60
# File 'lib/golden/theme/bootstrap/modal_helper.rb', line 52

def bootstrap_modal_close_icon
  options = {
    type: 'button',
    name: nil,
    data: { dismiss: 'modal' },
    class: 'close'
  }
  button_tag '×'.html_safe, options
end


29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/golden/theme/bootstrap/modal_helper.rb', line 29

def bootstrap_modal_edit_link_to url, modal_id, options = {}
  options = {
    remote: true,
    data: {
      toggle: 'modal',
      target: modal_id,
      type: 'html'
    },
    class: 'modal-open btn btn-default'
  }.deep_merge options
  bootstrap_link_to_edit url, options
end


16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/golden/theme/bootstrap/modal_helper.rb', line 16

def bootstrap_modal_open_iconed_link_to text, url, modal_id, options = {}
  options = {
    remote: true,
    data: {
      toggle: 'modal',
      target: modal_id,
      type: 'html'
    },
    class: 'modal-open'
  }.deep_merge options
  bootstrap_iconed_link_to text, url, options
end


3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/golden/theme/bootstrap/modal_helper.rb', line 3

def bootstrap_modal_open_link_to text, url, modal_id, options = {}
  options = {
    remote: true,
    data: {
      toggle: 'modal',
      target: modal_id,
      type: 'html'
    },
    class: 'modal-open'
  }.deep_merge options
  link_to text, url, options
end