Module: Card::Set::All::EditInline::HtmlFormat

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

Instance Method Summary collapse

Instance Method Details

#cancel_in_place_button(args = {}) ⇒ Object



58
59
60
61
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/edit_inline.rb', line 58

def cancel_in_place_button args={}
  args.reverse_merge! class: "cancel-button btn-sm", href: path
  cancel_button args
end


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

def edit_inline_link view=:edit_inline, align: :left
  align = align == :left ? "ms-2" : "ms-auto"
  link_to_view view, menu_icon, class: "#{align} edit-link", "data-cy": "edit-link"
end

#edit_row(title, content, edit_view) ⇒ Object



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

def edit_row title, content, edit_view
  class_up "card-slot", "d-flex form-group"
  wrap true, class: :row do
    haml :edit_row, title: title,
                    content: content,
                    edit_link: edit_inline_link(edit_view)
  end
end

#view: edit_inlineObject



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

view :edit_inline, perms: :update, unknown: true, cache: :never, wrap: :slot do
  add_name_context
  voo.hide :name_formgroup, :type_formgroup
  with_nest_mode :edit do
    card_form :update, success: edit_success do
      [
        edit_view_hidden,
        _render_content_formgroups,
        _render(voo.buttons_view || :edit_inline_buttons)
      ]
    end
  end
end

#view: edit_inline_buttonsObject



27
28
29
30
31
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/edit_inline.rb', line 27

view :edit_inline_buttons do
  button_formgroup do
    [standard_save_button, cancel_in_place_button, delete_button]
  end
end

#view: edit_name_rowObject



23
24
25
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/edit_inline.rb', line 23

view :edit_name_row do
  edit_row "Name", card.name, :name_form
end

#view: edit_rowObject

TODO: better styling for this so that is reusable At the moment it is used for the name and type field in the board (with fixed 50px width for the title column) and for password and email for accounts (with fixed 75px width for the title column) The view is very similar to labeled but with fixed edit link on the right and a fixed width for the labels so that the content column is aligned There is also the problem that label and content are not vertically aligned



40
41
42
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/edit_inline.rb', line 40

view :edit_row do
  edit_row render_title, render_core, :edit_inline
end