Sha256: b1870a004699072690038f2297a8dbf4d0d8e92f9630827e0701d695b7c60c56

Contents?: true

Size: 688 Bytes

Versions: 18

Compression:

Stored size: 688 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  ##
  # Exhibit home page
  class HomePage < Spotlight::Page
    extend FriendlyId
    friendly_id :title, use: [:slugged, :scoped, :finders], scope: [:exhibit, :locale]

    before_save :publish
    before_create :default_content

    class << self
      def default_title_text
        I18n.t('spotlight.pages.index.home_pages.title')
      end
    end

    def should_display_title?
      display_title?
    end

    def display_sidebar?
      display_sidebar
    end

    private

    def publish
      self.published = true
    end

    def default_content
      self.title ||= Spotlight::HomePage.default_title_text
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.2 app/models/spotlight/home_page.rb
blacklight-spotlight-3.0.0.alpha.1 app/models/spotlight/home_page.rb
blacklight-spotlight-2.13.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.12.1 app/models/spotlight/home_page.rb
blacklight-spotlight-2.12.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.11.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.10.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.9.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.8.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.7.2 app/models/spotlight/home_page.rb
blacklight-spotlight-2.7.1 app/models/spotlight/home_page.rb
blacklight-spotlight-2.7.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.6.1.1 app/models/spotlight/home_page.rb
blacklight-spotlight-2.6.1 app/models/spotlight/home_page.rb
blacklight-spotlight-2.6.0 app/models/spotlight/home_page.rb
blacklight-spotlight-2.5.2 app/models/spotlight/home_page.rb
blacklight-spotlight-2.5.1 app/models/spotlight/home_page.rb
blacklight-spotlight-2.5.0 app/models/spotlight/home_page.rb