Class: Search::EmployeeReviewPresenter

Inherits:
BasePresenter
  • Object
show all
Includes:
Presenters::Timeable
Defined in:
app/presenters/search/employee_review_presenter.rb

Overview

Renders CRM employee-review search result rows as HTML cells.

Wraps a ViewEmployeeReview projection and produces links to the
reviewee and review plus formatted reward and charity values.

Direct Known Subclasses

EmployeeReviewTextPresenter

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_account, #options, #url_helper

Instance Method Summary collapse

Methods inherited from BasePresenter

#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

#charities_selectedString

Selected charities joined by commas.

Returns:

  • (String)


36
37
38
# File 'app/presenters/search/employee_review_presenter.rb', line 36

def charities_selected
  r.charities_selected.join(', ')
end

#charity_allocationString

Charity allocation formatted as currency.

Returns:

  • (String)


50
51
52
# File 'app/presenters/search/employee_review_presenter.rb', line 50

def charity_allocation
  h.number_to_currency(r.charity_allocation)
end

#earned_rewardString

Earned reward formatted as currency.

Returns:

  • (String)


43
44
45
# File 'app/presenters/search/employee_review_presenter.rb', line 43

def earned_reward
  h.number_to_currency(r.earned_reward)
end

#remaining_rewardString

Remaining reward formatted as currency.

Returns:

  • (String)


57
58
59
# File 'app/presenters/search/employee_review_presenter.rb', line 57

def remaining_reward
  h.number_to_currency(r.remaining_reward)
end

#review_dateString

Review date rendered through the shared date helper.

Returns:

  • (String)


29
30
31
# File 'app/presenters/search/employee_review_presenter.rb', line 29

def review_date
  h.render_date(r.review_date)
end

Linked review name → employee review show page.

Returns:

  • (ActiveSupport::SafeBuffer)


22
23
24
# File 'app/presenters/search/employee_review_presenter.rb', line 22

def review_link
  h.link_to(r.review_name, h.employee_review_path(r.id))
end

Linked reviewee name → employee show page.

Returns:

  • (ActiveSupport::SafeBuffer)


15
16
17
# File 'app/presenters/search/employee_review_presenter.rb', line 15

def reviewee_link
  h.link_to(r.reviewee_name, h.employee_path(r.reviewee_employee_id))
end