Replace remaining usages of `user.display_name`

This commit is contained in:
Karina Kwiatek 2021-12-23 22:01:56 +01:00
parent df606a768e
commit 842f51d745
6 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@ module UserHelper
# @return [String] The user name # @return [String] The user name
def user_screen_name(user, anonymous: false, url: true, link_only: false) def user_screen_name(user, anonymous: false, url: true, link_only: false)
return APP_CONFIG['anonymous_name'] if user.nil? || anonymous return APP_CONFIG['anonymous_name'] if user.nil? || anonymous
name = user.display_name.blank? ? user.screen_name : user.display_name name = user.profile.display_name.blank? ? user.screen_name : user.profile.display_name
if url if url
link = show_user_profile_path(user.screen_name) link = show_user_profile_path(user.screen_name)
return link if link_only return link if link_only

View File

@ -32,7 +32,7 @@ class Services::Tumblr < Service
asker = if answer.question.author_is_anonymous? asker = if answer.question.author_is_anonymous?
APP_CONFIG['anonymous_name'] APP_CONFIG['anonymous_name']
else else
answer.question.user.display_name.blank? ? answer.question.user.screen_name : answer.question.user.display_name answer.question.user.profile.display_name.blank? ? answer.question.user.screen_name : answer.question.user.profile.display_name
end end
client.text( client.text(
self.uid, self.uid,

View File

@ -6,12 +6,12 @@
%img.avatar-md.mr-2{ src: u.profile_picture.url(:medium) } %img.avatar-md.mr-2{ src: u.profile_picture.url(:medium) }
.media-body .media-body
%h6.media-heading.answerbox__question-user %h6.media-heading.answerbox__question-user
- if u.display_name.blank? - if u.profile.display_name.blank?
%a{ href: show_user_profile_path(u.screen_name) } %a{ href: show_user_profile_path(u.screen_name) }
= u.screen_name = u.screen_name
- else - else
%a{ href: show_user_profile_path(u.screen_name) } %a{ href: show_user_profile_path(u.screen_name) }
= u.display_name = u.profile.display_name
%span.text-muted= u.screen_name %span.text-muted= u.screen_name
%p.answerbox__question-text %p.answerbox__question-text
- case type - case type

View File

@ -3,9 +3,9 @@
.card-body .card-body
%img.userbox__avatar{ src: user.profile_picture.url(:small) } %img.userbox__avatar{ src: user.profile_picture.url(:small) }
%a.profile__name{ href: show_user_profile_path(user.screen_name) } %a.profile__name{ href: show_user_profile_path(user.screen_name) }
- unless user.display_name.blank? - unless user.profile.display_name.blank?
.profile__display-name .profile__display-name
= user.display_name = user.profile.display_name
.profile__screen-name .profile__screen-name
= user.screen_name = user.screen_name
.row .row

View File

@ -4,9 +4,9 @@
.card-body .card-body
%img.userbox__avatar{ src: user.profile_picture.url(:small) } %img.userbox__avatar{ src: user.profile_picture.url(:small) }
%a.profile__name{ href: show_user_profile_path(user.screen_name) } %a.profile__name{ href: show_user_profile_path(user.screen_name) }
- unless user.display_name.blank? - unless user.profile.display_name.blank?
.profile__display-name .profile__display-name
= user.display_name = user.profile.display_name
.profile__screen-name .profile__screen-name
= user.screen_name = user.screen_name
= render 'user/actions', user: user, type: type = render 'user/actions', user: user, type: type

View File

@ -2,9 +2,9 @@
%img.profile__avatar{ src: user.profile_picture.url(:large) } %img.profile__avatar{ src: user.profile_picture.url(:large) }
.card-body .card-body
.profile__name .profile__name
- unless user.display_name.blank? - unless user.profile.display_name.blank?
.profile__display-name .profile__display-name
= user.display_name = user.profile.display_name
.profile__screen-name .profile__screen-name
= user.screen_name = user.screen_name
.profile__badge-container .profile__badge-container