From 47fde17560c3860f65d0f365a3a2d6ff6c6bc620 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Mon, 20 Apr 2020 23:18:14 +0100 Subject: [PATCH] Remove deprecated gravatar_url method --- app/helpers/application_helper.rb | 9 --------- app/views/inbox/_entry.html.haml | 2 +- app/views/moderation/_discussion.html.haml | 2 +- app/views/moderation/_moderationbox.html.haml | 2 +- app/views/shared/_answerbox.html.haml | 4 ++-- app/views/shared/_comment_smiles.html.haml | 2 +- app/views/shared/_comments.html.haml | 2 +- app/views/shared/_question_header.haml | 2 +- app/views/shared/_smiles.html.haml | 2 +- 9 files changed, 9 insertions(+), 18 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dd1c7651..3f9e1977 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -89,15 +89,6 @@ module ApplicationHelper ((!current_user.nil?) && ((current_user == user) || current_user.mod?)) ? true : false end - # @deprecated Use {User#profile_picture.url} instead. - def gravatar_url(user) - return user.profile_picture.url :medium - # return '/cage.png' - #return '//www.gravatar.com/avatar' if user.nil? - #return "//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user)}" if user.is_a? String - #"//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user.email)}" - end - def ios_web_app? user_agent = request.env['HTTP_USER_AGENT'] || 'Mozilla/5.0' # normal MobileSafari.app UA: Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B435 Safari/600.1.4 diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 68ea268d..3bed6c9b 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -3,7 +3,7 @@ .media - unless i.question.author_is_anonymous %a.pull-left{href: show_user_profile_path(i.question.user.screen_name)} - %img.img-rounded.answerbox--img{src: gravatar_url(i.question.user)} + %img.img-rounded.answerbox--img{src: i.question.user.profile_picture.url(:medium)} .media-body %h6.text-muted.media-heading.answerbox--question-user = raw t('views.inbox.entry.asked', user: user_screen_name(i.question.user, anonymous: i.question.author_is_anonymous), time: time_tooltip(i.question)) diff --git a/app/views/moderation/_discussion.html.haml b/app/views/moderation/_discussion.html.haml index 66a41285..dddb7866 100644 --- a/app/views/moderation/_discussion.html.haml +++ b/app/views/moderation/_discussion.html.haml @@ -6,7 +6,7 @@ %li{data: { comment_id: comment.id }} .media.comments--media .pull-left - %img.img-rounded.answerbox--img{src: gravatar_url(comment.user)} + %img.img-rounded.answerbox--img{src: comment.user.profile_picture.url(:medium)} .media-body.comments--body %h6.media-heading.answerbox--question-user = user_screen_name comment.user diff --git a/app/views/moderation/_moderationbox.html.haml b/app/views/moderation/_moderationbox.html.haml index c2829837..c341db8d 100644 --- a/app/views/moderation/_moderationbox.html.haml +++ b/app/views/moderation/_moderationbox.html.haml @@ -1,7 +1,7 @@ - unless report.nil? or report.target.nil? or report.user.nil? or report.type.nil? .panel.panel-default.moderationbox{data: { id: report.id }} .panel-heading - %img.img-rounded.answerbox--img{src: gravatar_url(report.user)} + %img.img-rounded.answerbox--img{src: report.user.profile_picture.url(:medium)} = raw t('views.moderation.moderationbox.reported', user: user_screen_name(report.user), content: report.type.sub('Reports::', ''), time: time_tooltip(report)) .panel-body %p diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index 7439f1d9..350397d5 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -4,7 +4,7 @@ .media.question-media - unless a.question.author_is_anonymous %a.pull-left{href: show_user_profile_path(a.question.user.screen_name)} - %img.img-rounded.answerbox--img{src: gravatar_url(a.question.user)} + %img.img-rounded.answerbox--img{src: a.question.user.profile_picture.url(:medium)} .media-body.question-body - if user_signed_in? .pull-right @@ -49,7 +49,7 @@ .media .pull-left %a{href: show_user_profile_path(a.user.screen_name)} - %img.img-rounded.answerbox--img{src: gravatar_url(a.user)} + %img.img-rounded.answerbox--img{src: a.user.profile_picture.url(:medium)} .media-body %h6.media-heading.answerbox--answer-user = raw t('views.answerbox.answered', hide: hidespan(t('views.answerbox.hide'), "xs"), user: user_screen_name(a.user)) diff --git a/app/views/shared/_comment_smiles.html.haml b/app/views/shared/_comment_smiles.html.haml index f3b8aebb..26afb6ad 100644 --- a/app/views/shared/_comment_smiles.html.haml +++ b/app/views/shared/_comment_smiles.html.haml @@ -14,5 +14,5 @@ - comment.smiles.all.each do |smile| %li.user-list-entry.user-list-entry-smiles %a{href: show_user_profile_path(smile.user.screen_name)} - %img.img-rounded{src: gravatar_url(smile.user), alt: user_screen_name(smile.user, url: false)} + %img.img-rounded{src: smile.user), alt: user_screen_name(smile.user, url: false.profile_picture.url(:medium)} %span= user_screen_name(smile.user, url: false) diff --git a/app/views/shared/_comments.html.haml b/app/views/shared/_comments.html.haml index aa22431d..e4435611 100644 --- a/app/views/shared/_comments.html.haml +++ b/app/views/shared/_comments.html.haml @@ -7,7 +7,7 @@ %div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "shared/comment_smiles", comment: comment .media.comments--media .pull-left - %img.img-rounded.answerbox--img{src: gravatar_url(comment.user)} + %img.img-rounded.answerbox--img{src: comment.user.profile_picture.url(:medium)} .media-body.comments--body %h6.media-heading.answerbox--question-user = user_screen_name comment.user diff --git a/app/views/shared/_question_header.haml b/app/views/shared/_question_header.haml index 31e2d2ff..bc5dc694 100644 --- a/app/views/shared/_question_header.haml +++ b/app/views/shared/_question_header.haml @@ -4,7 +4,7 @@ .media.question-media - unless question.author_is_anonymous %a.pull-left{href: unless hidden then show_user_profile_path(question.user.screen_name) end} - %img.img-rounded.answerbox--img{src: gravatar_url(question.user)} + %img.img-rounded.answerbox--img{src: question.user.profile_picture.url(:medium)} .media-body.question-body - if user_signed_in? .pull-right diff --git a/app/views/shared/_smiles.html.haml b/app/views/shared/_smiles.html.haml index 4e3db771..119086a6 100644 --- a/app/views/shared/_smiles.html.haml +++ b/app/views/shared/_smiles.html.haml @@ -7,4 +7,4 @@ - else - a.smiles.all.each do |smile| %a{href: show_user_profile_path(smile.user.screen_name), title: smile.user.screen_name, data: { toggle: :tooltip, placement: :top, smile_id: smile.id }} - %img.img-rounded.answerbox--img-small{src: gravatar_url(smile.user)} \ No newline at end of file + %img.img-rounded.answerbox--img-small{src: smile.user.profile_picture.url(:medium)} \ No newline at end of file