Commit d0279ccb authored by Patricio Cano's avatar Patricio Cano

Correct helper for group LFS status.

parent c788c66a
...@@ -24,27 +24,27 @@ module GroupsHelper ...@@ -24,27 +24,27 @@ module GroupsHelper
end end
end end
def projects_with_lfs_enabled(group) def projects_with_lfs_enabled(group, status)
lfs_enabled = group.projects.select(&:lfs_enabled?).size if status
lfs_status = group.projects.select(&:lfs_enabled?).size
else
lfs_status = group.projects.select{ |p| !p.lfs_enabled? }.size
end
size = group.projects.size size = group.projects.size
if lfs_enabled == size || lfs_enabled == 0 if lfs_status == size || lfs_status == 0
' on all projects' 'on all projects'
else else
" on #{lfs_enabled}/#{size} projects" "on #{lfs_status} out of #{size} projects"
end end
end end
def group_lfs_status(group) def group_lfs_status(group)
if group.lfs_enabled? status = group.lfs_enabled? ? 'enabled' : 'disabled'
output = content_tag(:span, class: 'lfs-enabled') do
'Enabled' content_tag(:span, class: "lfs-#{status}") do
end "#{status.humanize} #{projects_with_lfs_enabled(group, group.lfs_enabled?)}"
else
output = content_tag(:span, class: 'lfs-disabled') do
'Disabled'
end
end end
output << projects_with_lfs_enabled(group)
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