Commit 94963563 authored by Yorick Peterse's avatar Yorick Peterse

Re-use User objects for avatar_icon where possible

This removes the need for running an extra SQL query in these cases.
parent 693e63f5
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
= @user.name = @user.name
%ul.well-list %ul.well-list
%li %li
= image_tag avatar_icon(@user.email, 60), class: "avatar s60" = image_tag avatar_icon(@user, 60), class: "avatar s60"
%li %li
%span.light Profile page: %span.light Profile page:
%strong %strong
......
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
= link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title = link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title
.pull-right.assignee-icon .pull-right.assignee-icon
- if issue.assignee - if issue.assignee
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" = image_tag avatar_icon(issue.assignee, 16), class: "avatar s16"
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
= link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title = link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title
.pull-right.assignee-icon .pull-right.assignee-icon
- if merge_request.assignee - if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16" = image_tag avatar_icon(merge_request.assignee, 16), class: "avatar s16"
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
- @dashboard_milestone.participants.each do |user| - @dashboard_milestone.participants.each do |user|
%li %li
= link_to user, title: user.name, class: "darken" do = link_to user, title: user.name, class: "darken" do
= image_tag avatar_icon(user.email, 32), class: "avatar s32" = image_tag avatar_icon(user, 32), class: "avatar s32"
%strong= truncate(user.name, lenght: 40) %strong= truncate(user.name, lenght: 40)
%br %br
%small.cgray= user.username %small.cgray= user.username
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%li{class: "#{dom_class(member)} js-toggle-container", id: dom_id(member)} %li{class: "#{dom_class(member)} js-toggle-container", id: dom_id(member)}
%span{class: ("list-item-name" if show_controls)} %span{class: ("list-item-name" if show_controls)}
- if member.user - if member.user
= image_tag avatar_icon(user.email, 16), class: "avatar s16", alt: '' = image_tag avatar_icon(user, 16), class: "avatar s16", alt: ''
%strong %strong
= link_to user.name, user_path(user) = link_to user.name, user_path(user)
%span.cgray= user.username %span.cgray= user.username
......
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
= link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title = link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title
.pull-right.assignee-icon .pull-right.assignee-icon
- if issue.assignee - if issue.assignee
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16", alt: '' = image_tag avatar_icon(issue.assignee, 16), class: "avatar s16", alt: ''
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
= link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title = link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title
.pull-right.assignee-icon .pull-right.assignee-icon
- if merge_request.assignee - if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16", alt: '' = image_tag avatar_icon(merge_request.assignee, 16), class: "avatar s16", alt: ''
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
- @group_milestone.participants.each do |user| - @group_milestone.participants.each do |user|
%li %li
= link_to user, title: user.name, class: "darken" do = link_to user, title: user.name, class: "darken" do
= image_tag avatar_icon(user.email, 32), class: "avatar s32" = image_tag avatar_icon(user, 32), class: "avatar s32"
%strong= truncate(user.name, lenght: 40) %strong= truncate(user.name, lenght: 40)
%br %br
%small.cgray= user.username %small.cgray= user.username
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
= render partial: 'layouts/collapse_button' = render partial: 'layouts/collapse_button'
- if current_user - if current_user
= link_to current_user, class: 'sidebar-user' do = link_to current_user, class: 'sidebar-user' do
= image_tag avatar_icon(current_user.email, 60), alt: 'User activity', class: 'avatar avatar s36' = image_tag avatar_icon(current_user, 60), alt: 'User activity', class: 'avatar avatar s36'
.username .username
= current_user.username = current_user.username
.content-wrapper .content-wrapper
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
= render partial: 'layouts/collapse_button' = render partial: 'layouts/collapse_button'
- if current_user - if current_user
= link_to current_user, class: 'sidebar-user' do = link_to current_user, class: 'sidebar-user' do
= image_tag avatar_icon(current_user.email, 60), alt: 'User activity', class: 'avatar avatar s36' = image_tag avatar_icon(current_user, 60), alt: 'User activity', class: 'avatar avatar s36'
.username .username
= current_user.username = current_user.username
.content-wrapper .content-wrapper
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
.col-md-5 .col-md-5
.light-well .light-well
= image_tag avatar_icon(@user.email, 160), alt: '', class: 'avatar s160' = image_tag avatar_icon(@user, 160), alt: '', class: 'avatar s160'
.clearfix .clearfix
.profile-avatar-form-option .profile-avatar-form-option
......
%li{ id: dom_id(issue, 'sortable'), class: 'issue-row', 'data-iid' => issue.iid, 'data-url' => issue_path(issue) } %li{ id: dom_id(issue, 'sortable'), class: 'issue-row', 'data-iid' => issue.iid, 'data-url' => issue_path(issue) }
.pull-right.assignee-icon .pull-right.assignee-icon
- if issue.assignee - if issue.assignee
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16", alt: '' = image_tag avatar_icon(issue.assignee, 16), class: "avatar s16", alt: ''
%span %span
= link_to [@project.namespace.becomes(Namespace), @project, issue] do = link_to [@project.namespace.becomes(Namespace), @project, issue] do
%span.cgray ##{issue.iid} %span.cgray ##{issue.iid}
......
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
= link_to_gfm merge_request.title, [@project.namespace.becomes(Namespace), @project, merge_request], title: merge_request.title = link_to_gfm merge_request.title, [@project.namespace.becomes(Namespace), @project, merge_request], title: merge_request.title
.pull-right.assignee-icon .pull-right.assignee-icon
- if merge_request.assignee - if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16", alt: '' = image_tag avatar_icon(merge_request.assignee, 16), class: "avatar s16", alt: ''
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
- @users.each do |user| - @users.each do |user|
%li %li
= link_to user, title: user.name, class: "darken" do = link_to user, title: user.name, class: "darken" do
= image_tag avatar_icon(user.email, 32), class: "avatar s32" = image_tag avatar_icon(user, 32), class: "avatar s32"
%strong= truncate(user.name, lenght: 40) %strong= truncate(user.name, lenght: 40)
%br %br
%small.cgray= user.username %small.cgray= user.username
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%li{class: "#{dom_class(member)} js-toggle-container project_member_row access-#{member.human_access.downcase}", id: dom_id(member)} %li{class: "#{dom_class(member)} js-toggle-container project_member_row access-#{member.human_access.downcase}", id: dom_id(member)}
%span.list-item-name %span.list-item-name
- if member.user - if member.user
= image_tag avatar_icon(user.email, 16), class: "avatar s16", alt: '' = image_tag avatar_icon(user, 16), class: "avatar s16", alt: ''
%strong %strong
= link_to user.name, user_path(user) = link_to user.name, user_path(user)
%span.cgray= user.username %span.cgray= user.username
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
.row .row
%section.col-md-7 %section.col-md-7
.header-with-avatar .header-with-avatar
= link_to avatar_icon(@user.email, 400), target: '_blank' do = link_to avatar_icon(@user, 400), target: '_blank' do
= image_tag avatar_icon(@user.email, 90), class: "avatar avatar-tile s90", alt: '' = image_tag avatar_icon(@user, 90), class: "avatar avatar-tile s90", alt: ''
%h3 %h3
= @user.name = @user.name
- if @user == current_user - if @user == current_user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment