Module: Card::Set::All::Frame::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod008-card-mod-format/all/frame.rb,
card/tmpsets/set/mod007-card-mod-format/all/frame.rb

Instance Method Summary collapse

Instance Method Details

#frame(&block) ⇒ Object



16
17
18
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 16

def frame &block
  standard_frame(&block)
end

#frame_and_form(action, form_opts = {}, &block) ⇒ Object



46
47
48
49
50
51
52
53
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 46

def frame_and_form action, form_opts={}
  form_opts ||= {}
  frame do
    card_form action, form_opts do
      yield
    end
  end
end

#frame_headerObject



36
37
38
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 36

def frame_header
  _render_header
end

#frame_helpObject



40
41
42
43
44
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 40

def frame_help
  with_class_up "help-text", "alert alert-info" do
    _render :help
  end
end

#panel(&block) ⇒ Object



55
56
57
58
59
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 55

def panel
  wrap_with :div, class: classy("d0-card-frame") do
    yield
  end
end

#standard_frame(slot = true, &block) ⇒ Object



20
21
22
23
24
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 20

def standard_frame slot=true
  with_frame slot do
    wrap_body { yield } if block_given?
  end
end

#view: flashObject



9
10
11
12
13
14
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 9

view :flash, cache: :never, unknown: true, perms: :none do
  flash_notice = params[:flash] || Env.success.flash
  return "" unless flash_notice.present? && focal?

  Array(flash_notice).join "\n"
end

#with_frame(slot = true, header = frame_header, slot_opts = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'card/tmpsets/set/mod008-card-mod-format/all/frame.rb', line 26

def with_frame slot=true, header=frame_header, slot_opts={}
  voo.hide :help
  add_name_context
  wrap slot, slot_opts do
    panel do
      [header, frame_help, render_flash, (yield if block_given?)]
    end
  end
end