Sha256: 019d7110e548a7ae732712ea6904f0c045b4011cb427dbc4831d6c4942db8cf7

Contents?: true

Size: 619 Bytes

Versions: 24

Compression:

Stored size: 619 Bytes

Contents

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

    before_save :publish
    before_create :default_content

    def should_display_title?
      display_title?
    end

    def display_sidebar?
      display_sidebar
    end

    private

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

    def publish
      self.published = true
    end

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
blacklight-spotlight-0.16.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.15.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.14.2 app/models/spotlight/home_page.rb
blacklight-spotlight-0.14.1 app/models/spotlight/home_page.rb
blacklight-spotlight-0.14.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.13.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.12.1 app/models/spotlight/home_page.rb
blacklight-spotlight-0.12.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.11.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.10.3 app/models/spotlight/home_page.rb
blacklight-spotlight-0.10.2 app/models/spotlight/home_page.rb
blacklight-spotlight-0.10.1 app/models/spotlight/home_page.rb
blacklight-spotlight-0.10.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.9.2 app/models/spotlight/home_page.rb
blacklight-spotlight-0.9.1 app/models/spotlight/home_page.rb
blacklight-spotlight-0.9.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.8.2 app/models/spotlight/home_page.rb
blacklight-spotlight-0.8.1 app/models/spotlight/home_page.rb
blacklight-spotlight-0.8.0 app/models/spotlight/home_page.rb
blacklight-spotlight-0.7.2 app/models/spotlight/home_page.rb