0002-Show-Gravatar-icons-in-the-Members-tab-in-the-projec.patch

Go MAEDA, 2019-12-01 05:25

Download (2.72 KB)

View differences:

app/helpers/avatars_helper.rb
34 34
    avatar(user, options).to_s.html_safe
35 35
  end
36 36

  
37
  def principal_avatar(principal, options={})
38
    return '' unless principal
39

  
40
    options[:title] = l(:"label_#{principal.class.name.downcase}") + ': ' + principal.name
41
    if principal.is_a?(User)
42
      avatar(principal, options).to_s.html_safe
43
    elsif principal.is_a?(Group)
44
      image_tag('group.png', options).to_s.html_safe
45
    else
46
      ''
47
    end
48
  end
49

  
37 50
  # Returns the avatar image tag for the given +user+ if avatars are enabled
38 51
  # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
39 52
  def avatar(user, options = { })
app/views/projects/settings/_members.html.erb
19 19
  <% members.each do |member| %>
20 20
  <% next if member.new_record? %>
21 21
  <tr id="member-<%= member.id %>" class="member">
22
  <td class="name icon icon-<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
22
  <td class="name">
23
    <%= principal_avatar(member.principal, :size => "14") %> <div><%= link_to_user member.principal %></div>
24
  </td>
23 25
  <td class="roles">
24 26
    <span id="member-<%= member.id %>-roles"><%= member.roles.sort.collect(&:to_s).join(', ') %></span>
25 27
    <div id="member-<%= member.id %>-form"></div>
public/stylesheets/application.css
306 306
table.files tr.file td.filename { text-align: left; padding-left: 24px; }
307 307
table.files tr.file td.digest { font-size: 80%; }
308 308

  
309
table.members td.name img { position: absolute; }
310
table.members td.name div { padding-left: 20px; }
309 311
table.members td.roles, table.memberships td.roles { width: 45%; }
310 312

  
311 313
table.messages td.last_message {text-align:left;}
312
-