Feature #32030 » 32030-2.patch
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 |
options.merge!(:title => l(:"label_#{principal.class.name.downcase}") + ": " + principal.name) |
|
40 |
if principal.is_a?(User) |
|
41 |
avatar(principal, options).to_s.html_safe |
|
42 |
elsif principal.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 |
<%= 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;} |