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 ...@@ -49,6 +49,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')
......
...@@ -100,6 +100,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -100,6 +100,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.target_project, @merge_request], @merge_request.target_project, @merge_request],
notice: 'Merge request was successfully updated.') notice: 'Merge request was successfully updated.')
end end
format.json do
render json: {
saved: @merge_request.valid?,
assignee_avatar_url: @merge_request.assignee.try(:avatar_url)
}
end
end end
else else
render "edit" render "edit"
......
...@@ -3,3 +3,6 @@ ...@@ -3,3 +3,6 @@
= link_to [@project.namespace.becomes(Namespace), @project, merge_request] do = link_to [@project.namespace.becomes(Namespace), @project, merge_request] do
%span.cgray ##{merge_request.iid} %span.cgray ##{merge_request.iid}
= link_to_gfm merge_request.title, [@project.namespace.becomes(Namespace), @project, merge_request], title: merge_request.title = 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