Project

General

Profile

Feature #21662 » 0002-Add-display-gravatar-on-assigners-list.patch

Tomomi Yuzuriha, 2017-12-05 01:18

View differences:

app/views/issues/_attributes.html.erb
83 83
<% include_calendar_headers_tags %>
84 84
<% if @issue.safe_attribute? 'assigned_to_id' %>
85 85
  <%= javascript_tag do %>
86
    var assignner_list = <%=  raw  [{:id => User.current.id, :label => "<< #{l(:label_me)} >>", :category => 'User'}]
87
      .concat(@issue.assignable_users.select{|u|u.is_a?(User)}.map{|u|{:id => u.id, :label => u.name, :category => 'User'}})
88
      .concat(@issue.assignable_users.select{|u|u.is_a?(Group)}.map{|u|{:id => u.id, :label => u.name, :category => 'Group'}}).to_json %>;
86
    var assignner_list = <%=  raw  [{:id => User.current.id, :label => "<< #{l(:label_me)} >>", :category => 'User', :avatar => avatar(User.current, :size => "18", :class => "gravatar gravatar-child")}]
87
      .concat(@issue.assignable_users.select{|u|u.is_a?(User)}.map{|u|{:id => u.id, :label => u.name, :category => 'User', :avatar => avatar(u, :size => "18", :class => "gravatar gravatar-child")}})
88
      .concat(@issue.assignable_users.select{|u|u.is_a?(Group)}.map{|u|{:id => u.id, :label => u.name, :category => 'Group', :avatar => ''}}).to_json %>;
89 89
    observeAutocompleteField('issue_assigned_to_autocomplete', '', {
90 90
      source: assignner_list,
91 91
      minLength: 0,
......
115 115
        $(this).data('ui-autocomplete')._renderItem = function(ul, item){
116 116
          ul.css({'background':'#eee','overflow':'scroll'});
117 117
          return $('<li style="white-space:nowrap">')
118
            .append('<div>'+item.label+'</div>')
118
            .append('<div>'+item.avatar+' '+item.label+'</div>')
119 119
            .appendTo(ul);
120 120
        };
121 121
      }
(8-8/13)