Appease the dog overlords

This commit is contained in:
Karina Kwiatek 2023-05-09 22:57:18 +02:00
parent e096ddc999
commit 0d55ff16c3
2 changed files with 20 additions and 7 deletions

View File

@ -7,7 +7,10 @@
- if notification.target.answer.user == current_user
= t(".heading_html",
user: user_screen_name(notification.target.user),
answer: link_to(t(".active.link_text"), answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), target: "_top"),
answer: link_to(t(".active.link_text"),
answer_path(username: notification.target.user.screen_name,
id: notification.target.answer.id),
target: "_top"),
time: time_tooltip(notification.target))
- elsif notification.target.user == notification.target.answer.user
= t(".heading_html",
@ -17,7 +20,11 @@
- else
= t(".heading_html",
user: user_screen_name(notification.target.user),
answer: link_to(t(".other.link_text_html", user: user_screen_name(notification.target.answer.user, url: false)), answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), target: "_top"),
answer: link_to(t(".other.link_text_html",
user: user_screen_name(notification.target.answer.user, url: false)),
answer_path(username: notification.target.user.screen_name,
id: notification.target.answer.id),
target: "_top"),
time: time_tooltip(notification.target))
.list-group
.list-group-item

View File

@ -4,17 +4,23 @@
.flex-grow-1
.notification__heading
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small), loading: :lazy }
- if notification.target.parent_type == 'Answer'
- if notification.target.parent_type == "Answer"
= t(".heading_html",
user: user_screen_name(notification.target.user),
type: link_to(t(".#{notification.target.parent_type.downcase}.link_text"), answer_path(username: notification.target.user.screen_name, id: notification.target.parent.id), target: "_top"),
type: link_to(t(".#{notification.target.parent_type.downcase}.link_text"),
answer_path(username: notification.target.user.screen_name,
id: notification.target.parent.id),
target: "_top"),
time: time_tooltip(notification.target))
- elsif notification.target.parent_type == 'Comment'
- elsif notification.target.parent_type == "Comment"
= t(".heading_html",
user: user_screen_name(notification.target.user),
type: link_to(t(".#{notification.target.parent_type.downcase}.link_text"), answer_path(username: notification.target.user.screen_name, id: notification.target.parent.answer.id), target: "_top"),
type: link_to(t(".#{notification.target.parent_type.downcase}.link_text"),
answer_path(username: notification.target.user.screen_name,
id: notification.target.parent.answer.id),
target: "_top"),
time: time_tooltip(notification.target))
.list-group
.list-group-item
%h6.notification__list-heading= t("activerecord.models.#{notification.target.parent_type.downcase}.one")
= markdown notification.target.parent.content[0..60] + (notification.target.parent.content.length > 60 ? '[...]' : '')
= markdown notification.target.parent.content[0..60] + (notification.target.parent.content.length > 60 ? "[...]" : "")