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
887227e0
Commit
887227e0
authored
Jul 25, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved some more inline code
removed some global variable comments
parent
fe27de8b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
15 deletions
+20
-15
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+0
-3
app/assets/javascripts/init_issuable_sidebar.js
app/assets/javascripts/init_issuable_sidebar.js
+4
-2
app/assets/javascripts/issuable_context.js
app/assets/javascripts/issuable_context.js
+3
-1
app/assets/javascripts/sidebar/sidebar_bundle.js
app/assets/javascripts/sidebar/sidebar_bundle.js
+2
-1
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+10
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-8
No files found.
app/assets/javascripts/dispatcher.js
View file @
887227e0
...
...
@@ -27,9 +27,6 @@
/* global Shortcuts */
/* global Sidebar */
/* global ShortcutsWiki */
/* global IssuableContext */
/* global IssueStatusSelect */
/* global SubscriptionSelect */
import
Issue
from
'
./issue
'
;
import
BindInOut
from
'
./behaviors/bind_in_out
'
;
...
...
app/assets/javascripts/init_issuable_sidebar.js
View file @
887227e0
...
...
@@ -5,11 +5,13 @@
/* global Sidebar */
export
default
()
=>
{
const
sidebarOptions
=
JSON
.
parse
(
document
.
querySelector
(
'
.js-sidebar-options
'
).
innerHTML
);
new
MilestoneSelect
({
full_path
:
gl
.
sidebarOptions
.
fullPath
,
full_path
:
sidebarOptions
.
fullPath
,
});
new
LabelsSelect
();
new
IssuableContext
(
gl
.
sidebarOptions
.
currentUser
);
new
IssuableContext
(
sidebarOptions
.
currentUser
);
gl
.
Subscription
.
bindAll
(
'
.subscription
'
);
new
gl
.
DueDateSelectors
();
window
.
sidebar
=
new
Sidebar
();
...
...
app/assets/javascripts/issuable_context.js
View file @
887227e0
...
...
@@ -4,6 +4,8 @@
import
Cookies
from
'
js-cookie
'
;
import
UsersSelect
from
'
./users_select
'
;
const
PARTICIPANTS_ROW_COUNT
=
7
;
(
function
()
{
this
.
IssuableContext
=
(
function
()
{
function
IssuableContext
(
currentUser
)
{
...
...
@@ -52,7 +54,7 @@ import UsersSelect from './users_select';
IssuableContext
.
prototype
.
initParticipants
=
function
()
{
$
(
document
).
on
(
"
click
"
,
"
.js-participants-more
"
,
this
.
toggleHiddenParticipants
);
return
$
(
"
.js-participants-author
"
).
each
(
function
(
i
)
{
if
(
i
>=
7
)
{
if
(
i
>=
PARTICIPANTS_ROW_COUNT
)
{
return
$
(
this
).
addClass
(
"
js-participants-hidden
"
).
hide
();
}
});
...
...
app/assets/javascripts/sidebar/sidebar_bundle.js
View file @
887227e0
...
...
@@ -5,7 +5,8 @@ import sidebarAssignees from './components/assignees/sidebar_assignees';
import
Mediator
from
'
./sidebar_mediator
'
;
function
domContentLoaded
()
{
const
mediator
=
new
Mediator
(
gl
.
sidebarOptions
);
const
sidebarOptions
=
JSON
.
parse
(
document
.
querySelector
(
'
.js-sidebar-options
'
).
innerHTML
);
const
mediator
=
new
Mediator
(
sidebarOptions
);
mediator
.
fetch
();
const
sidebarAssigneesEl
=
document
.
querySelector
(
'
#js-vue-sidebar-assignees
'
);
...
...
app/helpers/issuables_helper.rb
View file @
887227e0
...
...
@@ -354,4 +354,14 @@ module IssuablesHelper
params
[
:format
]
=
:json
if
issuable
.
is_a?
(
Issue
)
end
end
def
issuable_sidebar_options
(
issuable
,
can_edit_issuable
)
{
endpoint:
"
#{
issuable_json_path
(
issuable
)
}
?basic=true"
,
editable:
can_edit_issuable
,
currentUser:
current_user
.
as_json
(
only:
[
:username
,
:id
,
:name
],
methods: :avatar_url
),
rootPath:
root_path
,
fullPath:
@project
.
full_path
}
end
end
app/views/shared/issuable/_sidebar.html.haml
View file @
887227e0
...
...
@@ -138,11 +138,4 @@
=
project_ref
=
clipboard_button
(
text:
project_ref
,
title:
"Copy reference to clipboard"
,
placement:
"left"
)
:javascript
gl
.
sidebarOptions
=
{
endpoint
:
"
#{
issuable_json_path
(
issuable
)
}
?basic=true
"
,
editable
:
#{
can_edit_issuable
?
true
:
false
}
,
currentUser
:
#{
current_user
.
to_json
(
only:
[
:username
,
:id
,
:name
],
methods: :avatar_url
)
}
,
rootPath
:
"
#{
root_path
}
"
,
fullPath
:
"
#{
@project
.
full_path
}
"
,
};
%script
.js-sidebar-options
{
type:
"application/json"
}=
issuable_sidebar_options
(
issuable
,
can_edit_issuable
).
to_json
.
html_safe
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