[refs #674] small helper refactoring
This commit is contained in:
parent
3432b6af49
commit
5019d27b50
|
@ -36,12 +36,13 @@ module BuildListsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_list_version_link(bl, str_version = false)
|
def build_list_version_link(bl, str_version = false)
|
||||||
|
hash_size=5
|
||||||
if bl.commit_hash.present?
|
if bl.commit_hash.present?
|
||||||
if bl.last_published_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}"
|
diff_path(bl.project.owner, bl.project, bl.last_published_commit_hash) + "...#{bl.commit_hash}"
|
||||||
else
|
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)
|
commit_path(bl.project.owner, bl.project, bl.commit_hash)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue