mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 01:35:34 +08:00
Fix notification messages [SCI-9843]
This commit is contained in:
parent
91533a25ac
commit
c0bc77024b
4 changed files with 8 additions and 25 deletions
|
@ -24,6 +24,14 @@ class BaseNotification < Noticed::Base
|
|||
|
||||
def subject; end
|
||||
|
||||
def message
|
||||
params[:message]
|
||||
end
|
||||
|
||||
def title
|
||||
params[:title]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def database_notification?
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LowStockNotification < BaseNotification
|
||||
def message
|
||||
I18n.t(
|
||||
'notifications.content.item_low_stock_reminder.message_html',
|
||||
repository_row_name: subject.name,
|
||||
repository: repository.name
|
||||
)
|
||||
end
|
||||
|
||||
def self.subtype
|
||||
:item_low_stock_reminder
|
||||
end
|
||||
|
|
|
@ -1,16 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RepositoryItemDateNotification < BaseNotification
|
||||
def message
|
||||
unit = human_readable_unit(params[:reminder_unit], params[:reminder_value])
|
||||
I18n.t(
|
||||
'notifications.content.item_date_reminder.message_html',
|
||||
repository_row_name: subject.name,
|
||||
value: params[:reminder_value],
|
||||
units: unit
|
||||
)
|
||||
end
|
||||
|
||||
def self.subtype
|
||||
:item_date_reminder
|
||||
end
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TaskDueDateNotification < BaseNotification
|
||||
def message
|
||||
I18n.t(
|
||||
'notifications.content.my_module_due_date_reminder.message_html',
|
||||
my_module_name: subject.name
|
||||
)
|
||||
end
|
||||
|
||||
def self.subtype
|
||||
:my_module_due_date_reminder
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue