Class: Www::RequestSmartplanSectionComponent
- Inherits:
-
ApplicationComponent
show all
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
- Defined in:
- app/components/www/request_smartplan_section_component.rb
Constant Summary
collapse
- PRODUCT_CONFIGS =
Product type configurations
{
floor_heating: {
title: 'Free SmartPlan',
icon: 'ruler-combined',
application_type: 'Floor Heating',
smartplan_link: '/floor-heating/electric-floor-heating-smartplan',
rae_avatar: 'rae-radiant-floor-heating-guide-kppkd5',
rae_quote: "I'll create a custom installation layout showing exactly where your heating elements go, plus a complete materials list with pricing.",
carousel_slides: [
{ image: 'smartplan-installation-master-bathroom-tile-f1965d', alt: 'SmartPlan Installation Layout' },
{ image: 'smartplan-heated-area-master-bathroom-ef6148', alt: 'SmartPlan Heated Area Plan' },
{ image: 'smartplan-itemized-product-quote-master-bathroom-a9d64f', alt: 'SmartPlan Itemized Quote' }
]
},
snow_melting: {
title: 'Free SmartPlan',
icon: 'snowflake',
application_type: 'Snow Melting',
smartplan_link: '/snow-melting/electric-snow-melting-smartplan',
rae_avatar: 'rae-radiant-floor-heating-guide-kppkd5',
rae_quote: "I'll design a custom snow melting layout for your project, complete with cable spacing, electrical requirements, and a full quote.",
carousel_slides: [
{ image: 'patio-snow-melting-example-design-mockup-beae21', alt: 'Patio Snow Melting SmartPlan Layout' },
{ image: 'snow-melting-cable-example-design-mockup-7e8f47', alt: 'Snow Melting Cable Design Layout' }
]
}
}.freeze
Instance Method Summary
collapse
#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags
Constructor Details
#initialize(product_type: :floor_heating, area_name: nil, project_link: nil, border: nil) ⇒ RequestSmartplanSectionComponent
Returns a new instance of RequestSmartplanSectionComponent.
40
41
42
43
44
45
46
47
|
# File 'app/components/www/request_smartplan_section_component.rb', line 40
def initialize(product_type: :floor_heating, area_name: nil, project_link: nil, border: nil)
super()
@product_type = product_type.to_sym
@config = PRODUCT_CONFIGS[@product_type] || PRODUCT_CONFIGS[:floor_heating]
@area_name = area_name || 'project'
@project_link = project_link
@border = border
end
|
Instance Method Details
#application_type ⇒ Object
65
66
67
|
# File 'app/components/www/request_smartplan_section_component.rb', line 65
def application_type
@config[:application_type]
end
|
#border_classes ⇒ Object
49
50
51
52
53
54
55
|
# File 'app/components/www/request_smartplan_section_component.rb', line 49
def border_classes
case @border
when :top then 'border-top'
when :bottom then 'border-bottom'
when :both then 'border-top border-bottom'
end
end
|
#carousel_options ⇒ Object
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'app/components/www/request_smartplan_section_component.rb', line 85
def carousel_options
{
type: 'fade',
perPage: 1,
perMove: 1,
arrows: true,
pagination: true,
autoplay: true,
interval: 4000,
pauseOnHover: true,
rewind: true,
speed: 600
}
end
|
#carousel_slides ⇒ Object
81
82
83
|
# File 'app/components/www/request_smartplan_section_component.rb', line 81
def carousel_slides
@config[:carousel_slides]
end
|
#icon ⇒ Object
61
62
63
|
# File 'app/components/www/request_smartplan_section_component.rb', line 61
def icon
@config[:icon]
end
|
#rae_avatar ⇒ Object
73
74
75
|
# File 'app/components/www/request_smartplan_section_component.rb', line 73
def rae_avatar
@config[:rae_avatar]
end
|
#rae_quote ⇒ Object
77
78
79
|
# File 'app/components/www/request_smartplan_section_component.rb', line 77
def rae_quote
@config[:rae_quote]
end
|
#show_project_link? ⇒ Boolean
100
101
102
|
# File 'app/components/www/request_smartplan_section_component.rb', line 100
def show_project_link?
@project_link.present?
end
|
#smartplan_link ⇒ Object
69
70
71
|
# File 'app/components/www/request_smartplan_section_component.rb', line 69
def smartplan_link
@config[:smartplan_link]
end
|
#title ⇒ Object
57
58
59
|
# File 'app/components/www/request_smartplan_section_component.rb', line 57
def title
@config[:title]
end
|