debian-mirror-gitlab/app/helpers/milestones_helper.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
623 B
Ruby
Raw Normal View History

2022-11-25 23:54:43 +05:30
# frozen_string_literal: true
module MilestonesHelper
def milestone_header_class(primary, issuables)
header_color = milestone_header_color(primary: primary)
header_border = milestone_header_border(issuables)
"#{header_color} #{header_border} gl-display-flex"
end
def milestone_counter_class(primary)
primary ? 'gl-text-white' : 'gl-text-gray-500'
end
private
def milestone_header_color(primary: false)
return '' unless primary
'gl-bg-blue-500 gl-text-white'
end
def milestone_header_border(issuables)
issuables.empty? ? 'gl-border-bottom-0 gl-rounded-base' : ''
end
end