Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-24 18:14:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-24 18:14:19 +0300
commitb8d516a6876de74b68a800c5b69af9448b0de140 (patch)
tree3a56c8af8b36d03c20e9de4298f30b08cba0ea5a /app/helpers/tab_helper.rb
parent77b8390171a55d4593e3730551751d8348992f80 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/tab_helper.rb')
-rw-r--r--app/helpers/tab_helper.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb
index e53e35baac3..d503011e9c1 100644
--- a/app/helpers/tab_helper.rb
+++ b/app/helpers/tab_helper.rb
@@ -63,6 +63,19 @@ module TabHelper
end
end
+ # Creates a <gl-badge> for use inside tabs.
+ #
+ # html_options - The html_options hash (default: {})
+ def gl_tab_counter_badge(count, html_options = {})
+ gl_badge_tag(
+ count,
+ { size: :sm },
+ html_options.merge(
+ class: ['gl-tab-counter-badge', *html_options[:class]]
+ )
+ )
+ end
+
# Navigation link helper
#
# Returns an `li` element with an 'active' class if the supplied
@@ -211,12 +224,3 @@ module TabHelper
current_page?(options)
end
end
-
-def gl_tab_counter_badge(count, html_options = {})
- badge_classes = %w[badge badge-muted badge-pill gl-badge sm gl-tab-counter-badge]
- content_tag(:span,
- count,
- class: [*html_options[:class], badge_classes].join(' '),
- data: html_options[:data]
- )
-end