Module: Card::Set::All::RichHtml::Menu::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod021-standard/all/rich_html/menu.rb

Instance Method Summary collapse

Instance Method Details



39
40
41
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 39

def edit_in_bridge_link opts={}
  edit_link :bridge, opts
end


43
44
45
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 43

def edit_link view=:edit, opts={}
  link_to_view view, menu_icon, edit_link_opts(opts.reverse_merge(modal: :lg))
end

Parameters:

  • modal (Symbol) (defaults to: nil)

    modal size



48
49
50
51
52
53
54
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 48

def edit_link_opts modal: nil
  opts = { class: classy("edit-link") }
  if modal
    opts.merge! "data-slotter-mode": "modal", "data-modal-class": "modal-#{modal}"
  end
  opts
end

#full_page_iconObject



64
65
66
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 64

def full_page_icon
  icon_tag :open_in_new
end


35
36
37
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 35

def full_page_link
  link_to_card card, full_page_icon, class: classy("full-page-link")
end


60
61
62
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 60

def menu_icon
  material_icon "edit"
end


16
17
18
19
20
21
22
23
24
25
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 16

def menu_link
  case voo.edit
  when :inline
    edit_inline_link
  when :full
    edit_in_bridge_link
  else # :standard
    edit_link
  end
end


56
57
58
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 56

def menu_link_classes
  "nodblclick" + (show_view?(:hover_link) ? " _show-on-hover" : "")
end

#show_menu_item_edit?Boolean

Returns:

  • (Boolean)


68
69
70
71
72
# File 'tmpsets/set/mod021-standard/all/rich_html/menu.rb', line 68

def show_menu_item_edit?
  return unless card.real?

  card.ok?(:update) || structure_editable?
end