Fix trivial lint issues

This commit is contained in:
Karina Kwiatek 2023-03-04 18:40:29 +01:00
parent d5c27dcfb4
commit 3c052e9e0e
3 changed files with 12 additions and 9 deletions

View File

@ -27,6 +27,8 @@ class Inbox < ApplicationRecord
self.destroy
end
def notification_icon = question.author_is_anonymous ? "/icons/maskable_icon_x128.png" : question.user.profile_picture.url(:small)
def as_push_notification
{
title: I18n.t(
@ -37,11 +39,11 @@ class Inbox < ApplicationRecord
question.user.profile.safe_name
end
),
icon: question.author_is_anonymous ? "/icons/maskable_icon_x128.png" : question.user.profile_picture.url(:small),
icon: notification_icon,
body: question.content.truncate(Question::SHORT_QUESTION_MAX_LENGTH),
data: {
click_url: "/inbox",
}
},
}
end
end

View File

@ -10,7 +10,7 @@
DEV
%ul.nav.navbar-nav.me-auto
= nav_entry t("navigation.timeline"), root_path, icon: 'home'
= nav_entry t("navigation.inbox"), '/inbox', icon: 'inbox', badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } }
= nav_entry t("navigation.inbox"), "/inbox", icon: "inbox", badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } }
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
= nav_entry t("navigation.discover"), discover_path, icon: 'compass'
%ul.nav.navbar-nav

View File

@ -1,9 +1,10 @@
- notifications = Notification.for(current_user).where(new: true).includes([:target]).limit(4)
- inbox_count = current_user.unread_inbox_count
- notification_count = current_user.unread_notification_count
= render 'navigation/desktop', notifications:, inbox_count:, notification_count:
= render 'navigation/mobile', inbox_count:, notification_count:
:ruby
notifications = Notification.for(current_user).where(new: true).includes([:target]).limit(4)
inbox_count = current_user.unread_inbox_count
notification_count = current_user.unread_notification_count
= render "navigation/desktop", notifications:, inbox_count:, notification_count:
= render "navigation/mobile", inbox_count:, notification_count:
= render 'modal/ask'
= render "modal/ask"
%button.btn.btn-primary.btn-fab.d-block.d-lg-none.d-print-none{ data: { bs_target: "#modal-ask-followers", bs_toggle: :modal }, type: "button" }
%i.fa.fa-pencil-square-o