diff options
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 |