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

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb

Instance Method Summary collapse

Instance Method Details

#board_partsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 22

def board_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 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 38

def edit_success
  # for override
end

#edit_view_hiddenObject



42
43
44
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 42

def edit_view_hidden
  # for override
end

#view: boardObject

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



10
11
12
13
14
15
16
17
18
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 10

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

#view: cardboardObject



20
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 20

view :cardboard, :board

#view: edit_buttonsObject



46
47
48
49
50
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 46

view :edit_buttons do
  button_formgroup do
    [standard_submit_button, edit_cancel_button, delete_button]
  end
end

#view: edit_nestsObject



74
75
76
77
78
79
80
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 74

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

#view: edit_rulesObject



57
58
59
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 57

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

#view: edit_structureObject



61
62
63
64
65
66
67
68
69
70
71
72
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 61

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



53
54
55
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editing.rb', line 53

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