Module: Card::Set::Type::NestList::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod009-card-mod-list/type/nest_list.rb,
card/tmpsets/set/mod008-card-mod-list/type/nest_list.rb

Instance Method Summary collapse

Instance Method Details

#input_typeObject



30
31
32
# File 'card/tmpsets/set/mod009-card-mod-list/type/nest_list.rb', line 30

def input_type
  :nest_list
end

#items_for_input(items = nil) ⇒ Object



42
43
44
45
# File 'card/tmpsets/set/mod009-card-mod-list/type/nest_list.rb', line 42

def items_for_input items=nil
  items ||= card.item_names context: :raw
  items.empty? ? [["", ""]] : items.zip(card.item_options)
end

#nest_list_input(args = {}) ⇒ Object



47
48
49
50
51
52
# File 'card/tmpsets/set/mod009-card-mod-list/type/nest_list.rb', line 47

def nest_list_input args={}
  items = items_for_input args[:item_list]
  extra_class = "_nest-list-ul"
  ul_classes = classy "pointer-list-editor", extra_class
  haml :nest_list_input, items: items, ul_classes: ul_classes
end

#view: inputObject



38
39
40
# File 'card/tmpsets/set/mod009-card-mod-list/type/nest_list.rb', line 38

view :input do
  _render_hidden_content_field + super()
end

#view: nest_list_inputObject



34
35
36
# File 'card/tmpsets/set/mod009-card-mod-list/type/nest_list.rb', line 34

view :nest_list_input, cache: :never do
  nest_list_input
end