Module: Card::Set::All::EditContent::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod012-card-mod-edit/all/edit_content.rb,
card/tmpsets/set/mod011-card-mod-edit/all/edit_content.rb

Instance Method Summary collapse

Instance Method Details

#edit_formObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'card/tmpsets/set/mod012-card-mod-edit/all/edit_content.rb', line 16

def edit_form
  voo.hide :edit_type_row
  form_opts = edit_form_opts.reverse_merge success: edit_success
  card_form(:update, form_opts) do
    [
      edit_view_hidden,
      _render_edit_type_row(home_view: :edit_type_row),
      # home_view is necessary for cancel to work correctly.
      # it seems a little strange to have to think about home_view here,
      # but the issue is that something currently has to happen prior to the
      # render to get voo.slot_options to have the write home view in
      # the slot wrap. Id think this would probably best be handled as an
      # option to #wrap that triggers a new heir voo
      _render_content_formgroups,
      _render_edit_buttons
    ]
  end
end

#edit_form_optsObject



63
64
65
66
# File 'card/tmpsets/set/mod012-card-mod-edit/all/edit_content.rb', line 63

def edit_form_opts
  # for override
  { "data-slot-selector": "modal-origin", "data-slot-error-selector": ".card-slot" }
end

#edit_modal_menuObject



57
58
59
60
61
# File 'card/tmpsets/set/mod012-card-mod-edit/all/edit_content.rb', line 57

def edit_modal_menu
  wrap_with_modal_menu do
    [close_modal_window, render_bridge_link]
  end
end

#edit_modal_sizeObject



53
54
55
# File 'card/tmpsets/set/mod012-card-mod-edit/all/edit_content.rb', line 53

def edit_modal_size
  :large
end

#view: editObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'card/tmpsets/set/mod012-card-mod-edit/all/edit_content.rb', line 35

view :edit, perms: :update, unknown: true, cache: :never,
            wrap: { modal: { footer: "",
                             size: :edit_modal_size,
                             title: :render_title,
                             menu: :edit_modal_menu } } do
  add_name_context
  with_nest_mode :edit do
    voo.show :help
    voo.hide :save_button
    wrap true do
      [
        frame_help,
        _render_edit_form
      ]
    end
  end
end

#view: edit_formObject



9
10
11
12
13
14
# File 'card/tmpsets/set/mod012-card-mod-edit/all/edit_content.rb', line 9

view :edit_form, wrap: :slot do
  voo.show :edit_type_row
  with_nest_mode :edit do
    edit_form
  end
end