Use appropriate image sizes and lazy loading in notifications

This commit is contained in:
Andreas Nedbal 2022-10-10 23:15:05 +02:00
parent fedfbb1333
commit 8d1bd30615
4 changed files with 6 additions and 6 deletions

View File

@ -3,9 +3,9 @@
%i.fa.fa-2x.fa-fw.fa-exclamation
.media-body
.notification__heading
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= t(".heading_html",
user: user_screen_name(notification.target.user),
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small), loading: :lazy }
= t(".heading_html",
user: user_screen_name(notification.target.user),
question: link_to(t(".link_text"), answer_path(username: notification.target.user.screen_name, id: notification.target.id)),
time: time_tooltip(notification.target))
.list-group

View File

@ -3,7 +3,7 @@
%i.fa.fa-2x.fa-fw.fa-comments
.media-body
.notification__heading
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small), loading: :lazy }
- if notification.target.answer.user == current_user
= t(".heading_html",
user: user_screen_name(notification.target.user),

View File

@ -1,6 +1,6 @@
.media.notification
.notification__icon
%img.avatar-sm{ src: notification.target.source.profile_picture.url(:small) }
%img.avatar-sm{ src: notification.target.source.profile_picture.url(:small), loading: :lazy }
.media-body
%h6.media-heading.notification__user
= user_screen_name notification.target.source

View File

@ -3,7 +3,7 @@
%i.fa.fa-2x.fa-fw.fa-smile-o
.media-body
.notification__heading
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small), loading: :lazy }
- if notification.target.parent_type == 'Answer'
= t(".heading_html",
user: user_screen_name(notification.target.user),