From ec7d1359301b28a506d3c9e9ad5785cf84d3fcd9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 26 Jul 2008 12:54:54 +0000 Subject: Adds child_pages macro for wiki pages (#528). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1699 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting/macros.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index 0848aee4e..adfc590e4 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -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 -- cgit v1.2.3