if oid.to_s == identifier &&
issue = Issue.visible.find_by_id(oid)
anchor = comment_id ? "note-#{comment_id}" : nil
- link = link_to(h("##{oid}#{comment_suffix}"),
- {:only_path => only_path, :controller => 'issues',
- :action => 'show', :id => oid, :anchor => anchor},
+ link = link_to("##{oid}#{comment_suffix}",
+ issue_path(issue, :only_path => only_path, :anchor => anchor),
:class => issue.css_classes,
:title => "#{issue.subject.truncate(100)} (#{issue.status.name})")
end
when 'document'
if document = Document.visible.find_by_id(oid)
- link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
- :class => 'document'
+ link = link_to(document.title, document_path(document, :only_path => only_path), :class => 'document')
end
when 'version'
if version = Version.visible.find_by_id(oid)
- link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
- :class => 'version'
+ link = link_to(version.name, version_path(version, :only_path => only_path), :class => 'version')
end
when 'message'
if message = Message.visible.find_by_id(oid)
end
when 'forum'
if board = Board.visible.find_by_id(oid)
- link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
- :class => 'board'
+ link = link_to(board.name, project_board_path(board.project, board, :only_path => only_path), :class => 'board')
end
when 'news'
if news = News.visible.find_by_id(oid)
- link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
- :class => 'news'
+ link = link_to(news.title, news_path(news, :only_path => only_path), :class => 'news')
end
when 'project'
if p = Project.visible.find_by_id(oid)
case prefix
when 'document'
if project && document = project.documents.visible.find_by_title(name)
- link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
- :class => 'document'
+ link = link_to(document.title, document_path(document, :only_path => only_path), :class => 'document')
end
when 'version'
if project && version = project.versions.visible.find_by_name(name)
- link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
- :class => 'version'
+ link = link_to(version.name, version_path(version, :only_path => only_path), :class => 'version')
end
when 'forum'
if project && board = project.boards.visible.find_by_name(name)
- link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
- :class => 'board'
+ link = link_to(board.name, project_board_path(board.project, board, :only_path => only_path), :class => 'board')
end
when 'news'
if project && news = project.news.visible.find_by_title(name)
- link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
- :class => 'news'
+ link = link_to(news.title, news_path(news, :only_path => only_path), :class => 'news')
end
when 'commit', 'source', 'export'
if project