Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
858af2bb6ceb
Unverified
Commit
8a55636f
authored
Feb 18, 2014
by
Dmitriy Zaporozhets
Browse files
Dont replace all issue context when change assignee/milestone
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d1e9a62a8e50
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/dispatcher.js.coffee
View file @
858af2bb
...
...
@@ -19,6 +19,8 @@ class Dispatcher
switch
page
when
'projects:issues:index'
Issues
.
init
()
when
'projects:issues:show'
new
Issue
()
when
'projects:issues:new'
,
'projects:merge_requests:new'
GitLab
.
GfmAutoComplete
.
setup
()
when
'dashboard:show'
...
...
app/assets/javascripts/issue.js.coffee
0 → 100644
View file @
858af2bb
class
Issue
constructor
:
->
$
(
'.edit-issue.inline-update input[type="submit"]'
).
hide
()
$
(
".issue-box .inline-update"
).
on
"change"
,
"select"
,
->
$
(
this
).
submit
()
$
(
".issue-box .inline-update"
).
on
"change"
,
"#issue_assignee_id"
,
->
$
(
this
).
submit
()
@
Issue
=
Issue
app/assets/javascripts/issues.js.coffee
View file @
858af2bb
...
...
@@ -77,9 +77,3 @@
$
(
"#update_issues_ids"
).
val
[]
$
(
".issues_bulk_update"
).
hide
()
$
(
".issues-filters"
).
show
()
$
->
$
(
'.edit-issue.inline-update input[type="submit"]'
).
hide
();
$
(
"body"
).
on
"change"
,
".edit-issue.inline-update select"
,
->
$
(
this
).
submit
()
app/assets/javascripts/project_users_select.js.coffee
View file @
858af2bb
$
->
projectUserFormatResult
=
(
user
)
->
@
projectUsersSelect
=
init
:
->
$
(
'.ajax-project-users-select'
).
each
(
i
,
select
)
->
project_id
=
$
(
'body'
).
data
(
'project-id'
)
$
(
select
).
select2
placeholder
:
$
(
select
).
data
(
'placeholder'
)
||
"Search for a user"
multiple
:
$
(
select
).
hasClass
(
'multiselect'
)
minimumInputLength
:
0
query
:
(
query
)
->
Api
.
projectUsers
project_id
,
query
.
term
,
(
users
)
->
data
=
{
results
:
users
}
query
.
callback
(
data
)
initSelection
:
(
element
,
callback
)
->
id
=
$
(
element
).
val
()
if
id
isnt
""
Api
.
user
(
id
,
callback
)
formatResult
:
projectUsersSelect
.
projectUserFormatResult
formatSelection
:
projectUsersSelect
.
projectUserFormatSelection
dropdownCssClass
:
"ajax-project-users-dropdown"
dropdownAutoWidth
:
true
escapeMarkup
:
(
m
)
->
# we do not want to escape markup since we are displaying html in results
m
projectUserFormatResult
:
(
user
)
->
if
user
.
avatar_url
avatar
=
user
.
avatar_url
else
if
gon
.
gravatar_enabled
...
...
@@ -15,30 +41,8 @@ $ ->
<div class='user-username'>
#{
user
.
username
}
</div>
</div>"
projectUserFormatSelection
=
(
user
)
->
projectUserFormatSelection
:
(
user
)
->
user
.
name
$
(
'.ajax-project-users-select'
).
each
(
i
,
select
)
->
project_id
=
$
(
'body'
).
data
(
'project-id'
)
$
(
select
).
select2
placeholder
:
$
(
select
).
data
(
'placeholder'
)
||
"Search for a user"
multiple
:
$
(
select
).
hasClass
(
'multiselect'
)
minimumInputLength
:
0
query
:
(
query
)
->
Api
.
projectUsers
project_id
,
query
.
term
,
(
users
)
->
data
=
{
results
:
users
}
query
.
callback
(
data
)
initSelection
:
(
element
,
callback
)
->
id
=
$
(
element
).
val
()
if
id
isnt
""
Api
.
user
(
id
,
callback
)
formatResult
:
projectUserFormatResult
formatSelection
:
projectUserFormatSelection
dropdownCssClass
:
"ajax-project-users-dropdown"
dropdownAutoWidth
:
true
escapeMarkup
:
(
m
)
->
# we do not want to escape markup since we are displaying html in results
m
$
->
projectUsersSelect
.
init
()
app/views/projects/issues/_issue_context.html.haml
View file @
858af2bb
...
...
@@ -4,9 +4,6 @@
\ and currently assigned to
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
link_to
profile_path
(
issue
.
assignee
)
do
=
image_tag
(
avatar_icon
(
issue
.
assignee
.
email
),
class:
'avatar avatar-inline s16 assignee'
)
if
issue
.
assignee
=
project_users_select_tag
(
'issue[assignee_id]'
,
placeholder:
'Select a user'
,
class:
'custom-form-control'
,
selected:
@issue
.
assignee_id
)
-
elsif
issue
.
assignee
=
link_to_member
(
@project
,
@issue
.
assignee
)
...
...
app/views/projects/issues/update.js.haml
View file @
858af2bb
...
...
@@ -3,10 +3,7 @@
:plain
$("##{dom_id(@issue)}").fadeOut();
-
elsif
params
[
:issue_context
]
$('.issue-box .context').html("
#{
escape_javascript
(
render
partial:
'issue_context'
,
locals:
{
issue:
@issue
})
}
");
$('.issue-box .context').effect('highlight');
$('.select2').select2();
$('.edit-issue.inline-update input[type="submit"]').hide();
-
if
@issue
.
milestone
$('.milestone-nav-link').replaceWith("
<span
class=
'milestone-nav-link'
>
|
<span
class=
'light'
>
Milestone
</span>
#{
escape_javascript
(
link_to
@issue
.
milestone
.
title
,
project_milestone_path
(
@issue
.
project
,
@issue
.
milestone
))
}
</span>
")
-
else
...
...
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