Added parent-child relationship to pages to visualize a breadcrump and subpages.

This commit is contained in:
Benjamin Meichsner 2009-08-12 18:41:25 +02:00
parent 00619ccf55
commit a8c93c08b7
24 changed files with 513 additions and 51 deletions

View file

@ -95,8 +95,13 @@ module ApplicationHelper
end
# to set a title for both the h1-tag and the title in the header
def title(page_title)
content_for(:title) { page_title }
def title(page_title, show_title = true)
@content_for_title = page_title.to_s
@show_title = show_title
end
def show_title?
@show_title
end
def tab_is_active?(tab)

View file

@ -9,10 +9,13 @@ module PagesHelper
# end
# end
def wikified_body(body)
WikiCloth.new({:data => body, :link_handler => Wikilink.new}).to_html
def wikified_body(page)
WikiCloth.new({:data => page.body, :link_handler => Wikilink.new, :params => {:referer => page.title}}).to_html
end
def link_to_wikipage(page)
link_to page.title, "/wiki/#{page.title}"
end
# def generate_toc(body)
# toc = ""
# body.gsub(/^([=]{1,6})\s*(.*?)\s*(\1)/) do