Commit d0779d61d34334d56b2e5131faca8758ee928a74
Exists in
master
and in
4 other branches
Merge pull request #4239 from karlhungus/feature-alt-text-for-gravatars
Gravatar image fixes when gravatar unavailable
Showing
18 changed files
with
18 additions
and
19 deletions
Show diff stats
app/assets/stylesheets/gitlab_bootstrap/avatar.scss
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | |
16 | 16 | &.s16 { width: 16px; height: 16px; margin-right: 6px; } |
17 | 17 | &.s24 { width: 24px; height: 24px; margin-right: 8px; } |
18 | + &.s26 { width: 26px; height: 26px; margin-right: 8px; } | |
18 | 19 | &.s32 { width: 32px; height: 32px; margin-right: 10px; } |
19 | 20 | &.s90 { width: 90px; height: 90px; margin-right: 15px; } |
20 | 21 | } | ... | ... |
app/helpers/projects_helper.rb
... | ... | @@ -25,7 +25,7 @@ module ProjectsHelper |
25 | 25 | author_html = "" |
26 | 26 | |
27 | 27 | # Build avatar image tag |
28 | - author_html << image_tag(gravatar_icon(author.try(:email), opts[:size]), width: opts[:size], class: "avatar avatar-inline #{"s#{opts[:size]}" if opts[:size]}") if opts[:avatar] | |
28 | + author_html << image_tag(gravatar_icon(author.try(:email), opts[:size]), width: opts[:size], class: "avatar avatar-inline #{"s#{opts[:size]}" if opts[:size]}", alt:'') if opts[:avatar] | |
29 | 29 | |
30 | 30 | # Build name span tag |
31 | 31 | author_html << content_tag(:span, sanitize(author.name), class: 'author') if opts[:name] | ... | ... |
app/views/admin/users/show.html.haml
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | %h5.title |
25 | 25 | Account: |
26 | 26 | .pull-right |
27 | - = image_tag gravatar_icon(@admin_user.email, 32), class: "avatar s32" | |
27 | + = image_tag gravatar_icon(@admin_user.email, 32), class:"avatar s32", alt:"" | |
28 | 28 | %ul.well-list |
29 | 29 | %li |
30 | 30 | %span.light Name: |
... | ... | @@ -62,7 +62,6 @@ |
62 | 62 | %span.light Created by: |
63 | 63 | %strong |
64 | 64 | = link_to @admin_user.created_by.name, [:admin, @admin_user.created_by] |
65 | - | |
66 | 65 | %hr |
67 | 66 | %h5 |
68 | 67 | Add User to Projects | ... | ... |
app/views/events/_commit.html.haml
1 | 1 | %li.commit |
2 | 2 | %p |
3 | - = link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id" | |
3 | + = link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id", alt: '' | |
4 | 4 | %span= commit[:author][:name] |
5 | 5 | – |
6 | 6 | = image_tag gravatar_icon(commit[:author][:email]), class: "avatar", width: 16 | ... | ... |
app/views/events/_event.html.haml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | #{time_ago_in_words(event.created_at)} ago. |
5 | 5 | |
6 | 6 | = cache event do |
7 | - = image_tag gravatar_icon(event.author_email), class: "avatar s24" | |
7 | + = image_tag gravatar_icon(event.author_email), class: "avatar s24", alt:'' | |
8 | 8 | |
9 | 9 | - if event.push? |
10 | 10 | = render "events/event/push", event: event | ... | ... |
app/views/groups/people.html.haml
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | %ul.well-list |
13 | 13 | - @users.each do |user| |
14 | 14 | %li |
15 | - = image_tag gravatar_icon(user.email, 16), class: "avatar s16" | |
15 | + = image_tag gravatar_icon(user.email, 16), class: "avatar s16" , alt: '' | |
16 | 16 | %strong= user.name |
17 | 17 | %span.cgray= user.email |
18 | 18 | - if @group.owner == user | ... | ... |
app/views/issues/_issues.html.haml
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | - @project.users.sort_by(&:name).each do |user| |
54 | 54 | %li |
55 | 55 | = link_to project_issues_with_filter_path(@project, assignee_id: user.id) do |
56 | - = image_tag gravatar_icon(user.email), class: "avatar s16" | |
56 | + = image_tag gravatar_icon(user.email), class: "avatar s16", alt: '' | |
57 | 57 | = user.name |
58 | 58 | |
59 | 59 | .dropdown.inline.prepend-left-10 | ... | ... |
app/views/layouts/_head_panel.html.haml
app/views/notes/_discussion.html.haml
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | = link_to "javascript:;", class: "js-details-target turn-off js-toggler-target" do |
9 | 9 | %i.icon-eye-open |
10 | 10 | Show discussion |
11 | - = image_tag gravatar_icon(note.author.email), class: "avatar s32" | |
11 | + = image_tag gravatar_icon(note.author.email), class: "avatar s32", alt: '' | |
12 | 12 | %div |
13 | 13 | = link_to_member(@project, note.author, avatar: false) |
14 | 14 | - if note.for_merge_request? | ... | ... |
app/views/notes/_note.html.haml
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) |
9 | 9 | = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure you want to remove comment?', remote: true, class: "danger js-note-delete" do |
10 | 10 | %i.icon-trash.cred |
11 | - = image_tag gravatar_icon(note.author.email), class: "avatar s32" | |
11 | + = image_tag gravatar_icon(note.author.email), class: "avatar s32", alt: '' | |
12 | 12 | = link_to_member(@project, note.author, avatar: false) |
13 | 13 | %span.note-last-update |
14 | 14 | = time_ago_in_words(note.updated_at) | ... | ... |
app/views/profiles/show.html.haml
app/views/repositories/_branch.html.haml
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | %td |
13 | 13 | = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do |
14 | 14 | = commit.short_id |
15 | - = image_tag gravatar_icon(commit.author_email), class: "avatar s16" | |
15 | + = image_tag gravatar_icon(commit.author_email), class: "avatar s16", alt: '' | |
16 | 16 | %span.light |
17 | 17 | = gfm escape_once(truncate(commit.title, length: 40)) |
18 | 18 | %span | ... | ... |
app/views/repositories/_feed.html.haml
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | %div |
12 | 12 | = link_to project_commits_path(@project, commit.id) do |
13 | 13 | %code= commit.short_id |
14 | - = image_tag gravatar_icon(commit.author_email), class: "", width: 16 | |
14 | + = image_tag gravatar_icon(commit.author_email), class: "", width: 16, alt: '' | |
15 | 15 | = gfm escape_once(truncate(commit.title, length: 40)) |
16 | 16 | %td |
17 | 17 | %span.pull-right.cgray | ... | ... |
app/views/repositories/stats.html.haml
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | %ol.styled |
20 | 20 | - @stats.authors[0...50].each do |author| |
21 | 21 | %li |
22 | - = image_tag gravatar_icon(author.email, 16), class: 'avatar s16' | |
22 | + = image_tag gravatar_icon(author.email, 16), class: 'avatar s16', alt: '' | |
23 | 23 | = author.name |
24 | 24 | %small.light= author.email |
25 | 25 | .pull-right | ... | ... |
app/views/snippets/_snippet.html.haml
... | ... | @@ -25,6 +25,6 @@ |
25 | 25 | = "##{snippet.id}" |
26 | 26 | %span.light |
27 | 27 | by |
28 | - = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16" | |
28 | + = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: '' | |
29 | 29 | = snippet.author_name |
30 | 30 | ... | ... |
app/views/team_members/_team_member.html.haml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | .row |
5 | 5 | .span4 |
6 | 6 | = link_to user, title: user.name, class: "dark" do |
7 | - = image_tag gravatar_icon(user.email, 32), class: "avatar s32" | |
7 | + = image_tag gravatar_icon(user.email, 32), class: "avatar s32", alt: '' | |
8 | 8 | %strong= truncate(user.name, lenght: 40) |
9 | 9 | %br |
10 | 10 | %small.cgray= user.username | ... | ... |
app/views/teams/members/_member.html.haml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | .row |
5 | 5 | .span3 |
6 | 6 | = link_to user_path(user.username), title: user.name, class: "dark" do |
7 | - = image_tag gravatar_icon(user.email, 40), class: "avatar s32" | |
7 | + = image_tag gravatar_icon(user.email, 40), class: "avatar s32", alt: '' | |
8 | 8 | = link_to user_path(user.username), title: user.name, class: "dark" do |
9 | 9 | %strong= truncate(user.name, lenght: 40) |
10 | 10 | %br | ... | ... |
app/views/users/show.html.haml