Module: Card::Set::All::Editing::HtmlFormat

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

Instance Method Summary collapse

Instance Method Details

#bridge_partsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 22

def bridge_parts
  voo.show! :edit_type_row

  [
    frame_help,
    _render_edit_name_row(home_view: :edit_name_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. I think this would probably best be handled as an
    # option to #wrap that triggers a new heir voo
    _render_edit_form
  ]
end

#edit_successObject



38
39
40
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 38

def edit_success
  # for override
end

#edit_view_hiddenObject



42
43
44
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 42

def edit_view_hidden
  # for override
end

#view: bridgeObject

—( TOP_LEVEL (used by menu) NEW / EDIT VIEWS )



10
11
12
13
14
15
16
17
18
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 10

view :bridge, perms: :update, unknown: true, cache: :never, wrap: :bridge do
  with_nest_mode :edit do
    add_name_context
    voo.show :help
    wrap true, breadcrumb_data("Editing", "edit") do
      bridge_parts
    end
  end
end

#view: cardboardObject



20
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 20

view :cardboard, :bridge

#view: edit_buttonsObject



46
47
48
49
50
51
52
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 46

view :edit_buttons do
  button_formgroup do
    wrap_with "div", class: "d-flex" do
      [standard_submit_button, edit_cancel_button, delete_button]
    end
  end
end

#view: edit_nestsObject



76
77
78
79
80
81
82
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 76

view :edit_nests, cache: :never do
  frame do
    with_nest_mode :edit do
      multi_card_edit
    end
  end
end

#view: edit_rulesObject



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

view :edit_rules, cache: :never, unknown: true do
  nest current_set_card, view: :bridge_rules_tab
end

#view: edit_structureObject



63
64
65
66
67
68
69
70
71
72
73
74
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 63

view :edit_structure, cache: :never do
  return unless card.structure

  nest card.structure_rule_card, view: :edit
  # FIXME: this stuff:
  #  slot: {
  #    cancel_slot_selector: ".card-slot.related-view",
  #    cancel_path: card.format.path(view: :edit), hide: :edit_toolbar,
  #    hidden: { success: { view: :open, "slot[subframe]" => true } }
  #  }
  # }
end

#view: just_deletedObject

TODO: add undo functionality



55
56
57
# File 'card/tmpsets/set/mod012-card-mod-edit/all/editing.rb', line 55

view :just_deleted, unknown: true do
  wrap { "#{render_title} deleted" }
end