Module: Card::Set::Abstract::List::HtmlViews::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb
Instance Method Summary collapse
-
#autocomplete_input ⇒ Object
-
#bar_multiselect_input ⇒ Object
-
#bar_select_input ⇒ Object
-
#box_multiselect_input ⇒ Object
-
#box_select_input ⇒ Object
-
#checkbox_input ⇒ Object
-
#default_input_type ⇒ Object
-
#hidden_input ⇒ Object
-
#list_input(args = {}) ⇒ Object
-
#multiselect_input ⇒ Object
-
#one_line_content ⇒ Object
-
#radio_input ⇒ Object
-
#select_input ⇒ Object
-
#standard_pointer_core ⇒ Object
-
#standard_pointer_items(paging_args) ⇒ Object
-
#view: core ⇒ Object
-
#view: input ⇒ Object
-
#view: list ⇒ Object
-
#view: one_line_content ⇒ Object
-
#wrap_item(rendered, item_view) ⇒ Object
Instance Method Details
#autocomplete_input ⇒ Object
67 68 69 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 67 def autocomplete_input autocomplete_field items_for_input.first, end |
#bar_multiselect_input ⇒ Object
92 93 94 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 92 def raw haml(:click_select_input, item_view: :bar, multiselect: true) end |
#bar_select_input ⇒ Object
84 85 86 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 84 def raw haml(:click_select_input, item_view: :bar, multiselect: false) end |
#box_multiselect_input ⇒ Object
96 97 98 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 96 def box_multiselect_input raw haml(:click_select_input, item_view: :box, multiselect: true) end |
#box_select_input ⇒ Object
88 89 90 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 88 def box_select_input raw haml(:click_select_input, item_view: :box, multiselect: false) end |
#checkbox_input ⇒ Object
71 72 73 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 71 def checkbox_input raw haml(:checkbox_input, submit_on_change: @submit_on_change) end |
#default_input_type ⇒ Object
47 48 49 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 47 def default_input_type :list end |
#hidden_input ⇒ Object
43 44 45 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 43 def hidden_input "" end |
#list_input(args = {}) ⇒ Object
55 56 57 58 59 60 61 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 55 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, options_card: end |
#multiselect_input ⇒ Object
100 101 102 103 104 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 100 def multiselect_input select_tag "pointer_multiselect-#{unique_id}", (card., card.item_names), multiple: true, class: "pointer-multiselect form-control" end |
#one_line_content ⇒ Object
106 107 108 109 110 111 112 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 106 def one_line_content if count == 1 card.first_name else short_content end end |
#radio_input ⇒ Object
75 76 77 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 75 def radio_input raw haml(:radio_input, submit_on_change: @submit_on_change) end |
#select_input ⇒ Object
79 80 81 82 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 79 def select_input select_tag "pointer_select-#{unique_id}", , class: "pointer-select form-control" end |
#standard_pointer_core ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 13 def standard_pointer_core with_paging do |paging_args| wrap_with :div, class: "card-list card-list-#{[:view]} pointer-list" do standard_pointer_items(paging_args) end end end |
#standard_pointer_items(paging_args) ⇒ Object
22 23 24 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 22 def standard_pointer_items paging_args pointer_items(paging_args.extract!(:limit, :offset)).join(voo.separator || "\n") end |
#view: core ⇒ Object
9 10 11 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 9 view :core do standard_pointer_core end |
#view: input ⇒ Object
39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 39 view :input do _render_hidden_content_field + super() end |
#view: list ⇒ Object
51 52 53 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 51 view :list, cache: :never do list_input end |
#view: one_line_content ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 26 view :one_line_content do item_view = implicit_item_view&.to_sym item_view = item_view == :name ? :name : :link wrap_with :div, class: "pointer-list one-line-pointer-list" do # limit to first 10 items to optimize pointer_items(view: item_view, limit: 10, offset: 0).join ", " end end |
#wrap_item(rendered, item_view) ⇒ Object
35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/01_list/html_views.rb', line 35 def wrap_item rendered, item_view %(<div class="pointer-item item-#{item_view}">#{rendered}</div>) end |