Sha256: 54277a3b4a5c6838ad94603be117f42e85a77b12b9d976d0e1569c0e4b518eb2

Contents?: true

Size: 1.62 KB

Versions: 23

Compression:

Stored size: 1.62 KB

Contents

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

  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

  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

  def edit_modal_size
    :large
  end

  def edit_modal_menu
    wrap_with_modal_menu do
      [close_modal_window, render_bridge_link]
    end
  end

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

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
card-1.99.2 mod/edit/set/all/edit_content.rb
card-1.99.1 mod/edit/set/all/edit_content.rb
card-1.99.0 mod/edit/set/all/edit_content.rb