Show/hide issue assignee avatar depends on drag-n-drop column in milestone view
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
f31f101d36
commit
8d240fb0e7
3 changed files with 10 additions and 2 deletions
|
@ -6,6 +6,13 @@ class Milestone
|
||||||
data: data
|
data: data
|
||||||
success: (data) ->
|
success: (data) ->
|
||||||
if data.saved == true
|
if data.saved == true
|
||||||
|
if data.assignee_avatar_url
|
||||||
|
img_tag = $('<img/>')
|
||||||
|
img_tag.attr('src', data.assignee_avatar_url)
|
||||||
|
img_tag.addClass('avatar s16')
|
||||||
|
$(li).find('.assignee-icon').html(img_tag)
|
||||||
|
else
|
||||||
|
$(li).find('.assignee-icon').html('')
|
||||||
$(li).effect 'highlight'
|
$(li).effect 'highlight'
|
||||||
else
|
else
|
||||||
new Flash("Issue update failed", 'alert')
|
new Flash("Issue update failed", 'alert')
|
||||||
|
|
|
@ -90,6 +90,7 @@ class Projects::IssuesController < Projects::ApplicationController
|
||||||
format.json do
|
format.json do
|
||||||
render json: {
|
render json: {
|
||||||
saved: @issue.valid?,
|
saved: @issue.valid?,
|
||||||
|
assignee_avatar_url: @issue.assignee.try(:avatar_url)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
= link_to [@project, issue] do
|
= link_to [@project, issue] do
|
||||||
%span.cgray ##{issue.iid}
|
%span.cgray ##{issue.iid}
|
||||||
= link_to_gfm issue.title, [@project, issue]
|
= link_to_gfm issue.title, [@project, issue]
|
||||||
|
.pull-right.assignee-icon
|
||||||
- if issue.assignee
|
- if issue.assignee
|
||||||
.pull-right
|
|
||||||
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
|
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue