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
Boxiang Sun
gitlab-ce
Commits
9c2bd8b7
Commit
9c2bd8b7
authored
Jan 28, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sidebar collapse and expand work with whole page.
parent
0b030e00
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
17 deletions
+108
-17
app/assets/javascripts/application.js.coffee
app/assets/javascripts/application.js.coffee
+9
-2
app/assets/stylesheets/framework/sidebar.scss
app/assets/stylesheets/framework/sidebar.scss
+10
-1
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+22
-5
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+24
-4
app/helpers/nav_helper.rb
app/helpers/nav_helper.rb
+18
-1
app/views/shared/issuable/_participants.html.haml
app/views/shared/issuable/_participants.html.haml
+2
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+23
-4
No files found.
app/assets/javascripts/application.js.coffee
View file @
9c2bd8b7
...
@@ -223,6 +223,9 @@ $ ->
...
@@ -223,6 +223,9 @@ $ ->
.
closest
(
'aside'
)
.
closest
(
'aside'
)
.
removeClass
(
'right-sidebar-expanded'
)
.
removeClass
(
'right-sidebar-expanded'
)
.
addClass
(
'right-sidebar-collapsed'
)
.
addClass
(
'right-sidebar-collapsed'
)
$
(
'.page-with-sidebar'
)
.
removeClass
(
'right-sidebar-expanded'
)
.
addClass
(
'right-sidebar-collapsed'
)
else
else
$thisIcon
.
removeClass
(
'fa-angle-double-left'
)
$thisIcon
.
removeClass
(
'fa-angle-double-left'
)
.
addClass
(
'fa-angle-double-right'
)
.
addClass
(
'fa-angle-double-right'
)
...
@@ -230,7 +233,11 @@ $ ->
...
@@ -230,7 +233,11 @@ $ ->
.
closest
(
'aside'
)
.
closest
(
'aside'
)
.
removeClass
(
'right-sidebar-collapsed'
)
.
removeClass
(
'right-sidebar-collapsed'
)
.
addClass
(
'right-sidebar-expanded'
)
.
addClass
(
'right-sidebar-expanded'
)
$
(
'.page-with-sidebar'
)
console
.
log
(
'collapse'
)
.
removeClass
(
'right-sidebar-collapsed'
)
.
addClass
(
'right-sidebar-expanded'
)
$
.
cookie
(
"collapsed_gutter"
,
$
(
'.right-sidebar'
)
.
hasClass
(
'right-sidebar-collapsed'
),
{
path
:
'/'
})
new
Aside
()
new
Aside
()
app/assets/stylesheets/framework/sidebar.scss
View file @
9c2bd8b7
...
@@ -204,6 +204,10 @@
...
@@ -204,6 +204,10 @@
padding-right
:
$gutter_width
;
padding-right
:
$gutter_width
;
}
}
@mixin
collapsed-gutter
{
padding-right
:
$sidebar_collapsed_width
;
}
@mixin
collapsed-sidebar
{
@mixin
collapsed-sidebar
{
padding-left
:
$sidebar_collapsed_width
;
padding-left
:
$sidebar_collapsed_width
;
...
@@ -289,8 +293,13 @@
...
@@ -289,8 +293,13 @@
@media
(
min-width
:
$screen-md-max
)
{
@media
(
min-width
:
$screen-md-max
)
{
.page-gutter
{
.page-gutter
{
&
.right-sidebar-collapsed
{
@include
collapsed-gutter
;
}
&
.right-sidebar-expanded
{
@include
expanded-gutter
;
@include
expanded-gutter
;
}
}
}
.page-sidebar-collapsed
{
.page-sidebar-collapsed
{
@include
collapsed-sidebar
;
@include
collapsed-sidebar
;
...
...
app/assets/stylesheets/pages/issuable.scss
View file @
9c2bd8b7
...
@@ -72,6 +72,11 @@
...
@@ -72,6 +72,11 @@
@include
clearfix
;
@include
clearfix
;
padding
:
$gl-padding
0
;
padding
:
$gl-padding
0
;
border-bottom
:
1px
solid
#F0F0F0
;
border-bottom
:
1px
solid
#F0F0F0
;
// This prevents the mess when resizing the sidebar
// of elements repositioning themselves..
width
:
210px
;
overflow-x
:
hidden
;
// --
&
:first-child
{
&
:first-child
{
padding-top
:
5px
;
padding-top
:
5px
;
...
@@ -181,14 +186,26 @@
...
@@ -181,14 +186,26 @@
.assignee
.title
,
.assignee
.title
,
.assignee
.selectbox
,
.assignee
.selectbox
,
.assignee
.value
.author
,
.assignee
.value
.author
,
.milestone
,
.milestone
>
*
,
.labels
,
.labels
>
*
,
.participants
,
.participants
>
*
,
.light
,
.light
>
*
,
.project-reference
{
.project-reference
>
*
{
display
:
none
;
display
:
none
;
}
}
.assignee
{
margin-left
:
-7px
;
}
.gutter-toggle
{
margin-left
:
-207px
;
}
.sidebar-collapsed-icon
{
display
:
block
;
}
}
}
&
.right-sidebar-expanded
{
&
.right-sidebar-expanded
{
...
...
app/helpers/application_helper.rb
View file @
9c2bd8b7
...
@@ -307,9 +307,19 @@ module ApplicationHelper
...
@@ -307,9 +307,19 @@ module ApplicationHelper
if
project
.
nil?
if
project
.
nil?
nil
nil
elsif
current_controller?
(
:issues
)
elsif
current_controller?
(
:issues
)
project
.
issues
.
where
(
"id > ?"
,
id
).
fir
st
project
.
issues
.
where
(
"id > ?"
,
id
).
la
st
elsif
current_controller?
(
:merge_requests
)
elsif
current_controller?
(
:merge_requests
)
project
.
merge_requests
.
where
(
"id > ?"
,
id
).
first
project
.
merge_requests
.
where
(
"id > ?"
,
id
).
last
end
end
def
has_next_issuable?
(
project
,
id
)
if
project
.
nil?
nil
elsif
current_controller?
(
:issues
)
project
.
issues
.
where
(
"id > ?"
,
id
).
last
elsif
current_controller?
(
:merge_requests
)
project
.
merge_requests
.
where
(
"id > ?"
,
id
).
last
end
end
end
end
...
@@ -317,9 +327,19 @@ module ApplicationHelper
...
@@ -317,9 +327,19 @@ module ApplicationHelper
if
project
.
nil?
if
project
.
nil?
nil
nil
elsif
current_controller?
(
:issues
)
elsif
current_controller?
(
:issues
)
project
.
issues
.
where
(
"id < ?"
,
id
).
last
project
.
issues
.
where
(
"id < ?"
,
id
).
first
elsif
current_controller?
(
:merge_requests
)
project
.
merge_requests
.
where
(
"id < ?"
,
id
).
first
end
end
def
has_prev_issuable?
(
project
,
id
)
if
project
.
nil?
nil
elsif
current_controller?
(
:issues
)
project
.
issues
.
where
(
"id < ?"
,
id
).
first
elsif
current_controller?
(
:merge_requests
)
elsif
current_controller?
(
:merge_requests
)
project
.
merge_requests
.
where
(
"id < ?"
,
id
).
la
st
project
.
merge_requests
.
where
(
"id < ?"
,
id
).
fir
st
end
end
end
end
...
...
app/helpers/nav_helper.rb
View file @
9c2bd8b7
...
@@ -3,6 +3,18 @@ module NavHelper
...
@@ -3,6 +3,18 @@ module NavHelper
cookies
[
:collapsed_nav
]
==
'true'
cookies
[
:collapsed_nav
]
==
'true'
end
end
def
sidebar_gutter_collapsed_class
if
cookies
[
:collapsed_gutter
]
==
'true'
"right-sidebar-collapsed"
else
"right-sidebar-expanded"
end
end
def
sidebar_gutter_collapsed?
cookies
[
:collapsed_gutter
]
==
'true'
end
def
nav_sidebar_class
def
nav_sidebar_class
if
nav_menu_collapsed?
if
nav_menu_collapsed?
"sidebar-collapsed"
"sidebar-collapsed"
...
@@ -20,8 +32,13 @@ module NavHelper
...
@@ -20,8 +32,13 @@ module NavHelper
end
end
def
page_gutter_class
def
page_gutter_class
if
current_path?
(
'merge_requests#show'
)
||
current_path?
(
'issues#show'
)
if
current_path?
(
'merge_requests#show'
)
||
current_path?
(
'issues#show'
)
"page-gutter"
if
cookies
[
:collapsed_gutter
]
==
'true'
"page-gutter right-sidebar-collapsed"
else
"page-gutter right-sidebar-expanded"
end
end
end
end
end
...
...
app/views/shared/issuable/_participants.html.haml
View file @
9c2bd8b7
.block.participants
.block.participants
.sidebar-collapsed-icon
=
icon
(
'users'
)
.title
.title
=
pluralize
participants
.
count
,
"participant"
=
pluralize
participants
.
count
,
"participant"
-
participants
.
each
do
|
participant
|
-
participants
.
each
do
|
participant
|
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
9c2bd8b7
%aside
.right-sidebar
.right-sidebar-expanded
%aside
.right-sidebar
{
class:
sidebar_gutter_collapsed_class
}
.issuable-sidebar
.issuable-sidebar
.block
.block
%span
.issuable-count.pull-left
%span
.issuable-count.pull-left
...
@@ -7,13 +7,26 @@
...
@@ -7,13 +7,26 @@
=
issuable_count
(
:all
,
@project
)
=
issuable_count
(
:all
,
@project
)
%span
.pull-right
%span
.pull-right
%a
.gutter-toggle
{
href:
'#'
}
%a
.gutter-toggle
{
href:
'#'
}
-
if
sidebar_gutter_collapsed?
=
icon
(
'angle-double-left'
)
-
else
=
icon
(
'angle-double-right'
)
=
icon
(
'angle-double-right'
)
.issuable-nav.pull-right.btn-group
{
role:
'group'
,
"aria-label"
=>
'...'
}
.issuable-nav.pull-right.btn-group
{
role:
'group'
,
"aria-label"
=>
'...'
}
=
link_to
'Prev'
,
namespace_project_issue_path
(
namespace_id:
@project
,
id:
prev_issuable_for
(
@project
,
issuable
.
id
)),
class:
'btn btn-default'
-
if
has_prev_issuable?
(
@project
,
issuable
.
id
)
=
link_to
'Next'
,
namespace_project_issue_path
(
namespace_id:
@project
,
id:
next_issuable_for
(
@project
,
issuable
.
id
)),
class:
'btn btn-default'
=
link_to
'Prev'
,
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
prev_issuable_for
(
@project
,
issuable
.
id
).
try
(
:iid
)),
class:
'btn btn-default'
-
else
%a
.btn.btn-default.disabled
{
href:
'#'
}
Prev
-
if
has_next_issuable?
(
@project
,
issuable
.
id
)
=
link_to
'Next'
,
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
next_issuable_for
(
@project
,
issuable
.
id
).
try
(
:iid
)),
class:
'btn btn-default'
-
else
%a
.btn.btn-default.disabled
{
href:
'#'
}
Next
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
issuable
],
remote:
true
,
html:
{
class:
'issuable-context-form inline-update js-issuable-update'
}
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
issuable
],
remote:
true
,
html:
{
class:
'issuable-context-form inline-update js-issuable-update'
}
do
|
f
|
.block.assignee
.block.assignee
.sidebar-collapsed-icon
=
icon
(
'user'
)
.title
.title
%label
%label
Assignee
Assignee
...
@@ -57,6 +70,8 @@
...
@@ -57,6 +70,8 @@
-
if
issuable
.
project
.
labels
.
any?
-
if
issuable
.
project
.
labels
.
any?
.block.labels
.block.labels
.sidebar-collapsed-icon
=
icon
(
'tags'
)
.title
.title
%label
Labels
%label
Labels
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
...
@@ -77,6 +92,8 @@
...
@@ -77,6 +92,8 @@
-
if
current_user
-
if
current_user
-
subscribed
=
issuable
.
subscribed?
(
current_user
)
-
subscribed
=
issuable
.
subscribed?
(
current_user
)
.block.light
.block.light
.sidebar-collapsed-icon
=
icon
(
'rss'
)
.title
.title
%label
.light
Notifications
%label
.light
Notifications
-
subscribtion_status
=
subscribed
?
'subscribed'
:
'unsubscribed'
-
subscribtion_status
=
subscribed
?
'subscribed'
:
'unsubscribed'
...
@@ -90,6 +107,8 @@
...
@@ -90,6 +107,8 @@
-
project_ref
=
cross_project_reference
(
@project
,
issuable
)
-
project_ref
=
cross_project_reference
(
@project
,
issuable
)
.block.project-reference
.block.project-reference
.sidebar-collapsed-icon
=
icon
(
'clipboard'
)
.title
.title
.cross-project-reference
.cross-project-reference
%span
%span
...
...
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