Class: Search::QuotePresenter
- Inherits:
-
BasePresenter
show all
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/quote_presenter.rb
Overview
Presenter: quote presenter.
Instance Attribute Summary
#current_account, #options, #url_helper
Instance Method Summary
collapse
#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u
Constructor Details
This class inherits a constructor from BasePresenter
Instance Method Details
#currency_symbol ⇒ Object
22
23
24
|
# File 'app/presenters/search/quote_presenter.rb', line 22
def currency_symbol
Money::Currency.new('USD').symbol
end
|
#customer_link ⇒ Object
16
17
18
19
20
|
# File 'app/presenters/search/quote_presenter.rb', line 16
def customer_link
return unless r.has_columns?(:customer_full_name, :customer_id)
h.link_to r.customer_full_name, h.customer_path(r.customer_id)
end
|
#hold_for_transmission_indicator ⇒ Object
30
31
32
|
# File 'app/presenters/search/quote_presenter.rb', line 30
def hold_for_transmission_indicator
r.hold_for_transmission ? h.fa_icon('ban', style: 'color:red', text: 'Hold') : h.fa_icon('check', style: 'color:green', text: 'Can Release')
end
|
#notes_indicator ⇒ Object
34
35
36
|
# File 'app/presenters/search/quote_presenter.rb', line 34
def notes_indicator
h.notes_popover r.notes
end
|
#quote_link ⇒ Object
8
9
10
|
# File 'app/presenters/search/quote_presenter.rb', line 8
def quote_link
h.link_to r.reference_number, h.quote_path(r)
end
|
#state ⇒ Object
12
13
14
|
# File 'app/presenters/search/quote_presenter.rb', line 12
def state
Quote.human_state_name(r.state)
end
|
#total ⇒ Object
26
27
28
|
# File 'app/presenters/search/quote_presenter.rb', line 26
def total
h.number_to_currency (r.total || 0.00), unit: currency_symbol
end
|