mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
add empty line after guard clause to lib/redmine/wiki_formatting/macros.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20230 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -157,6 +157,7 @@ module Redmine
|
|||||||
unless block_given?
|
unless block_given?
|
||||||
raise "Can not create a macro without a block!"
|
raise "Can not create a macro without a block!"
|
||||||
end
|
end
|
||||||
|
|
||||||
name = name.to_s.downcase.to_sym
|
name = name.to_s.downcase.to_sym
|
||||||
available_macros[name] = {:desc => @@desc || ''}.merge(options)
|
available_macros[name] = {:desc => @@desc || ''}.merge(options)
|
||||||
@@desc = nil
|
@@desc = nil
|
||||||
@@ -207,6 +208,7 @@ module Redmine
|
|||||||
raise t(:error_childpages_macro_no_argument)
|
raise t(:error_childpages_macro_no_argument)
|
||||||
end
|
end
|
||||||
raise t(:error_page_not_found) if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project)
|
raise t(:error_page_not_found) if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project)
|
||||||
|
|
||||||
pages = page.self_and_descendants(options[:depth]).group_by(&:parent_id)
|
pages = page.self_and_descendants(options[:depth]).group_by(&:parent_id)
|
||||||
render_page_hierarchy(pages, options[:parent] ? page.parent_id : page.id)
|
render_page_hierarchy(pages, options[:parent] ? page.parent_id : page.id)
|
||||||
end
|
end
|
||||||
@@ -217,8 +219,10 @@ module Redmine
|
|||||||
macro :include do |obj, args|
|
macro :include do |obj, args|
|
||||||
page = Wiki.find_page(args.first.to_s, :project => @project)
|
page = Wiki.find_page(args.first.to_s, :project => @project)
|
||||||
raise t(:error_page_not_found) if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project)
|
raise t(:error_page_not_found) if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project)
|
||||||
|
|
||||||
@included_wiki_pages ||= []
|
@included_wiki_pages ||= []
|
||||||
raise t(:error_circular_inclusion) if @included_wiki_pages.include?(page.id)
|
raise t(:error_circular_inclusion) if @included_wiki_pages.include?(page.id)
|
||||||
|
|
||||||
@included_wiki_pages << page.id
|
@included_wiki_pages << page.id
|
||||||
out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false, :inline_attachments => @@inline_attachments)
|
out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false, :inline_attachments => @@inline_attachments)
|
||||||
@included_wiki_pages.pop
|
@included_wiki_pages.pop
|
||||||
@@ -248,8 +252,10 @@ module Redmine
|
|||||||
args, options = extract_macro_options(args, :size, :title)
|
args, options = extract_macro_options(args, :size, :title)
|
||||||
filename = args.first
|
filename = args.first
|
||||||
raise t(:error_filename_required) unless filename.present?
|
raise t(:error_filename_required) unless filename.present?
|
||||||
|
|
||||||
size = options[:size]
|
size = options[:size]
|
||||||
raise t(:error_invalid_size_parameter) unless size.nil? || /^\d+$/.match?(size)
|
raise t(:error_invalid_size_parameter) unless size.nil? || /^\d+$/.match?(size)
|
||||||
|
|
||||||
size = size.to_i
|
size = size.to_i
|
||||||
size = 200 unless size > 0
|
size = 200 unless size > 0
|
||||||
if obj && obj.respond_to?(:attachments) && attachment = Attachment.latest_attach(obj.attachments, filename)
|
if obj && obj.respond_to?(:attachments) && attachment = Attachment.latest_attach(obj.attachments, filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user