mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-24 01:11:12 +00:00
Use named routes.
git-svn-id: http://svn.redmine.org/redmine/trunk@13598 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
209babeedb
commit
8712a0f13e
@ -793,21 +793,18 @@ module ApplicationHelper
|
||||
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)
|
||||
@ -815,13 +812,11 @@ module ApplicationHelper
|
||||
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)
|
||||
@ -835,23 +830,19 @@ module ApplicationHelper
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user