Adds child_pages macro for wiki pages (#528).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1699 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-07-26 12:54:54 +00:00
parent 60d066f943
commit ec7d135930
8 changed files with 28 additions and 6 deletions
+6
View File
@@ -77,6 +77,12 @@ module Redmine
content_tag('dl', out)
end
desc "Displays a list of child pages."
macro :child_pages do |obj, args|
raise 'This macro applies to wiki pages only.' unless obj.is_a?(WikiContent)
render_page_hierarchy(obj.page.descendants.group_by(&:parent_id), obj.page.id)
end
desc "Include a wiki page. Example:\n\n !{{include(Foo)}}\n\nor to include a page of a specific project wiki:\n\n !{{include(projectname:Foo)}}"
macro :include do |obj, args|
project = @project