diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /app/helpers/milestones_helper.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) | |
download | gitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'app/helpers/milestones_helper.rb')
-rw-r--r-- | app/helpers/milestones_helper.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb new file mode 100644 index 00000000000..272a3970bc2 --- /dev/null +++ b/app/helpers/milestones_helper.rb @@ -0,0 +1,26 @@ +# 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 |