#751: update link to version of BuildList::Item

This commit is contained in:
Vokhmin Alexey V 2012-12-04 20:13:55 +04:00
parent 5defd009d3
commit 128b4104f1
2 changed files with 12 additions and 2 deletions

View File

@ -35,6 +35,17 @@ module BuildListsHelper
return advisoriable + nonadvisoriable
end
def build_list_item_version_link(item, str_version = false)
hash_size=5
if item.version =~ /^[\da-z]+$/ && item.name == item.build_list.project.name
bl = item.build_list
link_to str_version ? "#{shortest_hash_id item.version, hash_size}" : shortest_hash_id(item.version, hash_size),
commit_path(bl.project.owner, bl.project, item.version)
else
''
end
end
def build_list_version_link(bl, str_version = false)
hash_size=5
if bl.commit_hash.present?

View File

@ -153,8 +153,7 @@
%tbody
%tr{:class => build_list_item_status_color(item.status)}
%td= item.name
- version = item.name == @build_list.project.name ? build_list_version_link(@build_list, true) : ''
%td= version
%td= build_list_item_version_link item
%td= item.human_status
.both