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
Jérome Perrin
gitlab-ce
Commits
b1c1a3d3
Commit
b1c1a3d3
authored
Aug 20, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor sidebar navigation for dashboard
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
55fc58bd
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
68 additions
and
15 deletions
+68
-15
app/assets/stylesheets/generic/common.scss
app/assets/stylesheets/generic/common.scss
+20
-0
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+1
-1
app/helpers/tab_helper.rb
app/helpers/tab_helper.rb
+2
-0
app/views/dashboard/_projects_head.html.haml
app/views/dashboard/_projects_head.html.haml
+10
-0
app/views/dashboard/projects/starred.html.haml
app/views/dashboard/projects/starred.html.haml
+2
-0
app/views/dashboard/show.html.haml
app/views/dashboard/show.html.haml
+2
-0
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+4
-4
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+18
-8
app/views/snippets/_head.html.haml
app/views/snippets/_head.html.haml
+7
-0
app/views/snippets/current_user_index.html.haml
app/views/snippets/current_user_index.html.haml
+1
-0
app/views/snippets/index.html.haml
app/views/snippets/index.html.haml
+1
-2
No files found.
app/assets/stylesheets/generic/common.scss
View file @
b1c1a3d3
...
@@ -373,3 +373,23 @@ table {
...
@@ -373,3 +373,23 @@ table {
border-color
:
#EEE
!
important
;
border-color
:
#EEE
!
important
;
}
}
}
}
.center-top-menu
{
border-bottom
:
1px
solid
#EEE
;
list-style
:
none
;
text-align
:
center
;
padding-bottom
:
15px
;
margin-bottom
:
10px
;
li
{
display
:
inline-block
;
a
{
padding
:
10px
;
}
&
.active
a
{
color
:
#666
;
}
}
}
app/controllers/snippets_controller.rb
View file @
b1c1a3d3
...
@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController
...
@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController
skip_before_action
:authenticate_user!
,
only:
[
:index
,
:user_index
,
:show
,
:raw
]
skip_before_action
:authenticate_user!
,
only:
[
:index
,
:user_index
,
:show
,
:raw
]
layout
'
snippets
'
layout
'
dashboard
'
respond_to
:html
respond_to
:html
def
index
def
index
...
...
app/helpers/tab_helper.rb
View file @
b1c1a3d3
...
@@ -67,6 +67,8 @@ module TabHelper
...
@@ -67,6 +67,8 @@ module TabHelper
path
.
any?
do
|
single_path
|
path
.
any?
do
|
single_path
|
current_path?
(
single_path
)
current_path?
(
single_path
)
end
end
elsif
page
=
options
.
delete
(
:page
)
current_page?
(
page
)
else
else
c
=
options
.
delete
(
:controller
)
c
=
options
.
delete
(
:controller
)
a
=
options
.
delete
(
:action
)
a
=
options
.
delete
(
:action
)
...
...
app/views/dashboard/_projects_head.html.haml
0 → 100644
View file @
b1c1a3d3
%ul
.center-top-menu
=
nav_link
(
path:
[
'dashboard#show'
,
'root#show'
],
html_options:
{
class:
'home'
})
do
=
link_to
dashboard_path
,
title:
'Home'
,
class:
'shortcuts-activity'
,
data:
{
placement:
'right'
}
do
Your Projects
=
nav_link
(
path:
'projects#starred'
)
do
=
link_to
starred_dashboard_projects_path
,
title:
'Starred Projects'
,
data:
{
placement:
'right'
}
do
Starred Projects
=
nav_link
(
controller: :explore
)
do
=
link_to
explore_root_path
,
title:
'Explore'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
}
do
Explore Projects
app/views/dashboard/projects/starred.html.haml
View file @
b1c1a3d3
-
page_title
"Starred Projects"
-
page_title
"Starred Projects"
=
render
'dashboard/projects_head'
-
if
@projects
.
any?
-
if
@projects
.
any?
=
render
'shared/show_aside'
=
render
'shared/show_aside'
...
...
app/views/dashboard/show.html.haml
View file @
b1c1a3d3
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
-
if
current_user
-
if
current_user
=
auto_discovery_link_tag
(
:atom
,
dashboard_url
(
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"All activity"
)
=
auto_discovery_link_tag
(
:atom
,
dashboard_url
(
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"All activity"
)
=
render
'dashboard/projects_head'
-
if
@projects
.
any?
-
if
@projects
.
any?
=
render
'shared/show_aside'
=
render
'shared/show_aside'
...
...
app/views/layouts/header/_default.html.haml
View file @
b1c1a3d3
...
@@ -17,13 +17,13 @@
...
@@ -17,13 +17,13 @@
%li
.visible-sm.visible-xs
%li
.visible-sm.visible-xs
=
link_to
search_path
,
title:
'Search'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
}
do
=
link_to
search_path
,
title:
'Search'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
}
do
=
icon
(
'search'
)
=
icon
(
'search'
)
%li
.hidden-xs
-#
%li.hidden-xs
= link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do
= link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('question-circle fw')
= icon('question-circle fw')
%li
-#
%li
= link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do
= link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('globe fw')
= icon('globe fw')
%li
-#
%li
= link_to user_snippets_path(current_user), title: 'Your snippets', data: {toggle: 'tooltip', placement: 'bottom'} do
= link_to user_snippets_path(current_user), title: 'Your snippets', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('clipboard fw')
= icon('clipboard fw')
-
if
current_user
.
is_admin?
-
if
current_user
.
is_admin?
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
%li
.hidden-xs
%li
.hidden-xs
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
}
do
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
}
do
=
icon
(
'plus fw'
)
=
icon
(
'plus fw'
)
%li
-#
%li
= link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do
= link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('cog fw')
= icon('cog fw')
%li
%li
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
b1c1a3d3
%ul
.nav.nav-sidebar
%ul
.nav.nav-sidebar
=
nav_link
(
path:
[
'dashboard#show'
,
'root#show'
],
html_options:
{
class:
'home'
})
do
=
nav_link
(
path:
[
'dashboard#show'
,
'root#show'
,
'projects#starred'
],
html_options:
{
class:
'home'
})
do
=
link_to
dashboard
_path
,
title:
'Home'
,
class:
'shortcuts-activity'
,
data:
{
placement:
'right'
}
do
=
link_to
root
_path
,
title:
'Home'
,
class:
'shortcuts-activity'
,
data:
{
placement:
'right'
}
do
=
icon
(
'dashboard fw'
)
=
icon
(
'dashboard fw'
)
%span
%span
Your
Projects
Projects
=
nav_link
(
path:
'projects#starred'
)
do
-#
= nav_link(path: 'projects#starred') do
=
link_to
starred_dashboard_projects_path
,
title:
'Starred Projects'
,
data:
{
placement:
'right'
}
do
-#
= link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do
=
icon
(
'star fw'
)
-#
= icon('star fw')
%span
-#
%span
Starred Projects
-#
Starred Projects
=
nav_link
(
controller: :groups
)
do
=
nav_link
(
controller: :groups
)
do
=
link_to
dashboard_groups_path
,
title:
'Groups'
,
data:
{
placement:
'right'
}
do
=
link_to
dashboard_groups_path
,
title:
'Groups'
,
data:
{
placement:
'right'
}
do
=
icon
(
'group fw'
)
=
icon
(
'group fw'
)
...
@@ -31,6 +31,16 @@
...
@@ -31,6 +31,16 @@
%span
%span
Merge Requests
Merge Requests
%span
.count
=
current_user
.
assigned_merge_requests
.
opened
.
count
%span
.count
=
current_user
.
assigned_merge_requests
.
opened
.
count
=
nav_link
(
controller: :snippets
)
do
=
link_to
user_snippets_path
(
current_user
),
title:
'Your snippets'
,
data:
{
placement:
'right'
}
do
=
icon
(
'dashboard fw'
)
%span
Snippets
=
nav_link
(
controller: :profile
)
do
=
link_to
profile_path
,
title:
'Profile settings'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
}
do
=
icon
(
'user fw'
)
%span
Profile
=
nav_link
(
controller: :help
)
do
=
nav_link
(
controller: :help
)
do
=
link_to
help_path
,
title:
'Help'
,
data:
{
placement:
'right'
}
do
=
link_to
help_path
,
title:
'Help'
,
data:
{
placement:
'right'
}
do
=
icon
(
'question-circle fw'
)
=
icon
(
'question-circle fw'
)
...
...
app/views/snippets/_head.html.haml
0 → 100644
View file @
b1c1a3d3
%ul
.center-top-menu
=
nav_link
(
page:
user_snippets_path
(
current_user
),
html_options:
{
class:
'home'
})
do
=
link_to
user_snippets_path
(
current_user
),
title:
'Your snippets'
,
data:
{
placement:
'right'
}
do
Your Snippets
=
nav_link
(
page:
snippets_path
)
do
=
link_to
snippets_path
,
title:
'Explore snippets'
,
data:
{
placement:
'right'
}
do
Explore Snippets
app/views/snippets/current_user_index.html.haml
View file @
b1c1a3d3
-
page_title
"Your Snippets"
-
page_title
"Your Snippets"
=
render
'head'
%h3
.page-title
%h3
.page-title
Your Snippets
Your Snippets
.pull-right
.pull-right
...
...
app/views/snippets/index.html.haml
View file @
b1c1a3d3
-
page_title
"Public Snippets"
-
page_title
"Public Snippets"
=
render
'head'
%h3
.page-title
%h3
.page-title
Public snippets
Public snippets
...
@@ -6,8 +7,6 @@
...
@@ -6,8 +7,6 @@
-
if
current_user
-
if
current_user
=
link_to
new_snippet_path
,
class:
"btn btn-new btn-grouped"
,
title:
"New Snippet"
do
=
link_to
new_snippet_path
,
class:
"btn btn-new btn-grouped"
,
title:
"New Snippet"
do
Add new snippet
Add new snippet
=
link_to
user_snippets_path
(
current_user
),
class:
"btn btn-grouped"
do
Your snippets
%p
.light
%p
.light
Public snippets created by you and other users are listed here
Public snippets created by you and other users are listed here
...
...
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