Module: Card::Set::Abstract::Pointer::HtmlViews::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb

Instance Method Summary collapse

Instance Method Details



93
94
95
96
97
98
99
100
101
102
103
104
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 93

def add_item_modal_link
  modal_link "Add Item",
             size: :large,
             class: "btn btn-sm btn-primary _add-item-link",
             path: { view: :filter_items_modal,
                     item: implicit_item_view,
                     filter_card: filter_card.name,
                     slot_selector: filtered_list_slot_class,
                     item_selector: "_filtered-list-item",
                     slot: { hide: [:modal_footer] },
                     filter: { not_ids: card.item_ids.map(&:to_s).join(",") } }
end


106
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 106

def add_item_overlay_link; end

#autocomplete_inputObject



67
68
69
70
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 67

def autocomplete_input
  items = items_for_input
  haml :autocomplete_input, item: items.first, options_card: options_card_name
end

#checkbox_inputObject



72
73
74
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 72

def checkbox_input
  haml :checkbox_input
end

#default_editorObject



48
49
50
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 48

def default_editor
  :list
end

#list_input(args = {}) ⇒ Object



56
57
58
59
60
61
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 56

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

#multiselect_inputObject



87
88
89
90
91
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 87

def multiselect_input
  select_tag "pointer_multiselect-#{unique_id}",
             options_for_select(card.options_hash, card.item_names),
             multiple: true, class: "pointer-multiselect form-control"
end

#radio_inputObject



76
77
78
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 76

def radio_input
  haml :radio_input
end

#select_inputObject



80
81
82
83
84
85
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 80

def select_input
  options = { "-- Select --" => "" }.merge card.options_hash
  select_tag("pointer_select-#{unique_id}",
             options_for_select(options, card.item_name),
             class: "pointer-select form-control")
end

#standard_pointer_coreObject



21
22
23
24
25
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 21

def standard_pointer_core
  with_paging do |paging_args|
    wrap_with :div, standard_pointer_items(paging_args), class: "pointer-list"
  end
end

#standard_pointer_items(paging_args) ⇒ Object



27
28
29
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 27

def standard_pointer_items paging_args
  pointer_items paging_args.extract!(:limit, :offset)
end

#wrap_item(rendered, item_view) ⇒ Object



40
41
42
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/html_views.rb', line 40

def wrap_item rendered, item_view
  %(<div class="pointer-item item-#{item_view}">#{rendered}</div>)
end