mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 07:34:41 +08:00
Fix translations for notif (Due date, Date/Date&Time, Low stock) [SCI-9775]
This commit is contained in:
parent
80c9ccde2f
commit
dde7c512a9
4 changed files with 13 additions and 6 deletions
|
@ -4,7 +4,8 @@ class LowStockNotification < BaseNotification
|
||||||
def message
|
def message
|
||||||
I18n.t(
|
I18n.t(
|
||||||
'notifications.content.item_low_stock_reminder.message_html',
|
'notifications.content.item_low_stock_reminder.message_html',
|
||||||
repository_row_name: subject.name
|
repository_row_name: subject.name,
|
||||||
|
repository: repository.name
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -19,4 +20,8 @@ class LowStockNotification < BaseNotification
|
||||||
def subject
|
def subject
|
||||||
RepositoryRow.find(params[:repository_row_id])
|
RepositoryRow.find(params[:repository_row_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def repository
|
||||||
|
Repository.find(subject.repository_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class TaskDueDateNotification < BaseNotification
|
class TaskDueDateNotification < BaseNotification
|
||||||
def message
|
def message
|
||||||
I18n.t(
|
I18n.t(
|
||||||
'notifications.notification.my_module_due_date_reminder_html',
|
'notifications.content.my_module_due_date_reminder.message_html',
|
||||||
my_module_name: subject.name
|
my_module_name: subject.name
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,7 +22,9 @@ if ENV['ENABLE_FLUICS_SYNC'] == 'true'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scheduler.every '1h' do
|
reminder_job_interval = ENV['REMINDER_JOB_INTERVAL'] || '1h'
|
||||||
|
|
||||||
|
scheduler.every reminder_job_interval do
|
||||||
MyModules::DueDateReminderJob.perform_now
|
MyModules::DueDateReminderJob.perform_now
|
||||||
RepositoryItemDateReminderJob.perform_now
|
RepositoryItemDateReminderJob.perform_now
|
||||||
end
|
end
|
||||||
|
|
|
@ -3444,13 +3444,13 @@ en:
|
||||||
content:
|
content:
|
||||||
my_module_due_date_reminder:
|
my_module_due_date_reminder:
|
||||||
title_html: "Task due date reminder"
|
title_html: "Task due date reminder"
|
||||||
message_html: "Due date for %{my_module_name} is coming up"
|
message_html: "Due date for a task %{my_module_name} is coming up."
|
||||||
item_low_stock_reminder:
|
item_low_stock_reminder:
|
||||||
title_html: "Item stock reminder"
|
title_html: "Item stock reminder"
|
||||||
message_html: "Item %{repository_row_name} is running low"
|
message_html: "Item %{repository_row_name} in inventory %{repository} is running low."
|
||||||
item_date_reminder:
|
item_date_reminder:
|
||||||
title_html: "Item date reminder"
|
title_html: "Item date reminder"
|
||||||
message_html: "Date reminder for %{repository_row_name} is coming up in %{value} %{units}"
|
message_html: "Date reminder for %{repository_row_name} is coming up in %{value} %{units}."
|
||||||
deliver:
|
deliver:
|
||||||
download_link: "Download link:"
|
download_link: "Download link:"
|
||||||
download_text: "Click the link to download the file."
|
download_text: "Click the link to download the file."
|
||||||
|
|
Loading…
Add table
Reference in a new issue