Use appropriate image sizes and lazy loading in answerbox

This commit is contained in:
Andreas Nedbal 2022-10-10 23:14:07 +02:00
parent aedc0adc2c
commit 99b523bf9c
4 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@
.media
.pull-left
%a{ href: user_path(comment.user) }
%img.comment__user-avatar.avatar-sm{ src: comment.user.profile_picture.url(:medium) }
%img.comment__user-avatar.avatar-sm{ src: comment.user.profile_picture.url(:small), loading: :lazy }
.media-body
%h6.media-heading.comment__user
= user_screen_name comment.user

View file

@ -2,7 +2,7 @@
.media
- unless a.question.author_is_anonymous
%a.pull-left{ href: user_path(a.question.user) }
%img.answerbox__question-user-avatar.avatar-md{ src: a.question.user.profile_picture.url(:medium) }
%img.answerbox__question-user-avatar.avatar-md{ src: a.question.user.profile_picture.url(:small), loading: :lazy }
.media-body
- if user_signed_in?
.pull-right

View file

@ -9,4 +9,4 @@
%a{ href: user_path(smile.user),
title: user_screen_name(smile.user, url: false),
data: { toggle: :tooltip, placement: :top, smile_id: smile.id } }
%img.avatar-xs{ src: smile.user.profile_picture.url(:medium) }
%img.avatar-xs{ src: smile.user.profile_picture.url(:small), loading: :lazy }

View file

@ -19,7 +19,7 @@
.media
.pull-left
%a{ href: user_path(a.user) }
%img.answerbox__answer-user-avatar.avatar-sm{ src: a.user.profile_picture.url(:medium) }
%img.answerbox__answer-user-avatar.avatar-sm{ src: a.user.profile_picture.url(:small), loading: :lazy }
.media-body
%h6.media-heading.answerbox__answer-user
= raw t(".answered", hide: hidespan(t(".hide"), "d-none d-sm-inline"), user: user_screen_name(a.user))