[refs #674] small helper refactoring

This commit is contained in:
Alexander Machehin 2012-12-04 00:09:36 +06:00
parent 3432b6af49
commit 5019d27b50
1 changed files with 3 additions and 2 deletions

View File

@ -36,12 +36,13 @@ module BuildListsHelper
end
def build_list_version_link(bl, str_version = false)
hash_size=5
if bl.commit_hash.present?
if bl.last_published_commit_hash.present?
link_to "#{shortest_hash_id bl.last_published_commit_hash, 5}...#{shortest_hash_id bl.commit_hash, 5}",
link_to "#{shortest_hash_id bl.last_published_commit_hash, hash_size}...#{shortest_hash_id bl.commit_hash, hash_size}",
diff_path(bl.project.owner, bl.project, bl.last_published_commit_hash) + "...#{bl.commit_hash}"
else
link_to str_version ? "#{shortest_hash_id bl.commit_hash, 5}" : shortest_hash_id(bl.commit_hash, 5),
link_to str_version ? "#{shortest_hash_id bl.commit_hash, hash_size}" : shortest_hash_id(bl.commit_hash, hash_size),
commit_path(bl.project.owner, bl.project, bl.commit_hash)
end
else