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
29211b48
Unverified
Commit
29211b48
authored
May 16, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement new horizontal navigation to project pages
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
78a67fc4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
128 deletions
+78
-128
nav.scss
app/assets/stylesheets/framework/nav.scss
+5
-1
tab_helper.rb
app/helpers/tab_helper.rb
+3
-1
_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+1
-1
_project.html.haml
app/views/layouts/nav/_project.html.haml
+25
-40
_project_settings.html.haml
app/views/layouts/nav/_project_settings.html.haml
+42
-60
project.html.haml
app/views/layouts/project.html.haml
+1
-1
project_settings.html.haml
app/views/layouts/project_settings.html.haml
+1
-2
_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+0
-22
No files found.
app/assets/stylesheets/framework/nav.scss
View file @
29211b48
...
...
@@ -196,7 +196,7 @@
position
:
fixed
;
top
:
$header-height
;
width
:
100%
;
z-index
:
1
;
z-index
:
3
;
background
:
$background-color
;
border-bottom
:
1px
solid
$border-color
;
transition-duration
:
.3s
;
...
...
@@ -238,6 +238,10 @@
@media
(
max-width
:
$screen-xs-min
)
{
margin-left
:
0
;
}
li
.active
{
font-weight
:
bold
;
}
}
}
...
...
app/helpers/tab_helper.rb
View file @
29211b48
...
...
@@ -95,7 +95,9 @@ module TabHelper
end
def
project_tab_class
return
"active"
if
current_page?
(
controller:
"/projects"
,
action: :edit
,
id:
@project
)
if
controller
.
controller_path
=~
/\Aprojects/
return
'active'
end
if
[
'services'
,
'hooks'
,
'deploy_keys'
,
'protected_branches'
].
include?
controller
.
controller_name
"active"
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
29211b48
%ul
.nav.nav-sidebar
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
class:
'home'
})
do
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
class:
"
#{
project_tab_class
}
home"
})
do
=
link_to
dashboard_projects_path
,
title:
'Projects'
do
=
icon
(
'bookmark fw'
)
%span
...
...
app/views/layouts/nav/_project.html.haml
View file @
29211b48
%ul
.nav.nav-sidebar
-
if
@project
.
group
=
nav_link
do
=
link_to
group_path
(
@project
.
group
),
title:
'Go to group'
,
class:
'back-link'
do
=
icon
(
'caret-square-o-left fw'
)
%span
Go to group
-
else
=
nav_link
do
=
link_to
root_path
,
title:
'Go to dashboard'
,
class:
'back-link'
do
=
icon
(
'caret-square-o-left fw'
)
%span
Go to dashboard
%li
.separate-item
-
if
current_user
.controls
-
access
=
user_max_access_in_project
(
current_user
.
id
,
@project
)
-
can_edit
=
can?
(
current_user
,
:admin_project
,
@project
)
%span
.dropdown.project-settings-dropdown
%a
.dropdown-new.btn.btn-default
#project-settings-button
{
href:
'#'
,
'data-toggle'
=>
'dropdown'
}
=
icon
(
'cog'
)
=
icon
(
'caret-down'
)
%ul
.dropdown-menu.dropdown-menu-align-right
=
render
'layouts/nav/project_settings'
%li
.divider
-
if
can_edit
%li
=
link_to
edit_project_path
(
@project
)
do
Edit Project
-
if
access
%li
=
link_to
leave_namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
leave_project_message
(
@project
)
},
method: :delete
,
title:
'Leave project'
do
Leave Project
%ul
.nav-links
=
nav_link
(
path:
'projects#show'
,
html_options:
{
class:
'home'
})
do
=
link_to
project_path
(
@project
),
title:
'Project'
,
class:
'shortcuts-project'
do
=
icon
(
'bookmark fw'
)
...
...
@@ -44,7 +50,7 @@
=
icon
(
'cubes fw'
)
%span
Builds
%span
.count.builds_counter
=
number_with_delimiter
(
@project
.
builds
.
running_or_pending
.
count
(
:all
))
%span
.
badge.
count.builds_counter
=
number_with_delimiter
(
@project
.
builds
.
running_or_pending
.
count
(
:all
))
-
if
project_nav_tab?
:graphs
=
nav_link
(
controller:
%w(graphs)
)
do
...
...
@@ -67,7 +73,7 @@
%span
Issues
-
if
@project
.
default_issues_tracker?
%span
.count.issue_counter
=
number_with_delimiter
(
@project
.
issues
.
visible_to_user
(
current_user
).
opened
.
count
)
%span
.
badge.
count.issue_counter
=
number_with_delimiter
(
@project
.
issues
.
visible_to_user
(
current_user
).
opened
.
count
)
-
if
project_nav_tab?
:merge_requests
=
nav_link
(
controller: :merge_requests
)
do
...
...
@@ -75,14 +81,7 @@
=
icon
(
'tasks fw'
)
%span
Merge Requests
%span
.count.merge_counter
=
number_with_delimiter
(
@project
.
merge_requests
.
opened
.
count
)
-
if
project_nav_tab?
:team
=
nav_link
(
controller:
[
:project_members
,
:teams
])
do
=
link_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
title:
'Members'
,
class:
'team-tab tab'
do
=
icon
(
'users fw'
)
%span
Members
%span
.badge.count.merge_counter
=
number_with_delimiter
(
@project
.
merge_requests
.
opened
.
count
)
-
if
project_nav_tab?
:labels
=
nav_link
(
controller: :labels
)
do
...
...
@@ -98,13 +97,6 @@
%span
Wiki
-
if
project_nav_tab?
:forks
=
nav_link
(
controller: :forks
,
action: :index
)
do
=
link_to
namespace_project_forks_path
(
@project
.
namespace
,
@project
),
title:
'Forks'
do
=
icon
(
'code-fork fw'
)
%span
Forks
-
if
project_nav_tab?
:snippets
=
nav_link
(
controller: :snippets
)
do
=
link_to
namespace_project_snippets_path
(
@project
.
namespace
,
@project
),
title:
'Snippets'
,
class:
'shortcuts-snippets'
do
...
...
@@ -112,13 +104,6 @@
%span
Snippets
-
if
project_nav_tab?
:settings
=
nav_link
(
html_options:
{
class:
"
#{
project_tab_class
}
separate-item"
})
do
=
link_to
edit_project_path
(
@project
),
title:
'Settings'
do
=
icon
(
'cogs fw'
)
%span
Settings
-# Global shortcut to network page for compatibility
-
if
project_nav_tab?
:network
%li
.hidden
...
...
app/views/layouts/nav/_project_settings.html.haml
View file @
29211b48
%ul
.nav.nav-sidebar
=
nav_link
do
=
link_to
project_path
(
@project
),
title:
'Go to project'
,
class:
'back-link'
do
=
icon
(
'caret-square-o-left fw'
)
-
if
project_nav_tab?
:team
=
nav_link
(
controller:
[
:project_members
,
:teams
])
do
=
link_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
title:
'Members'
,
class:
'team-tab tab'
do
%span
Go to project
Members
%li
.separate-item
%ul
.sidebar-subnav
=
nav_link
(
path:
'projects#edit'
)
do
=
link_to
edit_project_path
(
@project
),
title:
'Project Settings'
do
=
icon
(
'pencil-square-o fw'
)
%span
Project Settings
-
if
@project
.
allowed_to_share_with_group?
=
nav_link
(
controller: :group_links
)
do
=
link_to
namespace_project_group_links_path
(
@project
.
namespace
,
@project
),
title:
"Groups"
do
=
icon
(
'share-square-o fw'
)
%span
Groups
=
nav_link
(
controller: :deploy_keys
)
do
=
link_to
namespace_project_deploy_keys_path
(
@project
.
namespace
,
@project
),
title:
'Deploy Keys'
do
=
icon
(
'key fw'
)
%span
Deploy Keys
=
nav_link
(
controller: :hooks
)
do
=
link_to
namespace_project_hooks_path
(
@project
.
namespace
,
@project
),
title:
'Webhooks'
do
=
icon
(
'link fw'
)
%span
Webhooks
=
nav_link
(
controller: :services
)
do
=
link_to
namespace_project_services_path
(
@project
.
namespace
,
@project
),
title:
'Services'
do
=
icon
(
'cogs fw'
)
%span
Services
=
nav_link
(
controller: :protected_branches
)
do
=
link_to
namespace_project_protected_branches_path
(
@project
.
namespace
,
@project
),
title:
'Protected Branches'
do
=
icon
(
'lock fw'
)
%span
Protected Branches
-
if
@project
.
allowed_to_share_with_group?
=
nav_link
(
controller: :group_links
)
do
=
link_to
namespace_project_group_links_path
(
@project
.
namespace
,
@project
),
title:
"Groups"
do
%span
Groups
=
nav_link
(
controller: :deploy_keys
)
do
=
link_to
namespace_project_deploy_keys_path
(
@project
.
namespace
,
@project
),
title:
'Deploy Keys'
do
%span
Deploy Keys
=
nav_link
(
controller: :hooks
)
do
=
link_to
namespace_project_hooks_path
(
@project
.
namespace
,
@project
),
title:
'Webhooks'
do
%span
Webhooks
=
nav_link
(
controller: :services
)
do
=
link_to
namespace_project_services_path
(
@project
.
namespace
,
@project
),
title:
'Services'
do
%span
Services
=
nav_link
(
controller: :protected_branches
)
do
=
link_to
namespace_project_protected_branches_path
(
@project
.
namespace
,
@project
),
title:
'Protected Branches'
do
%span
Protected Branches
-
if
@project
.
builds_enabled?
=
nav_link
(
controller: :runners
)
do
=
link_to
namespace_project_runners_path
(
@project
.
namespace
,
@project
),
title:
'Runners'
do
=
icon
(
'cog fw'
)
%span
Runners
=
nav_link
(
controller: :variables
)
do
=
link_to
namespace_project_variables_path
(
@project
.
namespace
,
@project
),
title:
'Variables'
do
=
icon
(
'code fw'
)
%span
Variables
=
nav_link
(
controller: :triggers
)
do
=
link_to
namespace_project_triggers_path
(
@project
.
namespace
,
@project
),
title:
'Triggers'
do
=
icon
(
'retweet fw'
)
%span
Triggers
=
nav_link
(
controller: :badges
)
do
=
link_to
namespace_project_badges_path
(
@project
.
namespace
,
@project
),
title:
'Badges'
do
=
icon
(
'star-half-empty fw'
)
%span
Badges
-
if
@project
.
builds_enabled?
=
nav_link
(
controller: :runners
)
do
=
link_to
namespace_project_runners_path
(
@project
.
namespace
,
@project
),
title:
'Runners'
do
%span
Runners
=
nav_link
(
controller: :variables
)
do
=
link_to
namespace_project_variables_path
(
@project
.
namespace
,
@project
),
title:
'Variables'
do
%span
Variables
=
nav_link
(
controller: :triggers
)
do
=
link_to
namespace_project_triggers_path
(
@project
.
namespace
,
@project
),
title:
'Triggers'
do
%span
Triggers
=
nav_link
(
controller: :badges
)
do
=
link_to
namespace_project_badges_path
(
@project
.
namespace
,
@project
),
title:
'Badges'
do
%span
Badges
app/views/layouts/project.html.haml
View file @
29211b48
-
page_title
@project
.
name_with_namespace
-
page_description
@project
.
description
unless
page_description
-
header_title
project_title
(
@project
)
unless
header_title
-
sidebar
"project"
unless
sidebar
-
nav
"project"
-
content_for
:scripts_body_top
do
-
project
=
@target_project
||
@project
...
...
app/views/layouts/project_settings.html.haml
View file @
29211b48
-
page_title
"Settings"
-
header_title
project_title
(
@project
,
"Settings"
,
edit_project_path
(
@project
))
-
sidebar
"project_settings"
-
nav
"project"
=
render
template:
"layouts/project"
app/views/projects/_home_panel.html.haml
View file @
29211b48
...
...
@@ -18,28 +18,6 @@
=
link_to
project_path
(
forked_from_project
)
do
=
forked_from_project
.
namespace
.
try
(
:name
)
.cover-controls
-
if
current_user
=
link_to
namespace_project_path
(
@project
.
namespace
,
@project
,
format: :atom
,
private_token:
current_user
.
private_token
),
class:
'btn btn-gray'
do
=
icon
(
'rss'
)
-
access
=
user_max_access_in_project
(
current_user
.
id
,
@project
)
-
can_edit
=
can?
(
current_user
,
:admin_project
,
@project
)
-
if
access
||
can_edit
%span
.dropdown.project-settings-dropdown
%a
.dropdown-new.btn.btn-gray
#project-settings-button
{
href:
'#'
,
'data-toggle'
=>
'dropdown'
}
=
icon
(
'cog'
)
=
icon
(
'angle-down'
)
%ul
.dropdown-menu.dropdown-menu-right
-
if
can_edit
%li
=
link_to
edit_project_path
(
@project
)
do
Edit Project
-
if
access
%li
=
link_to
leave_namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
leave_project_message
(
@project
)
},
method: :delete
,
title:
'Leave project'
do
Leave Project
.project-repo-buttons
.split-one.count-buttons
=
render
'projects/buttons/star'
...
...
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