Project

General

Profile

Feature #32030 » 32030.patch

Takenori TAKAKI, 2019-10-24 08:26

View differences:

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

  
37
  def member_avatar(member, options={})
38
    return '' unless member
39
    options.merge!(:title => l(:label_member) + ": " + member.name)
40
    if member.is_a?(User)
41
      avatar(member, options).to_s.html_safe
42
    elsif member.is_a?(Group)
43
      image_tag('group.png', options).to_s.html_safe
44
    else
45
      ''
46
    end
47
  end
48

  
37 49
  # Returns the avatar image tag for the given +user+ if avatars are enabled
38 50
  # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
39 51
  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
    <%= member_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
315 315
table.files tr.file td.filename { text-align: left; padding-left: 24px; }
316 316
table.files tr.file td.digest { font-size: 80%; }
317 317

  
318
table.members td.name img { position: absolute; }
319
table.members td.name div { padding-left: 20px; }
318 320
table.members td.roles, table.memberships td.roles { width: 45%; }
319 321

  
320 322
table.messages td.last_message {text-align:left;}
(3-3/6)