Commit be94e135 authored by Douwe Maan's avatar Douwe Maan

Add assignee icon to milestone merge requests.

parent dc558eb2
......@@ -49,6 +49,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')
......
......@@ -100,6 +100,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.target_project, @merge_request],
notice: 'Merge request was successfully updated.')
end
format.json do
render json: {
saved: @merge_request.valid?,
assignee_avatar_url: @merge_request.assignee.try(:avatar_url)
}
end
end
else
render "edit"
......
......@@ -3,3 +3,6 @@
= link_to [@project.namespace.becomes(Namespace), @project, merge_request] do
%span.cgray ##{merge_request.iid}
= link_to_gfm merge_request.title, [@project.namespace.becomes(Namespace), @project, merge_request], title: merge_request.title
.pull-right.assignee-icon
- if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment