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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
2f8154a4
Commit
2f8154a4
authored
May 07, 2019
by
Filipa Lacerda
Committed by
Phil Hughes
May 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only renders Next badge for gitlab.com
parent
bd73925b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+15
-3
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+3
-2
changelogs/unreleased/61278-next.yml
changelogs/unreleased/61278-next.yml
+5
-0
No files found.
app/assets/javascripts/main.js
View file @
2f8154a4
...
...
@@ -136,10 +136,22 @@ function deferredInitialisation() {
loadAwardsHandler
();
// Toggle Canary Badge
/**
* Toggle Canary Badge
*
* For GitLab.com only, when the user is using canary
* we render a Next badge and hide the option to switch
* to canay
*/
if
(
Cookies
.
get
(
'
gitlab_canary
'
)
&&
Cookies
.
get
(
'
gitlab_canary
'
)
===
'
true
'
)
{
document
.
querySelector
(
'
.js-canary-badge
'
).
classList
.
remove
(
'
hidden
'
);
document
.
querySelector
(
'
.js-canary-link
'
).
classList
.
add
(
'
hidden
'
);
const
canaryBadge
=
document
.
querySelector
(
'
.js-canary-badge
'
);
const
canaryLink
=
document
.
querySelector
(
'
.js-canary-link
'
);
if
(
canaryBadge
)
{
canaryBadge
.
classList
.
remove
(
'
hidden
'
);
}
if
(
canaryLink
)
{
canaryLink
.
classList
.
add
(
'
hidden
'
);
}
}
}
...
...
app/views/layouts/header/_default.html.haml
View file @
2f8154a4
...
...
@@ -17,8 +17,9 @@
-
if
logo_text
.
present?
%span
.logo-text.d-none.d-lg-block.prepend-left-8
=
logo_text
%span
.js-canary-badge.badge.badge-pill.green-badge.align-self-center
=
_
(
'Next'
)
-
if
Gitlab
.
com?
%span
.js-canary-badge.badge.badge-pill.green-badge.align-self-center
=
_
(
'Next'
)
-
if
current_user
=
render
"layouts/nav/dashboard"
...
...
changelogs/unreleased/61278-next.yml
0 → 100644
View file @
2f8154a4
---
title
:
Render Next badge only for gitlab.com
merge_request
:
28056
author
:
type
:
fixed
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