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
c0ff8b6d
Commit
c0ff8b6d
authored
Apr 18, 2017
by
Grzegorz Bizon
Committed by
Robert Speicher
Apr 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix container registry navigation menu highlights
parent
f88762a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+2
-2
spec/views/layouts/nav/_project.html.haml_spec.rb
spec/views/layouts/nav/_project.html.haml_spec.rb
+37
-0
No files found.
app/views/layouts/nav/_project.html.haml
View file @
c0ff8b6d
...
...
@@ -11,13 +11,13 @@
Project
-
if
project_nav_tab?
:files
=
nav_link
(
controller:
%w(tree blob blame edit_tree new_tree find_file commit commits compare repositories tags branches releases graphs network)
)
do
=
nav_link
(
controller:
%w(tree blob blame edit_tree new_tree find_file commit commits compare
projects/
repositories tags branches releases graphs network)
)
do
=
link_to
project_files_path
(
@project
),
title:
'Repository'
,
class:
'shortcuts-tree'
do
%span
Repository
-
if
project_nav_tab?
:container_registry
=
nav_link
(
controller:
%w
(container_registry)
)
do
=
nav_link
(
controller:
%w
[projects/registry/repositories]
)
do
=
link_to
project_container_registry_path
(
@project
),
title:
'Container Registry'
,
class:
'shortcuts-container-registry'
do
%span
Registry
...
...
spec/views/layouts/nav/_project.html.haml_spec.rb
0 → 100644
View file @
c0ff8b6d
require
'spec_helper'
describe
'layouts/nav/_project'
do
describe
'container registry tab'
do
before
do
stub_container_registry_config
(
enabled:
true
)
assign
(
:project
,
create
(
:project
))
allow
(
view
).
to
receive
(
:current_ref
).
and_return
(
'master'
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
allow
(
controller
).
to
receive
(
:controller_name
)
.
and_return
(
'repositories'
)
allow
(
controller
).
to
receive
(
:controller_path
)
.
and_return
(
'projects/registry/repositories'
)
end
it
'has both Registry and Repository tabs'
do
render
expect
(
rendered
).
to
have_text
'Repository'
expect
(
rendered
).
to
have_text
'Registry'
end
it
'highlights only one tab'
do
render
expect
(
rendered
).
to
have_css
(
'.active'
,
count:
1
)
end
it
'highlights container registry tab only'
do
render
expect
(
rendered
).
to
have_css
(
'.active'
,
text:
'Registry'
)
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