Commit 8d240fb0e76f6333a51b1e9eaffb9196d2e4557a
1 parent
f31f101d
Exists in
spb-stable
and in
2 other branches
Show/hide issue assignee avatar depends on drag-n-drop column in milestone view
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
10 additions
and
2 deletions
Show diff stats
app/assets/javascripts/milestone.js.coffee
@@ -6,6 +6,13 @@ class Milestone | @@ -6,6 +6,13 @@ class Milestone | ||
6 | data: data | 6 | data: data |
7 | success: (data) -> | 7 | success: (data) -> |
8 | if data.saved == true | 8 | if data.saved == true |
9 | + if data.assignee_avatar_url | ||
10 | + img_tag = $('<img/>') | ||
11 | + img_tag.attr('src', data.assignee_avatar_url) | ||
12 | + img_tag.addClass('avatar s16') | ||
13 | + $(li).find('.assignee-icon').html(img_tag) | ||
14 | + else | ||
15 | + $(li).find('.assignee-icon').html('') | ||
9 | $(li).effect 'highlight' | 16 | $(li).effect 'highlight' |
10 | else | 17 | else |
11 | new Flash("Issue update failed", 'alert') | 18 | new Flash("Issue update failed", 'alert') |
app/controllers/projects/issues_controller.rb
@@ -90,6 +90,7 @@ class Projects::IssuesController < Projects::ApplicationController | @@ -90,6 +90,7 @@ class Projects::IssuesController < Projects::ApplicationController | ||
90 | format.json do | 90 | format.json do |
91 | render json: { | 91 | render json: { |
92 | saved: @issue.valid?, | 92 | saved: @issue.valid?, |
93 | + assignee_avatar_url: @issue.assignee.try(:avatar_url) | ||
93 | } | 94 | } |
94 | end | 95 | end |
95 | end | 96 | end |
app/views/projects/milestones/_issue.html.haml
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | = link_to [@project, issue] do | 3 | = link_to [@project, issue] do |
4 | %span.cgray ##{issue.iid} | 4 | %span.cgray ##{issue.iid} |
5 | = link_to_gfm issue.title, [@project, issue] | 5 | = link_to_gfm issue.title, [@project, issue] |
6 | - - if issue.assignee | ||
7 | - .pull-right | 6 | + .pull-right.assignee-icon |
7 | + - if issue.assignee | ||
8 | = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" | 8 | = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" |
9 | 9 |