From 49265d7a4a085d89a13105a597a87d570efe4154 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 10 May 2020 09:25:34 +0200 Subject: [PATCH] Fix lints in app/views/tabs --- app/views/layouts/feed.haml | 4 ++-- app/views/layouts/user/profile.haml | 2 +- app/views/tabs/_feed.haml | 10 +++++----- app/views/tabs/_moderation.haml | 12 ++++++------ app/views/tabs/_notifications.haml | 26 ++++++++++++++++++-------- app/views/tabs/_profile.haml | 8 ++++---- app/views/tabs/_settings.haml | 4 ++-- 7 files changed, 38 insertions(+), 28 deletions(-) diff --git a/app/views/layouts/feed.haml b/app/views/layouts/feed.haml index dff4d4f9..615fd51d 100644 --- a/app/views/layouts/feed.haml +++ b/app/views/layouts/feed.haml @@ -4,6 +4,6 @@ = render 'shared/sidebar' .col-md-9.col-xs-12.col-sm-8 = render 'layouts/messages' - = render 'tabs/feed' + = render 'tabs/feed', group: @group = yield - .d-block.d-sm-none= render 'shared/links' \ No newline at end of file + .d-block.d-sm-none= render 'shared/links' diff --git a/app/views/layouts/user/profile.haml b/app/views/layouts/user/profile.haml index 51a553a2..d36f8cdc 100644 --- a/app/views/layouts/user/profile.haml +++ b/app/views/layouts/user/profile.haml @@ -7,7 +7,7 @@ .d-none.d-sm-block= render 'shared/links' .col-md-9.col-xs-12.col-sm-8 = render "questionbox" - = render "tabs/profile" + = render "tabs/profile", user: @user = yield - if user_signed_in? = render 'modal/group' diff --git a/app/views/tabs/_feed.haml b/app/views/tabs/_feed.haml index 8ee4fc1c..c4fd6afd 100644 --- a/app/views/tabs/_feed.haml +++ b/app/views/tabs/_feed.haml @@ -3,10 +3,10 @@ = list_group_item t('views.general.timeline'), root_path - if APP_CONFIG.dig(:features, :public, :enabled) = list_group_item t('views.general.public'), public_timeline_path - .list-group-item.list-group-item-action.dropdown{class: "#{'active' if @group}"} - %a.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false }} - - if @group - = @group.display_name + .list-group-item.list-group-item-action.dropdown{ class: group ? 'active' : '' } + %a.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } } + - if group + = group.display_name - else Groups .dropdown-menu @@ -22,4 +22,4 @@ when selected, you'll get a timeline view of all users from that group. - current_user.groups.each do |group| - %a.dropdown-item{ href: group_timeline_path(group.name) }= group.display_name \ No newline at end of file + %a.dropdown-item{ href: group_timeline_path(group.name) }= group.display_name diff --git a/app/views/tabs/_moderation.haml b/app/views/tabs/_moderation.haml index 180922c7..9e2670ae 100644 --- a/app/views/tabs/_moderation.haml +++ b/app/views/tabs/_moderation.haml @@ -1,10 +1,10 @@ .card.d-none.d-sm-block .list-group = list_group_item t('views.moderation.tabs.all'), moderation_path - = list_group_item t('views.general.answer').pluralize(2), moderation_path('answer') - = list_group_item t('views.general.comment').pluralize(2), moderation_path('comment') - = list_group_item t('views.general.user').pluralize(2), moderation_path('user') - = list_group_item t('views.general.question').pluralize(2), moderation_path('question') - = list_group_item 'Priority', moderation_priority_path + = list_group_item t('views.general.answer').pluralize(2), moderation_path('answer') + = list_group_item t('views.general.comment').pluralize(2), moderation_path('comment') + = list_group_item t('views.general.user').pluralize(2), moderation_path('user') + = list_group_item t('views.general.question').pluralize(2), moderation_path('question') + = list_group_item 'Priority', moderation_priority_path -.d-none.d-sm-block= render "shared/links" \ No newline at end of file +.d-none.d-sm-block= render 'shared/links' diff --git a/app/views/tabs/_notifications.haml b/app/views/tabs/_notifications.haml index d282b911..74289536 100644 --- a/app/views/tabs/_notifications.haml +++ b/app/views/tabs/_notifications.haml @@ -1,16 +1,26 @@ .card.d-none.d-sm-block .list-group - = list_group_item "New Notifications", notifications_path, badge: Notification.for(current_user).where(new: true).count - = list_group_item "All Notifications", notifications_path('all') + = list_group_item 'New Notifications', notifications_path, badge: Notification.for(current_user).where(new: true).count + = list_group_item 'All Notifications', notifications_path('all') .card.d-none.d-sm-block .card-header Filter by Type .list-group - = list_group_item t('views.notifications.tabs.answer'), notifications_path('answer'), badge: Notification.for(current_user).where(target_type: "Answer", new: true).count - = list_group_item t('views.notifications.tabs.smile'), notifications_path('smile'), badge: Notification.for(current_user).where(target_type: "Smile", new: true).count - = list_group_item t('views.notifications.tabs.comment'), notifications_path('comment'), badge: Notification.for(current_user).where(target_type: "Comment", new: true).count - = list_group_item t('views.notifications.tabs.commentsmile'), notifications_path('commentsmile'), badge: Notification.for(current_user).where(target_type: "CommentSmile", new: true).count - = list_group_item t('views.notifications.tabs.relationship'), notifications_path('relationship'), badge: Notification.for(current_user).where(target_type: "Relationship", new: true).count + = list_group_item t('views.notifications.tabs.answer'), + notifications_path('answer'), + badge: Notification.for(current_user).where(target_type: 'Answer', new: true).count + = list_group_item t('views.notifications.tabs.smile'), + notifications_path('smile'), + badge: Notification.for(current_user).where(target_type: 'Smile', new: true).count + = list_group_item t('views.notifications.tabs.comment'), + notifications_path('comment'), + badge: Notification.for(current_user).where(target_type: 'Comment', new: true).count + = list_group_item t('views.notifications.tabs.commentsmile'), + notifications_path('commentsmile'), + badge: Notification.for(current_user).where(target_type: 'CommentSmile', new: true).count + = list_group_item t('views.notifications.tabs.relationship'), + notifications_path('relationship'), + badge: Notification.for(current_user).where(target_type: 'Relationship', new: true).count -.d-none.d-sm-block= render "shared/links" \ No newline at end of file +.d-none.d-sm-block= render 'shared/links' diff --git a/app/views/tabs/_profile.haml b/app/views/tabs/_profile.haml index f49f17dd..82e3d9f2 100644 --- a/app/views/tabs/_profile.haml +++ b/app/views/tabs/_profile.haml @@ -1,6 +1,6 @@ .card .list-group.list-group-horizontal-sm.text-center - = list_group_item "Answers", show_user_profile_path(@user.screen_name), badge: @user.answered_count - = list_group_item "Questions", show_user_questions_path(@user.screen_name), badge: @user.asked_count - = list_group_item "Followers", show_user_followers_path(@user.screen_name), badge: @user.follower_count - = list_group_item "Following", show_user_friends_path(@user.screen_name), badge: @user.friend_count \ No newline at end of file + = list_group_item 'Answers', show_user_profile_path(user.screen_name), badge: user.answered_count + = list_group_item 'Questions', show_user_questions_path(user.screen_name), badge: user.asked_count + = list_group_item 'Followers', show_user_followers_path(user.screen_name), badge: user.follower_count + = list_group_item 'Following', show_user_friends_path(user.screen_name), badge: user.friend_count diff --git a/app/views/tabs/_settings.haml b/app/views/tabs/_settings.haml index a3b91589..13d4a420 100644 --- a/app/views/tabs/_settings.haml +++ b/app/views/tabs/_settings.haml @@ -5,7 +5,7 @@ = list_group_item t('views.settings.tabs.privacy'), edit_user_privacy_path = list_group_item t('views.settings.tabs.sharing'), services_path = list_group_item 'Theme', edit_user_theme_path - = list_group_item "Your Data", user_data_path + = list_group_item 'Your Data', user_data_path = list_group_item 'Export', user_export_path -.d-none.d-sm-block= render "shared/links" \ No newline at end of file +.d-none.d-sm-block= render 'shared/links'