|
|
|
@ -109,6 +109,20 @@ module ApplicationHelper |
|
|
|
|
link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => rev}, |
|
|
|
|
:title => l(:label_revision_id, format_revision(revision))) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# Generates a link to a message |
|
|
|
|
def link_to_message(message, options={}, html_options = nil) |
|
|
|
|
link_to( |
|
|
|
|
h(truncate(message.subject, :length => 60)), |
|
|
|
|
{ :controller => 'messages', :action => 'show', |
|
|
|
|
:board_id => message.board_id, |
|
|
|
|
:id => message.root, |
|
|
|
|
:r => (message.parent_id && message.id), |
|
|
|
|
:anchor => (message.parent_id ? "message-#{message.id}" : nil) |
|
|
|
|
}.merge(options), |
|
|
|
|
html_options |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# Generates a link to a project if active |
|
|
|
|
# Examples: |
|
|
|
@ -632,13 +646,7 @@ module ApplicationHelper |
|
|
|
|
end |
|
|
|
|
when 'message' |
|
|
|
|
if message = Message.visible.find_by_id(oid, :include => :parent) |
|
|
|
|
link = link_to h(truncate(message.subject, :length => 60)), {:only_path => only_path, |
|
|
|
|
:controller => 'messages', |
|
|
|
|
:action => 'show', |
|
|
|
|
:board_id => message.board, |
|
|
|
|
:id => message.root, |
|
|
|
|
:anchor => (message.parent ? "message-#{message.id}" : nil)}, |
|
|
|
|
:class => 'message' |
|
|
|
|
link = link_to_message(message, {:only_path => only_path}, :class => 'message') |
|
|
|
|
end |
|
|
|
|
when 'project' |
|
|
|
|
if p = Project.visible.find_by_id(oid) |
|
|
|
|