Commit c1b05e7b8638e562ded689ae9a3ae1990fb1d5a7

Authored by Izaak Alpert
1 parent 579c0b97

Gravatar image fixes when gravatar unavailable

-Alt text to image was set to hash, which would make the page display hashes if the image/gravatar  wasn't available, set the alt text to '', and made the main tool bar image follow the same or similar constraints as the other images (.avatar, .s26)

Conflicts:
	app/assets/stylesheets/themes/ui_bb.scss
	app/views/snippets/_snippet.html.haml

Change-Id: I42e1e86f535486fd2556d4b3e4591f3676eea033
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
... ... @@ -20,11 +20,12 @@
20 20  
21 21 .row
22 22 .span6
  23 +<<<<<<< HEAD
23 24 .ui-box
24 25 %h5.title
25 26 Account:
26 27 .pull-right
27   - = image_tag gravatar_icon(@admin_user.email, 32), class: "avatar s32"
  28 + = image_tag gravatar_icon(@admin_user.email, 32), class: "avatar s32", alt: ''
28 29 %ul.well-list
29 30 %li
30 31 %span.light Name:
... ... @@ -62,7 +63,6 @@
62 63 %span.light Created by:
63 64 %strong
64 65 = link_to @admin_user.created_by.name, [:admin, @admin_user.created_by]
65   -
66 66 %hr
67 67 %h5
68 68 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 &ndash;
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
... ... @@ -37,5 +37,4 @@
37 37 %i.icon-signout
38 38 %li
39 39 = link_to current_user, class: "profile-pic" do
40   - = image_tag gravatar_icon(current_user.email, 26)
41   -
  40 + = image_tag(gravatar_icon(current_user.email, 26),alt: '',class: "avatar s26")
... ...
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
1 1 .profile_avatar_holder
2   - = image_tag gravatar_icon(@user.email, 90)
  2 + = image_tag gravatar_icon(@user.email, 90), alt: ''
3 3 %h3.page_title
4 4 = @user.name
5 5 %br
... ...
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
1 1 .row
2 2 .span8
3 3 %h3.page_title
4   - = image_tag gravatar_icon(@user.email, 90), class: "avatar s90"
  4 + = image_tag gravatar_icon(@user.email, 90), class: "avatar s90", alt: ''
5 5 = @user.name
6 6 - if @user == current_user
7 7 .pull-right
... ...