Module: Www::SupportPortalHelper

Defined in:
app/helpers/www/support_portal_helper.rb

Instance Method Summary collapse

Instance Method Details

#support_portal_line_path(pl) ⇒ Object



11
12
13
14
15
16
17
18
# File 'app/helpers/www/support_portal_helper.rb', line 11

def support_portal_line_path(pl)
  link = if (all_items = pl.all_my_support_items.where.not(sku: 'UDG4-4999').where(visible_for_support: true)).size == 1
           catalog_link(all_items.first, section: :support)
         else
           catalog_link(pl, section: :support)
         end
  link || cms_link('/support')
end

#support_portal_line_url(pl) ⇒ Object



20
21
22
# File 'app/helpers/www/support_portal_helper.rb', line 20

def support_portal_line_url(pl)
  cms_link(support_portal_line_path(pl), host: WEB_HOSTNAME)
end

#support_portal_sorted_product_line_list(product_lines, main_product_line = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'app/helpers/www/support_portal_helper.rb', line 24

def support_portal_sorted_product_line_list(product_lines, main_product_line = nil)
  if main_product_line&.support_sub_lines_sort_method_alpha?
    product_lines.sort_by { |pl| [pl.past_model? ? 1 : 0, pl.effective_support_title] }
  else
    product_lines.sort_by { |pl| [pl.past_model? ? 1 : 0, pl.support_priority, -pl.popularity] }
  end
end

#support_section_header_image(section_id) ⇒ Object



2
3
4
5
6
7
8
9
# File 'app/helpers/www/support_portal_helper.rb', line 2

def support_section_header_image(section_id)
  fn = {
    publications: 'publication.svg'
  }[section_id]
  return unless fn

  inline_svg_tag "svgs/custom/#{fn}"
end