Commit 726914c2 authored by Rémy Coutable's avatar Rémy Coutable

Reduce complexity of TreeHelper#lock_file_link

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 23629867
...@@ -139,12 +139,16 @@ module TreeHelper ...@@ -139,12 +139,16 @@ module TreeHelper
end end
end end
else else
if can?(current_user, :push_code, project) _lock_link(current_user: current_user, project: project, html_options: {})
html_options[:data] = { state: :lock } end
enabled_lock_link("Lock", '', html_options) end
else
disabled_lock_link("Lock", "You do not have permission to lock this", html_options) def _lock_link(current_user: current_user, project: project, html_options: {})
end if can?(current_user, :push_code, project)
html_options[:data] = { state: :lock }
enabled_lock_link("Lock", '', html_options)
else
disabled_lock_link("Lock", "You do not have permission to lock this", html_options)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment