Sha256: c5da33f3b72118412c48d95359c7518c0155b84bc1401a35f1c542eec42770cc

Contents?: true

Size: 661 Bytes

Versions: 10

Compression:

Stored size: 661 Bytes

Contents

class PagesController < ApplicationController

  def home
    @page = Page.find_by_link_url("/", :include => [:parts, :slugs])
    error_404 if @page.nil?
  end

  def show
    @page = Page.find(params[:id], :include => [:parts, :slugs])
		
    error_404 unless @page.live? or (logged_in? and current_user.authorized_plugins.include?("Pages"))
		
    # if the admin wants this to be a "placeholder" page which goes to its first child, go to that instead.
    if @page.skip_to_first_child
      first_live_child = @page.children.find_by_draft(false, :order => "position ASC")
      redirect_to first_live_child.url unless first_live_child.nil?
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
refinerycms-0.9.5.7 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.5.6 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.5.5 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.5.4 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.5.3 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.5.2 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.5.1 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.5 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.4.5 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.4.4 vendor/plugins/pages/app/controllers/pages_controller.rb