Feature #44509 » 0001-Dim-avatars-of-inactive-users-so-that-locked-users-c.patch
| app/assets/stylesheets/application.css | ||
|---|---|---|
| 2380 | 2380 |
vertical-align: middle; |
| 2381 | 2381 |
flex-shrink: 0; |
| 2382 | 2382 |
} |
| 2383 |
.avatar.locked, .avatar.registered {opacity: .6;}
|
|
| 2383 | 2384 |
span[role="img"].avatar {
|
| 2384 | 2385 |
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; |
| app/helpers/avatars_helper.rb | ||
|---|---|---|
| 39 | 39 |
def avatar(user, options = {})
|
| 40 | 40 |
# "avatar" class should be added to all avatars |
| 41 | 41 |
options[:class] = ['avatar', options[:class]].compact.join(' ')
|
| 42 |
# Add the status of the user as a class (e.g. "active", "locked") |
|
| 43 |
options[:class] += " #{User::LABEL_BY_STATUS[user.status]}" if user.is_a?(User)
|
|
| 42 | 44 |
if user.is_a?(AnonymousUser) |
| 43 | 45 |
anonymous_avatar(options) |
| test/functional/calendars_controller_test.rb | ||
|---|---|---|
| 57 | 57 |
) do |
| 58 | 58 |
assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2' |
| 59 | 59 |
assert_select 'span.tip' do |
| 60 |
assert_select 'img[class="gravatar avatar"]' |
|
| 60 |
assert_select 'img[class="gravatar avatar active"]'
|
|
| 61 | 61 |
end |
| 62 | 62 |
assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2' |
| 63 | 63 |
end |
| test/functional/gantts_controller_test.rb | ||
|---|---|---|
| 58 | 58 |
# Assert context menu on issues subject and gantt bar |
| 59 | 59 |
assert_select 'div[class=?]', 'issue-subject hascontextmenu' |
| 60 | 60 |
assert_select 'div.tooltip.hascontextmenu' do |
| 61 |
assert_select 'img[class="gravatar avatar"]' |
|
| 61 |
assert_select 'img[class="gravatar avatar active"]'
|
|
| 62 | 62 |
end |
| 63 | 63 |
assert_select "form[data-cm-url=?]", '/issues/context_menu' |
| test/helpers/avatars_helper_test.rb | ||
|---|---|---|
| 39 | 39 |
avatar_tag = avatar(User.anonymous) |
| 40 | 40 |
assert_match %r{src="/assets/anonymous(-\w+)?.png"}, avatar_tag
|
| 41 |
assert_match 'class="anonymous-avatar avatar"', avatar_tag |
|
| 41 |
assert_match 'class="anonymous-avatar avatar anon"', avatar_tag
|
|
| 42 | 42 |
end |
| 43 | 43 |
def test_avatar_with_group |
| ... | ... | |
| 88 | 88 |
def test_avatar_disabled_should_display_user_initials |
| 89 | 89 |
with_settings :gravatar_enabled => '0' do |
| 90 |
assert_equal "<span role=\"img\" class=\"avatar-color-2 s24 avatar\">JS</span>", avatar(User.find_by_mail('jsmith@somenet.foo'))
|
|
| 90 |
assert_equal "<span role=\"img\" class=\"avatar-color-2 s24 avatar active\">JS</span>", avatar(User.find_by_mail('jsmith@somenet.foo'))
|
|
| 91 | 91 |
end |
| 92 | 92 |
end |
| 93 |
def test_avatar_should_have_user_status_class |
|
| 94 |
assert_include 'class="gravatar avatar active"', avatar(User.find(2)) |
|
| 95 | ||
| 96 |
user = User.find(5) |
|
| 97 |
assert user.locked? |
|
| 98 |
assert_include 'class="gravatar avatar locked"', avatar(user) |
|
| 99 |
with_settings :gravatar_enabled => '0' do |
|
| 100 |
assert_equal "<span role=\"img\" class=\"avatar-color-5 s24 avatar locked\">DL</span>", avatar(user) |
|
| 101 |
end |
|
| 102 | ||
| 103 |
user.status = User::STATUS_REGISTERED |
|
| 104 |
assert_include 'class="gravatar avatar registered"', avatar(user) |
|
| 105 |
end |
|
| 106 | ||
| 93 | 107 |
def test_avatar_server_url |
| 94 | 108 |
to_test = {
|
| 95 | 109 |
'https://www.gravatar.com' => %r|https://www.gravatar.com/avatar/\h{32}|,
|
- « Previous
- 1
- …
- 4
- 5
- 6
- Next »