BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
51c1e499
Commit
51c1e499
authored
Sep 25, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change active tab and nav class to "active"
The main nav used active, the sub nav used current. This normalizes it.
parent
adcc6a0b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
21 deletions
+18
-21
nav.scss
app/assets/stylesheets/sections/nav.scss
+1
-1
tab_helper.rb
app/helpers/tab_helper.rb
+4
-13
_project_menu.html.haml
app/views/layouts/_project_menu.html.haml
+3
-5
active_tab.rb
features/steps/shared/active_tab.rb
+10
-2
No files found.
app/assets/stylesheets/sections/nav.scss
View file @
51c1e499
...
@@ -53,7 +53,7 @@ ul.main_menu {
...
@@ -53,7 +53,7 @@ ul.main_menu {
border-left
:
0
;
border-left
:
0
;
}
}
&
.
current
{
&
.
active
{
background-color
:
#D5D5D5
;
background-color
:
#D5D5D5
;
border-right
:
1px
solid
#BBB
;
border-right
:
1px
solid
#BBB
;
border-left
:
1px
solid
#BBB
;
border-left
:
1px
solid
#BBB
;
...
...
app/helpers/tab_helper.rb
View file @
51c1e499
...
@@ -5,7 +5,6 @@ module TabHelper
...
@@ -5,7 +5,6 @@ module TabHelper
# Project Area
# Project Area
when
:wall
;
wall_tab?
when
:wall
;
wall_tab?
when
:wiki
;
controller
.
controller_name
==
"wikis"
when
:wiki
;
controller
.
controller_name
==
"wikis"
when
:issues
;
issues_tab?
when
:network
;
current_page?
(
controller:
"projects"
,
action:
"graph"
,
id:
@project
)
when
:network
;
current_page?
(
controller:
"projects"
,
action:
"graph"
,
id:
@project
)
when
:merge_requests
;
controller
.
controller_name
==
"merge_requests"
when
:merge_requests
;
controller
.
controller_name
==
"merge_requests"
...
@@ -35,11 +34,7 @@ module TabHelper
...
@@ -35,11 +34,7 @@ module TabHelper
else
else
false
false
end
end
active
?
"current"
:
nil
active
?
"active"
:
nil
end
def
issues_tab?
controller
.
controller_name
==
"issues"
||
controller
.
controller_name
==
"milestones"
end
end
def
wall_tab?
def
wall_tab?
...
@@ -48,21 +43,17 @@ module TabHelper
...
@@ -48,21 +43,17 @@ module TabHelper
def
project_tab_class
def
project_tab_class
[
:show
,
:files
,
:edit
,
:update
].
each
do
|
action
|
[
:show
,
:files
,
:edit
,
:update
].
each
do
|
action
|
return
"
current
"
if
current_page?
(
controller:
"projects"
,
action:
action
,
id:
@project
)
return
"
active
"
if
current_page?
(
controller:
"projects"
,
action:
action
,
id:
@project
)
end
end
if
[
'snippets'
,
'hooks'
,
'deploy_keys'
,
'team_members'
].
include?
controller
.
controller_name
if
[
'snippets'
,
'hooks'
,
'deploy_keys'
,
'team_members'
].
include?
controller
.
controller_name
"
current
"
"
active
"
end
end
end
end
def
tree_tab_class
controller
.
controller_name
==
"refs"
?
"current"
:
nil
end
def
commit_tab_class
def
commit_tab_class
if
[
'commits'
,
'repositories'
,
'protected_branches'
].
include?
controller
.
controller_name
if
[
'commits'
,
'repositories'
,
'protected_branches'
].
include?
controller
.
controller_name
"
current
"
"
active
"
end
end
end
end
...
...
app/views/layouts/_project_menu.html.haml
View file @
51c1e499
...
@@ -4,17 +4,15 @@
...
@@ -4,17 +4,15 @@
-
if
@project
.
repo_exists?
-
if
@project
.
repo_exists?
-
if
can?
current_user
,
:download_code
,
@project
-
if
can?
current_user
,
:download_code
,
@project
%li
{
class:
tree_tab_class
}
%li
{
class:
current_controller?
(
:tree
,
:blob
,
:blame
)
?
'active'
:
''
}
=
link_to
project_tree_path
(
@project
,
@project
.
root_ref
)
do
=
link_to
'Files'
,
project_tree_path
(
@project
,
@project
.
root_ref
)
Files
%li
{
class:
commit_tab_class
}
%li
{
class:
commit_tab_class
}
=
link_to
"Commits"
,
project_commits_path
(
@project
,
@project
.
root_ref
)
=
link_to
"Commits"
,
project_commits_path
(
@project
,
@project
.
root_ref
)
%li
{
class:
tab_class
(
:network
)}
%li
{
class:
tab_class
(
:network
)}
=
link_to
"Network"
,
graph_project_path
(
@project
)
=
link_to
"Network"
,
graph_project_path
(
@project
)
-
if
@project
.
issues_enabled
-
if
@project
.
issues_enabled
%li
{
class:
tab_class
(
:issues
)
}
%li
{
class:
current_controller?
(
:issues
,
:milestones
,
:labels
)
?
'active'
:
''
}
=
link_to
project_issues_filter_path
(
@project
)
do
=
link_to
project_issues_filter_path
(
@project
)
do
Issues
Issues
%span
.count.issue_counter
=
@project
.
issues
.
opened
.
count
%span
.count.issue_counter
=
@project
.
issues
.
opened
.
count
...
...
features/steps/shared/active_tab.rb
View file @
51c1e499
...
@@ -2,10 +2,18 @@ module SharedActiveTab
...
@@ -2,10 +2,18 @@ module SharedActiveTab
include
Spinach
::
DSL
include
Spinach
::
DSL
def
ensure_active_main_tab
(
content
)
def
ensure_active_main_tab
(
content
)
page
.
find
(
'ul.main_menu li.current'
).
should
have_content
(
content
)
page
.
find
(
'ul.main_menu li.active'
).
should
have_content
(
content
)
end
def
ensure_active_sub_tab
(
content
)
page
.
find
(
'div.content ul.nav-tabs li.active'
).
should
have_content
(
content
)
end
end
And
'no other main tabs should be active'
do
And
'no other main tabs should be active'
do
page
.
should
have_selector
(
'ul.main_menu li.current'
,
count:
1
)
page
.
should
have_selector
(
'ul.main_menu li.active'
,
count:
1
)
end
And
'no other sub tabs should be active'
do
page
.
should
have_selector
(
'div.content ul.nav-tabs li.active'
,
count:
1
)
end
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