Class: Search::SupportCasePresenter

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

Overview

Presents support case search results with HTML links and related records.

See Also:

Direct Known Subclasses

SupportCaseTextPresenter

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

#participantsActiveSupport::SafeBuffer

Returns an unordered list of links to support case participants.

Returns:

  • (ActiveSupport::SafeBuffer)

    the participants list



21
22
23
24
25
26
27
28
29
# File 'app/presenters/search/support_case_presenter.rb', line 21

def participants
  h.capture do
    h. :ul, class: 'list-unstyled' do
      r.support_case_participants.select(&:party).each do |scp|
        h.concat h. :li, h.link_to(scp.party.full_name, h.polymorphic_path(scp.party))
      end
    end
  end
end

#roomsActiveSupport::SafeBuffer

Returns an unordered list of links to linked room configurations.

Returns:

  • (ActiveSupport::SafeBuffer)

    the rooms list



34
35
36
37
38
39
40
41
42
# File 'app/presenters/search/support_case_presenter.rb', line 34

def rooms
  h.capture do
    h. :ul, class: 'list-unstyled' do
      r.room_configurations.each do |rc|
        h.concat h. :li, h.link_to(rc.reference_number, h.room_configuration_path(rc.id))
      end
    end
  end
end

Returns a link to the support case.

Returns:

  • (ActiveSupport::SafeBuffer)

    the support case link



14
15
16
# File 'app/presenters/search/support_case_presenter.rb', line 14

def support_case_link
  h.link_to r.case_number, h.support_case_path(r.id)
end