Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c7e9fbd3
Commit
c7e9fbd3
authored
Nov 08, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gl_tab_counter_badge helper
This helper creates a badge element to be used in GlTabs.
parent
c5f329ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/helpers/tab_helper.rb
app/helpers/tab_helper.rb
+7
-0
spec/helpers/tab_helper_spec.rb
spec/helpers/tab_helper_spec.rb
+6
-0
No files found.
app/helpers/tab_helper.rb
View file @
c7e9fbd3
...
...
@@ -210,3 +210,10 @@ module TabHelper
current_page?
(
options
)
end
end
def
gl_tab_counter_badge
(
count
)
content_tag
(
:span
,
count
,
class:
'badge badge-muted badge-pill gl-badge sm gl-tab-counter-badge'
)
end
\ No newline at end of file
spec/helpers/tab_helper_spec.rb
View file @
c7e9fbd3
...
...
@@ -150,4 +150,10 @@ RSpec.describe TabHelper do
end
end
end
describe
'gl_tab_counter_badge'
do
it
'creates a tab counter badge'
do
expect
(
gl_tab_counter_badge
(
1
)).
to
eq
(
'<span class="badge badge-muted badge-pill gl-badge sm gl-tab-counter-badge">1</span>'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment