Module: QuickSearchHelper

Defined in:
app/helpers/quick_search_helper.rb

Instance Method Summary collapse

Instance Method Details

#quick_search_icon_for(result_class, size: '2x', family: 'fas', **options) ⇒ Object

Map quick search result classes to Font Awesome icons



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/quick_search_helper.rb', line 3

def quick_search_icon_for(result_class, size: '2x', family: 'fas', **options)
  icon_name = case result_class.to_s
              when 'contact' then 'address-card'
              when 'customer' then 'user-friends'
              when 'publication' then 'book'
              when 'opportunity' then 'business-time'
              when 'item' then 'box-full'
              when 'catalog_item' then 'box-full'
              when 'room_configuration' then 'ruler-triangle'
              when 'quote' then 'ruler-combined'
              when 'shipment' then 'pallet'
              when 'order' then 'box-usd'
              when 'invoice' then 'file-invoice-dollar'
              when 'support_case' then 'user-headset'
              when 'rma' then 'hand-holding-box'
              when 'history' then 'clock-rotate-left'
              else 'question-square'
              end

  fa_icon(icon_name, family: family, class: [options[:class], "fa-#{size}"].compact.join(' '))
end