diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb index cf0382f93..3be58d7e7 100644 --- a/app/helpers/build_lists_helper.rb +++ b/app/helpers/build_lists_helper.rb @@ -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? diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index 6aab6dae9..3efa39207 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -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