Adds (a maximum of 3) links to project ancestors in the page title (#2788).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2485 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -312,6 +312,26 @@ module ApplicationHelper
|
||||
yield Redmine::Views::OtherFormatsBuilder.new(self)
|
||||
concat('</p>', block.binding)
|
||||
end
|
||||
|
||||
def page_header_title
|
||||
if @project.nil? || @project.new_record?
|
||||
h(Setting.app_title)
|
||||
else
|
||||
b = []
|
||||
ancestors = (@project.root? ? [] : @project.ancestors.visible)
|
||||
if ancestors.any?
|
||||
root = ancestors.shift
|
||||
b << link_to(h(root), {:controller => 'projects', :action => 'show', :id => root, :jump => current_menu_item}, :class => 'root')
|
||||
if ancestors.size > 2
|
||||
b << '…'
|
||||
ancestors = ancestors[-2, 2]
|
||||
end
|
||||
b += ancestors.collect {|p| link_to(h(p), {:controller => 'projects', :action => 'show', :id => p, :jump => current_menu_item}, :class => 'ancestor') }
|
||||
end
|
||||
b << h(@project)
|
||||
b.join(' » ')
|
||||
end
|
||||
end
|
||||
|
||||
def html_title(*args)
|
||||
if args.empty?
|
||||
|
||||
Reference in New Issue
Block a user