diff --git a/app/assets/javascripts/milestone.js.coffee b/app/assets/javascripts/milestone.js.coffee index 5cbddd3a207b0b8b2277e41595190252727d0272..ea01c318d4f911ee81ecc0352977c3cffcc833a6 100644 --- a/app/assets/javascripts/milestone.js.coffee +++ b/app/assets/javascripts/milestone.js.coffee @@ -6,6 +6,13 @@ class Milestone data: data success: (data) -> 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' else new Flash("Issue update failed", 'alert') diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 6c6fc7e0779ef92b79053be885ddb83a8cd80225..ddea8901f9b49a08890c43d00206840a79b87f9f 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -90,6 +90,7 @@ class Projects::IssuesController < Projects::ApplicationController format.json do render json: { saved: @issue.valid?, + assignee_avatar_url: @issue.assignee.try(:avatar_url) } end end diff --git a/app/views/projects/milestones/_issue.html.haml b/app/views/projects/milestones/_issue.html.haml index 7c993e01c23178a561621bcb90f68ddf150710fd..08ccd0cdc8a53eff23bed7812f42ce3c050ba195 100644 --- a/app/views/projects/milestones/_issue.html.haml +++ b/app/views/projects/milestones/_issue.html.haml @@ -3,7 +3,7 @@ = link_to [@project, issue] do %span.cgray ##{issue.iid} = link_to_gfm issue.title, [@project, issue] - - if issue.assignee - .pull-right + .pull-right.assignee-icon + - if issue.assignee = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"