diff --git a/app/views/notifications/type/_comment.html.haml b/app/views/notifications/type/_comment.html.haml index 325ceb61..4e079878 100644 --- a/app/views/notifications/type/_comment.html.haml +++ b/app/views/notifications/type/_comment.html.haml @@ -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 diff --git a/app/views/notifications/type/_reaction.html.haml b/app/views/notifications/type/_reaction.html.haml index 08716738..e9958905 100644 --- a/app/views/notifications/type/_reaction.html.haml +++ b/app/views/notifications/type/_reaction.html.haml @@ -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 ? "[...]" : "")