Sha256: 17202e9db6fc0bd78e2bd26493bca17d2527a6573dc09038e5f221f76daba55b
Contents?: true
Size: 1.45 KB
Versions: 28
Compression:
Stored size: 1.45 KB
Contents
module Workarea module Storefront module DisplayContent delegate :css, :javascript, :head_content, to: :content, allow_nil: true def browser_title if content && content.browser_title.present? content.browser_title elsif model.respond_to?(:name) name end end def meta_description return content.meta_description unless content.meta_description.blank? t( 'workarea.storefront.layouts.default_meta_description', site_name: Workarea.config.site_name ) end def open_graph_asset @open_graph_asset ||= if content.open_graph_asset_id.present? Content::Asset.find(content.open_graph_asset_id) elsif (og_default = Content::Asset.open_graph_default).present? og_default else Content::Asset.open_graph_placeholder end rescue Mongoid::Errors::DocumentNotFound @open_graph_asset = Content::Asset.open_graph_placeholder end def content @content ||= Content.for(content_lookup) end def content_blocks content_blocks_for(:default) end def content_blocks_for(area) return [] unless content.present? blocks = content.blocks_for(area).select(&:active?) ContentBlockViewModel.wrap(blocks, options) end private def content_lookup model end end end end
Version data entries
28 entries across 28 versions & 1 rubygems