Class: Www::CustomMatsPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Www::CustomMatsPresenter
- Includes:
- ApplicationHelper, Memery
- Defined in:
- app/presenters/www/custom_mats_presenter.rb
Overview
Presenter for the TempZone Custom Mats static product page.
This page doesn't have actual product variants but displays product-like
information with a gallery, sections, FAQs, and documents.
Uses the tag system to pull in related content:
- Videos tagged with the page tag
- Publications tagged with the page tag
- Posts tagged with the page tag
Constant Summary collapse
- PAGE_PATH =
Page path used for generating the page tag (e.g., 'for-floor-heating-custom-mats-page')
'floor-heating/custom-mats'- IDENTIFIER =
Static page identifier used for gallery IDs, etc.
'tempzone-custom-mats'- PRODUCT_LINE_SLUG_LTREE =
Product line slug path (slug_ltree) for FAQs and other product-line-specific content
LtreePaths::PL_FLOOR_HEATING_TEMPZONE_CUSTOM_MAT
- GALLERY_IMAGES =
Image asset IDs for the gallery
[ { id: 5680, title: 'TempZone Custom Mat Close Up' }, { id: 7178, title: 'TempZone Custom Mat on Thinset' }, { id: 'tempzone-custom-mat-unrolled-c39436', title: 'TempZone Custom Mat Unrolled' }, { id: 5681, title: 'Custom TempZone Heating Mat Installation for Bathroom Floor' }, { id: 5675, title: 'TempZone Custom Mat with Floor Sensor' }, { id: 23_466, title: 'TempZone Custom Mat SmartPlan' } ].freeze
- GALLERY_VIDEOS =
Video slugs for the gallery (specific videos to show in carousel)
%w[ tempzone-custom-mat-floor-heat-system-intro how-to-install-tempzone-custom-mat ].freeze
Constants included from ApplicationHelper
ApplicationHelper::CF_WEB_ANALYTICS_SKIP_PATHS, ApplicationHelper::MARKDOWN_ALLOWED_ATTRIBUTES, ApplicationHelper::MARKDOWN_ALLOWED_TAGS
Constants included from SeoHelper
SeoHelper::AWARDS, SeoHelper::CA_ADDRESS, SeoHelper::CA_BUSINESS_HOURS, SeoHelper::CA_CONTACT_POINT, SeoHelper::CA_CURRENCIES, SeoHelper::CA_DESCRIPTION, SeoHelper::CA_FOUNDING_DATE, SeoHelper::CA_GLOBAL_LOCATION_NUMBER, SeoHelper::CA_LEGAL_NAME, SeoHelper::CA_LOCAL_BUSINESS, SeoHelper::CA_ONLINE_STORE, SeoHelper::CA_RETURN_POLICY, SeoHelper::CA_SALES_DEPARTMENT, SeoHelper::CA_SERVICE_AREA, SeoHelper::CA_URL, SeoHelper::CA_VAT_ID, SeoHelper::CA_WAREHOUSE_DEPARTMENT, SeoHelper::CA_WAREHOUSE_HOURS, SeoHelper::COMPANY_EMAIL, SeoHelper::COMPANY_LOGO, SeoHelper::COMPANY_NAME, SeoHelper::COMPANY_SLOGAN, SeoHelper::EXPERTISE, SeoHelper::FAX_NUMBER, SeoHelper::GS1_COMPANY_PREFIX, SeoHelper::ISO6523_CODE, SeoHelper::PAYMENT_METHODS, SeoHelper::PHONE_NUMBER, SeoHelper::PRIMARY_NAICS, SeoHelper::REFUND_TYPE, SeoHelper::RETURN_FEES, SeoHelper::RETURN_METHOD, SeoHelper::RETURN_POLICY_CATEGORY, SeoHelper::SECONDARY_NAICS, SeoHelper::SOCIAL_PROFILES, SeoHelper::US_ADDRESS, SeoHelper::US_BUSINESS_HOURS, SeoHelper::US_CONTACT_POINT, SeoHelper::US_CURRENCIES, SeoHelper::US_DESCRIPTION, SeoHelper::US_FOUNDING_DATE, SeoHelper::US_GLOBAL_LOCATION_NUMBER, SeoHelper::US_IMAGE, SeoHelper::US_LEGAL_NAME, SeoHelper::US_LOCAL_BUSINESS, SeoHelper::US_ONLINE_STORE, SeoHelper::US_RETURN_POLICY, SeoHelper::US_SALES_DEPARTMENT, SeoHelper::US_SERVICE_AREA, SeoHelper::US_TAX_ID, SeoHelper::US_URL, SeoHelper::US_WAREHOUSE_DEPARTMENT, SeoHelper::US_WAREHOUSE_HOURS
Constants included from IconHelper
IconHelper::CUSTOM_ICON_MAP, IconHelper::CUSTOM_SVG_DIR, IconHelper::DEFAULT_FAMILY
Instance Method Summary collapse
- #breadcrumb_links_array ⇒ Object
- #carousel_assets ⇒ Object
- #controls_and_accessories ⇒ Object
- #description_html ⇒ Object
- #documents ⇒ Object
-
#documents_section? ⇒ Boolean
Combined check for documents section (publications + posts).
- #example_project ⇒ Object
- #faqs ⇒ Object
- #features ⇒ Object
- #gallery_images ⇒ Object
- #gallery_videos ⇒ Object
- #identifier ⇒ Object
-
#initialize(view = nil) ⇒ CustomMatsPresenter
constructor
A new instance of CustomMatsPresenter.
- #learn_more_url ⇒ Object
- #page_description ⇒ Object
-
#page_tag ⇒ Object
The page tag for this page, following the convention: 'for-' + page_path.tr('/', '-').parameterize + '-page' e.g., 'for-floor-heating-custom-mats-page'.
- #page_title ⇒ Object
-
#posts ⇒ Object
Blog posts tagged with the page tag.
- #posts? ⇒ Boolean
- #product_sample_url ⇒ Object
-
#publications ⇒ Object
Publications tagged with the page tag Uses the same helper pattern as other landing pages.
- #publications? ⇒ Boolean
- #quote_builder_url ⇒ Object
- #reviews_url ⇒ Object
-
#sections ⇒ Object
Sections configuration for the navigation and content Only includes sections that have content.
- #subtitle ⇒ Object
- #support_url ⇒ Object
-
#tagged_videos ⇒ Object
Videos tagged with the page tag (for video section, not gallery).
- #tagged_videos? ⇒ Boolean
- #title ⇒ Object
Methods included from ApplicationHelper
#better_number_to_currency, #cf_web_analytics?, #check_or_cross, #check_or_times, #embedded_tab_frame_id, #error_messages, #general_disclaimer_on_product_installation_and_local_codes, #markdown_to_html, #parent_layout, #pass_or_fail, #render_error_messages_list, #render_video_card, #resolved_auth_form_turbo_frame, #return_path_or, #safe_css_color, #set_return_path_if_present, #set_section_if_present, #tab_frame_id, #to_underscore, #turbo_section_wrapper, #turbo_tabs_request?, #url_on_same_domain_as_request, #working_hours?, #yes_or_no, #yes_or_no_highlighted, #yes_or_no_with_check_or_cross
Methods included from UppyUploaderHelper
#file_uploader, #image_uploader, #large_file_uploader_s3, #lead_sketch_uploader, #public_warranty_card_uploader, #rma_image_uploader, #rma_image_uploader_s3, #uppy_uploader, #video_uploader, #warranty_card_uploader
Methods included from ImagesHelper
#image_asset_tag, #image_asset_url, #picture_asset_tag
Methods included from SeoHelper
#add_page_schema, #add_webpage_schema, #canada?, #collect_schema, #company_social_links, #ensure_context_json, #json_ld_script_tag, #local_business_schema, #online_store_id, #online_store_schema, #page_main_entity, #page_main_entity_json, #render_auto_collection_page_schema, #render_collection_page_schema, #render_local_business_schema, #render_online_store_schema, #render_page_schemas, #render_page_video_schemas, #render_webpage_schema, #render_webpage_schema_with_collections, #usa?
Methods included from UrlsHelper
#catalog_breadcrumb_links, #catalog_link, #catalog_link_for_product_line, #catalog_link_for_sku, #cms_link, #delocalized_path, #path_to_sales_product_sku, #path_to_sales_product_sku_for_product_line, #path_to_sales_product_sku_for_product_line_slug, #product_line_from_catalog_link, #protocol_neutral_url, #sanitize_external_url, #valid_external_url?
Methods included from IconHelper
#account_nav_icon, #fa_icon, #star_rating_html
Constructor Details
#initialize(view = nil) ⇒ CustomMatsPresenter
Returns a new instance of CustomMatsPresenter.
41 42 43 44 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 41 def initialize(view = nil) @view = view || ApplicationController.helpers super(nil, @view) end |
Instance Method Details
#breadcrumb_links_array ⇒ Object
74 75 76 77 78 79 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 74 def [ { name: 'Radiant Floor Heating', url: h.cms_link('/floor-heating') }, { name: 'TempZone™ Custom Mats' } ] end |
#carousel_assets ⇒ Object
134 135 136 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 134 def carousel_assets gallery_images + gallery_videos end |
#controls_and_accessories ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 153 def controls_and_accessories [ { title: 'Floor Heating Controls', image_slug: 'nspire-touch-udg4-4999-wy-logo-front-7c2048', url: h.cms_link('/floor-heating/thermostats'), description: 'Programmable, WiFi, and nonprogrammable thermostats with built-in Class A GFCI and floor sensing to control your custom mat precisely.', features: [ 'Touchscreen, WiFi & nonprogrammable options', 'Built-in Class A GFCI ground-fault protection', 'Floor + ambient temperature sensing', 'Works with every TempZone™ Custom Mat' ] }, { title: 'Underlayment', image_slug: 'thermalsheet-insulating-underlayment-2-vstfzw', # digital_assets id 19709 url: h.cms_link('/floor-heating/underlayment'), description: 'ThermalSheet insulating underlayment reflects heat upward, shortens warm-up time, and lowers operating cost over slabs and unheated spaces.', features: [ 'Synthetic-cork thermal break (1.5 R-value)', 'Faster warm-up and lower running cost', 'Crack isolation up to 1/4"', 'Use under tile, stone, LVT & laminate' ] }, { title: 'Circuit Check', image_slug: 'warmlyyours-circuit-check-amazon-ae1e2c', url: h.catalog_link(::Item.find_by!(sku: 'SS-01')), description: 'A pocket-size continuity monitor that beeps the instant a heating element is nicked—so damage is caught and fixed before you tile over it.', features: [ 'Clips to the mat during installation', 'Audible alarm on a damaged element', 'Catches faults before they are buried', 'Reusable on every project' ] }, { title: 'Electrical Rough-In Kits for Thermostats', image_slug: 'floor-heating-rough-in-kits-02ad97', url: h.catalog_link(::ProductLine.find_by!(slug_ltree: LtreePaths::PL_FLOOR_HEATING_ROUGH_IN_KITS)), description: 'Pre-assembled rough-in kits with the box, conduit, and connectors needed to wire your thermostat to code—no guesswork at the wall.', features: [ 'Everything for a clean thermostat rough-in', 'Single- and multi-gang options', 'Speeds up the electrical phase', 'Code-compliant components' ] } ] end |
#description_html ⇒ Object
81 82 83 84 85 86 87 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 81 def description_html <<~HTML.html_safe <p>Our <a href="#{h.cms_link('/posts/WarmlyYours-Upgrades-Custom-Floor-Heating-Mats-3058')}">recently upgraded custom-sized electric heating mats</a> arrive in one piece, making for a fast, simple installation — you don't have to make any cuts or trims. TempZone™ Custom Mats are commonly used beneath tile or stone flooring. These floor mats provide 12-15 watts/sq. ft., depending on the room size, and evenly distribute heat for full room coverage.</p> <p>The mats feature a layered construction with the heating element sandwiched between two durable layers of fabric. WarmlyYours will help you design the perfect floor-heating system with free overnight design services. Each custom mat is made to order and is non-refundable.</p> <p>Please allow for <span class="fw-semibold">at least 8 to 10 business days</span> after the point of purchase for this customized item to ship.</p> HTML end |
#documents ⇒ Object
206 207 208 209 210 211 212 213 214 215 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 206 def documents [ { name: 'TempZone™ Custom Mat Installation Manual', publication_sku: 'TZ-CUSTOM-FIT-MANUAL' }, { name: 'TempZone™ Custom Mat Materials & Tools Checklist', publication_sku: 'TEMPZONE-CUSTOM-MAT-MATERIALS-AND-TOOLS-CHECKLIST' }, { name: 'TempZone™ Custom Mat Specification Sheet', publication_sku: 'TEMPZONE-CUSTOM-MAT-SPEC-SHEET' }, { name: 'TempZone™ Custom Mat Sell Sheet', publication_sku: 'TEMPZONE-CUSTOM-MAT-SELL-SHEET' }, { name: 'nSpiration Series Thermostat Wiring Diagram for TempZone™ Custom Mats', publication_sku: 'OJ-TZ-SINGLE-MULTI-WD' }, { name: 'Mysa WiFi Thermostat Wiring Diagram for TempZone™ Custom Mats', publication_sku: 'MYSA-WI-FI-THERMOSTAT-TEMPZONE-SINGLE-CONDUCTOR-ROLL-MULTI-MAT-WIRING-DIAGRAM' } ] end |
#documents_section? ⇒ Boolean
Combined check for documents section (publications + posts)
254 255 256 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 254 def documents_section? publications? || posts? end |
#example_project ⇒ Object
139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 139 def example_project { image_slug: 'tempzone-custom-mat-smartplan-a3ebb5', flooring: 'Tile, Marble or Stone', subfloor: 'Wood', room_type: 'Bathroom', coverage: '100%', price: '$729.00 MSRP (USD)', voltage: '120 VAC', wattage: '376 Watts', operating_cost: '2 cents per hour' } end |
#faqs ⇒ Object
217 218 219 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 217 def faqs Article.faqs.published.for_product_line_url_with_descendants(PRODUCT_LINE_SLUG_LTREE).with_votes end |
#features ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 89 def features [ { title: 'Maximum Coverage', description: 'Full coverage for any size space, such as bathrooms, kitchens, living rooms, or basements.' }, { title: 'Easy to Install', description: 'Easiest installation, no cut and turns required.' }, { title: 'Clean Heat', description: "Doesn't disturb pollen, dust or other allergens like forced-air systems." }, { title: 'Safe', description: 'ETL listed' } ] end |
#gallery_images ⇒ Object
110 111 112 113 114 115 116 117 118 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 110 def gallery_images GALLERY_IMAGES.map do |img_data| OpenStruct.new( id: img_data[:id], title: img_data[:title], type: :image ) end end |
#gallery_videos ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 120 def gallery_videos GALLERY_VIDEOS.filter_map do |slug| video = Video.find_by(slug: slug) next unless video OpenStruct.new( video: video, slug: slug, title: video.seo_title, type: :video ) end end |
#identifier ⇒ Object
54 55 56 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 54 def identifier IDENTIFIER end |
#learn_more_url ⇒ Object
321 322 323 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 321 def learn_more_url h.cms_link('/floor-heating') end |
#page_description ⇒ Object
70 71 72 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 70 def page_description 'Offering electric floor heating options for under tile, stone, hardwood and carpet, WarmlyYours makes houses into homes with floor warming systems.' end |
#page_tag ⇒ Object
The page tag for this page, following the convention:
'for-' + page_path.tr('/', '-').parameterize + '-page'
e.g., 'for-floor-heating-custom-mats-page'
49 50 51 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 49 def page_tag DigitalAsset.page_tag_for(PAGE_PATH) end |
#page_title ⇒ Object
66 67 68 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 66 def page_title 'Custom Electric Mats | Floor Heating Systems | Electric Heated Floor Warming' end |
#posts ⇒ Object
Blog posts tagged with the page tag
244 245 246 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 244 def posts Post.published.tagged_with(page_tag).order(published_at: :desc) end |
#posts? ⇒ Boolean
249 250 251 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 249 def posts? posts.any? end |
#product_sample_url ⇒ Object
312 313 314 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 312 def product_sample_url h.cms_link('/contact/product-sample') end |
#publications ⇒ Object
Publications tagged with the page tag
Uses the same helper pattern as other landing pages
234 235 236 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 234 def publications h.find_publications_by_tag_in_current_locale(page_tag) end |
#publications? ⇒ Boolean
239 240 241 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 239 def publications? publications.any? end |
#quote_builder_url ⇒ Object
308 309 310 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 308 def quote_builder_url h.cms_link('/quote') end |
#reviews_url ⇒ Object
325 326 327 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 325 def reviews_url h.cms_link('/floor-heating/reviews') end |
#sections ⇒ Object
Sections configuration for the navigation and content
Only includes sections that have content
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 260 def sections s = {} s[:description] = { nav_name: 'Description', section_name: 'Description' } s[:'example-project'] = { nav_name: 'Example Project', section_name: 'Example Project' } s[:controls] = { nav_name: 'Controls & Accessories', section_name: 'Controls & Accessories' } if tagged_videos? s[:videos] = { nav_name: 'Videos', section_name: 'Videos' } end if faqs.any? s[:faqs] = { nav_name: 'FAQs', section_name: 'Frequently Asked Questions' } end if documents_section? s[:documents] = { nav_name: 'Documents', section_name: 'Documents & Articles' } end s[:reviews] = { nav_name: 'Reviews', section_name: 'Customer Reviews' } s end |
#subtitle ⇒ Object
62 63 64 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 62 def subtitle 'Electric Custom Mats for Heated Floors' end |
#support_url ⇒ Object
316 317 318 319 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 316 def support_url pl = ProductLine.find_by(slug_ltree: PRODUCT_LINE_SLUG_LTREE) pl ? h.catalog_link(pl, section: :support) : h.cms_link('/support') end |
#tagged_videos ⇒ Object
Videos tagged with the page tag (for video section, not gallery)
223 224 225 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 223 def tagged_videos Video.public_videos.tagged_with(page_tag).order(created_at: :desc) end |
#tagged_videos? ⇒ Boolean
228 229 230 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 228 def tagged_videos? tagged_videos.any? end |
#title ⇒ Object
58 59 60 |
# File 'app/presenters/www/custom_mats_presenter.rb', line 58 def title 'TempZone™ Custom Mats' end |