2015-05-01 04:39:11 -04:00
|
|
|
module PageLayoutHelper
|
|
|
|
def page_title(*titles)
|
|
|
|
@page_title ||= []
|
|
|
|
|
|
|
|
@page_title.push(*titles.compact) if titles.any?
|
|
|
|
|
|
|
|
@page_title.join(" | ")
|
|
|
|
end
|
|
|
|
|
|
|
|
def header_title(title = nil, title_url = nil)
|
|
|
|
if title
|
|
|
|
@header_title = title
|
|
|
|
@header_title_url = title_url
|
|
|
|
else
|
|
|
|
@header_title_url ? link_to(@header_title, @header_title_url) : @header_title
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def sidebar(name = nil)
|
|
|
|
if name
|
|
|
|
@sidebar = name
|
|
|
|
else
|
|
|
|
@sidebar
|
|
|
|
end
|
|
|
|
end
|
2015-08-26 05:51:28 -04:00
|
|
|
|
|
|
|
def fluid_layout(enabled = false)
|
|
|
|
if @fluid_layout.nil?
|
|
|
|
@fluid_layout = enabled
|
|
|
|
else
|
|
|
|
@fluid_layout
|
|
|
|
end
|
|
|
|
end
|
2015-09-09 17:29:19 -04:00
|
|
|
|
|
|
|
def blank_container(enabled = false)
|
|
|
|
if @blank_container.nil?
|
|
|
|
@blank_container = enabled
|
|
|
|
else
|
|
|
|
@blank_container
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def container_class
|
|
|
|
css_class = "container-fluid"
|
|
|
|
|
2015-09-10 03:51:37 -04:00
|
|
|
unless fluid_layout
|
2015-09-09 17:29:19 -04:00
|
|
|
css_class += " container-limited"
|
|
|
|
end
|
|
|
|
|
|
|
|
if blank_container
|
|
|
|
css_class += " container-blank"
|
|
|
|
end
|
|
|
|
|
|
|
|
css_class
|
|
|
|
end
|
2015-05-01 04:39:11 -04:00
|
|
|
end
|