|
@@
-605,7
+605,8
module ApplicationHelper
|
|
605
|
end
|
|
605
|
end
|
|
606
|
if esc.nil?
|
|
606
|
if esc.nil?
|
|
607
|
if prefix.nil? && sep == 'r'
|
|
607
|
if prefix.nil? && sep == 'r'
|
|
608
|
if project && (changeset = project.changesets.find_by_revision(identifier))
|
|
608
|
# project.changesets.visible raises an SQL error because of a double join on repositories
|
|
|
|
|
609
|
if project && project.repository && (changeset = Changeset.visible.find_by_repository_id_and_revision(project.repository.id, identifier))
|
|
609
|
link = link_to("#{project_prefix}r#{identifier}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
|
|
610
|
link = link_to("#{project_prefix}r#{identifier}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
|
|
610
|
:class => 'changeset',
|
|
611
|
:class => 'changeset',
|
|
611
|
:title => truncate_single_line(changeset.comments, :length => 100))
|
|
612
|
:title => truncate_single_line(changeset.comments, :length => 100))
|
|
@@
-620,17
+621,17
module ApplicationHelper
|
|
620
|
:title => "#{truncate(issue.subject, :length => 100)} (#{issue.status.name})")
|
|
621
|
:title => "#{truncate(issue.subject, :length => 100)} (#{issue.status.name})")
|
|
621
|
end
|
|
622
|
end
|
|
622
|
when 'document'
|
|
623
|
when 'document'
|
|
623
|
if document = Document.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
|
|
624
|
if document = Document.visible.find_by_id(oid)
|
|
624
|
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
|
|
625
|
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
|
|
625
|
:class => 'document'
|
|
626
|
:class => 'document'
|
|
626
|
end
|
|
627
|
end
|
|
627
|
when 'version'
|
|
628
|
when 'version'
|
|
628
|
if version = Version.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
|
|
629
|
if version = Version.visible.find_by_id(oid)
|
|
629
|
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
|
|
630
|
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
|
|
630
|
:class => 'version'
|
|
631
|
:class => 'version'
|
|
631
|
end
|
|
632
|
end
|
|
632
|
when 'message'
|
|
633
|
when 'message'
|
|
633
|
if message = Message.find_by_id(oid, :include => [:parent, {:board => :project}], :conditions => Project.visible_by(User.current))
|
|
634
|
if message = Message.visible.find_by_id(oid, :include => :parent)
|
|
634
|
link = link_to h(truncate(message.subject, :length => 60)), {:only_path => only_path,
|
|
635
|
link = link_to h(truncate(message.subject, :length => 60)), {:only_path => only_path,
|
|
635
|
:controller => 'messages',
|
|
636
|
:controller => 'messages',
|
|
636
|
:action => 'show',
|
|
637
|
:action => 'show',
|
|
@@
-649,23
+650,23
module ApplicationHelper
|
|
649
|
name = identifier.gsub(%r{^"(.*)"$}, "\\1")
|
|
650
|
name = identifier.gsub(%r{^"(.*)"$}, "\\1")
|
|
650
|
case prefix
|
|
651
|
case prefix
|
|
651
|
when 'document'
|
|
652
|
when 'document'
|
|
652
|
if project && document = project.documents.find_by_title(name)
|
|
653
|
if project && document = project.documents.visible.find_by_title(name)
|
|
653
|
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
|
|
654
|
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
|
|
654
|
:class => 'document'
|
|
655
|
:class => 'document'
|
|
655
|
end
|
|
656
|
end
|
|
656
|
when 'version'
|
|
657
|
when 'version'
|
|
657
|
if project && version = project.versions.find_by_name(name)
|
|
658
|
if project && version = project.versions.visible.find_by_name(name)
|
|
658
|
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
|
|
659
|
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
|
|
659
|
:class => 'version'
|
|
660
|
:class => 'version'
|
|
660
|
end
|
|
661
|
end
|
|
661
|
when 'commit'
|
|
662
|
when 'commit'
|
|
662
|
if project && (changeset = project.changesets.find(:first, :conditions => ["scmid LIKE ?", "#{name}%"]))
|
|
663
|
if project && project.repository && (changeset = Changeset.visible.find(:first, :conditions => ["repository_id = ? AND scmid LIKE ?", project.repository.id, "#{name}%"]))
|
|
663
|
link = link_to h("#{project_prefix}#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.identifier},
|
|
664
|
link = link_to h("#{project_prefix}#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.identifier},
|
|
664
|
:class => 'changeset',
|
|
665
|
:class => 'changeset',
|
|
665
|
:title => truncate_single_line(changeset.comments, :length => 100)
|
|
666
|
:title => truncate_single_line(changeset.comments, :length => 100)
|
|
666
|
end
|
|
667
|
end
|
|
667
|
when 'source', 'export'
|
|
668
|
when 'source', 'export'
|
|
668
|
if project && project.repository
|
|
669
|
if project && project.repository && User.current.allowed_to?(:browse_repository, project)
|
|
669
|
name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
|
|
670
|
name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
|
|
670
|
path, rev, anchor = $1, $3, $5
|
|
671
|
path, rev, anchor = $1, $3, $5
|
|
671
|
link = link_to h("#{project_prefix}#{prefix}:#{name}"), {:controller => 'repositories', :action => 'entry', :id => project,
|
|
672
|
link = link_to h("#{project_prefix}#{prefix}:#{name}"), {:controller => 'repositories', :action => 'entry', :id => project,
|