From d27ef3aae5be5c660ce2d1eb547ac5eca78e7e9f Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 10 May 2020 11:10:06 +0200 Subject: [PATCH] Fix lints in app/views/notifications --- app/views/notifications/index.haml | 8 ++++---- app/views/notifications/type/_answer.haml | 8 ++++---- app/views/notifications/type/_comment.haml | 13 +++++++------ app/views/notifications/type/_commentsmile.haml | 6 +++--- app/views/notifications/type/_relationship.haml | 4 ++-- app/views/notifications/type/_smile.haml | 6 +++--- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/app/views/notifications/index.haml b/app/views/notifications/index.haml index 86a66d4c..4a004ce0 100644 --- a/app/views/notifications/index.haml +++ b/app/views/notifications/index.haml @@ -1,11 +1,11 @@ .card - %ul#notifications.list-group - - if @notifications.count == 0 + %ul.list-group#notifications + - if @notifications.count.zero? %li.list-group-item.text-center .notifications--none %i.fa.fa-bell-o.notification__bell-icon %p - - if params[:type] != "all" + - if params[:type] != 'all' No new notifications. - else No notifications. @@ -19,5 +19,5 @@ = render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @notifications_last_id, permitted_params: %i[type] - if @more_data_available - %button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @notifications_last_id }} + %button.btn.btn-default#load-more-btn{ type: :button, data: { last_id: @notifications_last_id } } Load more diff --git a/app/views/notifications/type/_answer.haml b/app/views/notifications/type/_answer.haml index f8d8539e..0c3d781d 100644 --- a/app/views/notifications/type/_answer.haml +++ b/app/views/notifications/type/_answer.haml @@ -3,10 +3,10 @@ %i.fa.fa-2x.fa-fw.fa-exclamation .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) } = user_screen_name notification.target.user answered - = link_to "your question", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id) + = link_to 'your question', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id) = time_tooltip(notification.target) ago .list-group @@ -14,9 +14,9 @@ .media.question-media .media-body %h6.notification__list-heading question - = markdown notification.target.question.content[0..60] + "#{notification.target.question.content.length > 60 ? '[...]' : ''}" + = markdown notification.target.question.content[0..60] + (notification.target.question.content.length > 60 ? '[...]' : '') .list-group-item .media.question-media .media-body %h6.notification__list-heading answer - = markdown notification.target.content[0..60] + "#{notification.target.content.length > 60 ? '[...]' : ''}" \ No newline at end of file + = markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '') diff --git a/app/views/notifications/type/_comment.haml b/app/views/notifications/type/_comment.haml index 91f58666..02ee271a 100644 --- a/app/views/notifications/type/_comment.haml +++ b/app/views/notifications/type/_comment.haml @@ -3,15 +3,16 @@ %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) } = user_screen_name notification.target.user commented on - if notification.target.answer.user == current_user - = link_to "your answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) + = link_to 'your answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) - elsif notification.target.user == notification.target.answer.user - = link_to "their answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) + = link_to 'their answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) - else - = link_to "#{notification.target.answer.user.screen_name}'s answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) + = link_to "#{notification.target.answer.user.screen_name}'s answer", + show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) = time_tooltip(notification.target) ago .list-group @@ -19,9 +20,9 @@ .media.question-media .media-body %h6.notification__list-heading answer - = markdown notification.target.answer.content[0..60] + "#{notification.target.answer.content.length > 60 ? '[...]' : ''}" + = markdown notification.target.answer.content[0..60] + (notification.target.answer.content.length > 60 ? '[...]' : '') .list-group-item .media.question-media .media-body %h6.notification__list-heading comment - = markdown notification.target.content[0..60] + "#{notification.target.content.length > 60 ? '[...]' : ''}" \ No newline at end of file + = markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '') diff --git a/app/views/notifications/type/_commentsmile.haml b/app/views/notifications/type/_commentsmile.haml index 09833486..b5567eb8 100644 --- a/app/views/notifications/type/_commentsmile.haml +++ b/app/views/notifications/type/_commentsmile.haml @@ -3,10 +3,10 @@ %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) } = user_screen_name notification.target.user smiled - = link_to "your comment", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.comment.answer.id) + = link_to 'your comment', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.comment.answer.id) = time_tooltip(notification.target) ago .list-group @@ -14,4 +14,4 @@ .media.question-media .media-body %h6.notification__list-heading comment - = markdown notification.target.comment.content[0..60] + "#{notification.target.comment.content.length > 60 ? '[...]' : ''}" \ No newline at end of file + = markdown notification.target.comment.content[0..60] + (notification.target.comment.content.length > 60 ? '[...]' : '') diff --git a/app/views/notifications/type/_relationship.haml b/app/views/notifications/type/_relationship.haml index c5654ae5..8e0cf3cf 100644 --- a/app/views/notifications/type/_relationship.haml +++ b/app/views/notifications/type/_relationship.haml @@ -1,8 +1,8 @@ .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) } .media-body %h6.media-heading.notification__user = user_screen_name notification.target.source .notification__text - = raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at)) \ No newline at end of file + = raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at)) diff --git a/app/views/notifications/type/_smile.haml b/app/views/notifications/type/_smile.haml index eabe35c1..9a94d92b 100644 --- a/app/views/notifications/type/_smile.haml +++ b/app/views/notifications/type/_smile.haml @@ -3,10 +3,10 @@ %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) } = user_screen_name notification.target.user smiled - = link_to "your answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) + = link_to 'your answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) = time_tooltip(notification.target) ago .list-group @@ -14,4 +14,4 @@ .media.question-media .media-body %h6.notification__list-heading answer - = markdown notification.target.answer.content[0..60] + "#{notification.target.answer.content.length > 60 ? '[...]' : ''}" \ No newline at end of file + = markdown notification.target.answer.content[0..60] + (notification.target.answer.content.length > 60 ? '[...]' : '')