2009-05-07 17:18:16 +00:00
|
|
|
class PagesController < ApplicationController
|
|
|
|
|
2009-06-01 06:20:15 +00:00
|
|
|
def index
|
2009-06-01 06:52:37 +00:00
|
|
|
@page = Page.find_by_name('root')
|
2009-06-01 06:20:15 +00:00
|
|
|
if @page
|
|
|
|
render_liquid_page
|
|
|
|
else
|
|
|
|
render :text => 'You need a home page'
|
|
|
|
end
|
|
|
|
end
|
2009-05-07 18:13:27 +00:00
|
|
|
|
2009-05-07 17:18:16 +00:00
|
|
|
def show
|
2009-06-01 06:20:15 +00:00
|
|
|
@page = Page.find_by_name(params[:page_name])
|
2009-05-07 17:18:16 +00:00
|
|
|
|
2009-06-01 02:54:16 +00:00
|
|
|
if @page && !@page.external_link.blank?
|
2009-07-06 08:23:34 +00:00
|
|
|
# redirect_to @page.external_link
|
|
|
|
elsif @page && !@page.use_engine.blank?
|
2009-06-01 02:54:16 +00:00
|
|
|
#model_class = Kernel.const_get( "Announcement" ) # page.use_engine
|
|
|
|
redirect_to announcements_path
|
2009-05-07 17:18:16 +00:00
|
|
|
else
|
2009-06-01 06:20:15 +00:00
|
|
|
render_liquid_page
|
2009-05-07 17:18:16 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|