Remove markerb dependency
markerb is dead and isn't compatible with rails 6 anymore. Removing it means adding separate templates for text and html, this sadly means some code duplication, but also luckily the templates aren't that complicated, so the duplication is also very minimal.
This commit is contained in:
parent
6cea355636
commit
a9ae84f3a6
66 changed files with 238 additions and 211 deletions
4
Gemfile
4
Gemfile
|
|
@ -130,10 +130,6 @@ gem "http_accept_language", "2.1.1"
|
||||||
gem "i18n-inflector-rails", "1.0.7"
|
gem "i18n-inflector-rails", "1.0.7"
|
||||||
gem "rails-i18n", "5.1.3"
|
gem "rails-i18n", "5.1.3"
|
||||||
|
|
||||||
# Mail
|
|
||||||
|
|
||||||
gem "markerb", "1.1.0"
|
|
||||||
|
|
||||||
# Map
|
# Map
|
||||||
gem "leaflet-rails", "1.7.0"
|
gem "leaflet-rails", "1.7.0"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,6 @@ GEM
|
||||||
mini_mime (>= 0.1.1)
|
mini_mime (>= 0.1.1)
|
||||||
marcel (1.0.2)
|
marcel (1.0.2)
|
||||||
markdown-it-html5-embed (1.0.0)
|
markdown-it-html5-embed (1.0.0)
|
||||||
markerb (1.1.0)
|
|
||||||
memoizable (0.4.2)
|
memoizable (0.4.2)
|
||||||
thread_safe (~> 0.3, >= 0.3.1)
|
thread_safe (~> 0.3, >= 0.3.1)
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
|
|
@ -825,7 +824,6 @@ DEPENDENCIES
|
||||||
listen (= 3.7.1)
|
listen (= 3.7.1)
|
||||||
logging-rails (= 0.6.0)
|
logging-rails (= 0.6.0)
|
||||||
markdown-it-html5-embed (= 1.0.0)
|
markdown-it-html5-embed (= 1.0.0)
|
||||||
markerb (= 1.1.0)
|
|
||||||
mini_magick (= 4.11.0)
|
mini_magick (= 4.11.0)
|
||||||
minitest (= 5.15.0)
|
minitest (= 5.15.0)
|
||||||
mobile-fu (= 1.4.0)
|
mobile-fu (= 1.4.0)
|
||||||
|
|
|
||||||
|
|
@ -2,38 +2,31 @@
|
||||||
|
|
||||||
class ExportMailer < ApplicationMailer
|
class ExportMailer < ApplicationMailer
|
||||||
def export_complete_for(user)
|
def export_complete_for(user)
|
||||||
@user = user
|
send_mail(user, I18n.t("notifier.export_email.subject", name: user.name),
|
||||||
|
I18n.t("notifier.export_email.body", url: download_profile_user_url, name: user.first_name))
|
||||||
mail(to: @user.email, subject: I18n.t('notifier.export_email.subject', name: @user.name)) do |format|
|
|
||||||
format.html { render 'users/export_email' }
|
|
||||||
format.text { render 'users/export_email' }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def export_failure_for(user)
|
def export_failure_for(user)
|
||||||
@user = user
|
send_mail(user, I18n.t("notifier.export_failure_email.subject", name: user.name),
|
||||||
|
I18n.t("notifier.export_failure_email.body", name: user.first_name))
|
||||||
mail(to: @user.email, subject: I18n.t('notifier.export_failure_email.subject', name: @user.name)) do |format|
|
|
||||||
format.html { render 'users/export_failure_email' }
|
|
||||||
format.text { render 'users/export_failure_email' }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def export_photos_complete_for(user)
|
def export_photos_complete_for(user)
|
||||||
@user = user
|
send_mail(user, I18n.t("notifier.export_photos_email.subject", name: user.name),
|
||||||
|
I18n.t("notifier.export_photos_email.body", url: download_photos_user_url, name: user.first_name))
|
||||||
mail(to: @user.email, subject: I18n.t('notifier.export_photos_email.subject', name: @user.name)) do |format|
|
|
||||||
format.html { render 'users/export_photos_email' }
|
|
||||||
format.text { render 'users/export_photos_email' }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def export_photos_failure_for(user)
|
def export_photos_failure_for(user)
|
||||||
@user = user
|
send_mail(user, I18n.t("notifier.export_photos_failure_email.subject", name: user.name),
|
||||||
|
I18n.t("notifier.export_photos_failure_email.body", name: user.first_name))
|
||||||
|
end
|
||||||
|
|
||||||
mail(to: @user.email, subject: I18n.t('notifier.export_photos_failure_email.subject', name: @user.name)) do |format|
|
private
|
||||||
format.html { render 'users/export_photos_failure_email' }
|
|
||||||
format.text { render 'users/export_photos_failure_email' }
|
def send_mail(user, subject, body)
|
||||||
|
mail(to: user.email, subject: subject) do |format|
|
||||||
|
format.html { render "notifier/plain_markdown_email", locals: {body: body} }
|
||||||
|
format.text { render "notifier/plain_markdown_email", locals: {body: body} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,15 @@
|
||||||
|
|
||||||
class Maintenance < ApplicationMailer
|
class Maintenance < ApplicationMailer
|
||||||
def account_removal_warning(user)
|
def account_removal_warning(user)
|
||||||
@user = user
|
I18n.with_locale(user.language) do
|
||||||
@login_url = new_user_session_url
|
body = I18n.t("notifier.remove_old_user.body",
|
||||||
@pod_url = AppConfig.environment.url
|
pod_url: AppConfig.environment.url,
|
||||||
@after_days = AppConfig.settings.maintenance.remove_old_users.after_days.to_s
|
login_url: new_user_session_url,
|
||||||
@remove_after = @user.remove_after
|
after_days: AppConfig.settings.maintenance.remove_old_users.after_days.to_s,
|
||||||
|
remove_after: user.remove_after)
|
||||||
I18n.with_locale(@user.language) do
|
mail(to: user.email, subject: I18n.t("notifier.remove_old_user.subject")) do |format|
|
||||||
mail(to: @user.email, subject: I18n.t("notifier.remove_old_user.subject")) do |format|
|
format.text { render "notifier/plain_markdown_email", locals: {body: body} }
|
||||||
format.text
|
format.html { render "notifier/plain_markdown_email", locals: {body: body} }
|
||||||
format.html
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -24,33 +24,28 @@ class Notifier < ApplicationMailer
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
unless subject
|
subject ||= I18n.t("notifier.single_admin.subject")
|
||||||
subject = I18n.t('notifier.single_admin.subject')
|
|
||||||
end
|
|
||||||
|
|
||||||
default_opts = {:to => @receiver.email,
|
default_opts = {to: @receiver.email, from: AppConfig.mail.sender_address, subject: subject}
|
||||||
:from => AppConfig.mail.sender_address,
|
|
||||||
:subject => subject, :host => AppConfig.pod_uri.host}
|
|
||||||
default_opts.merge!(opts)
|
default_opts.merge!(opts)
|
||||||
|
|
||||||
mail(default_opts) do |format|
|
mail(default_opts)
|
||||||
format.text
|
|
||||||
format.html
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def invite(email, inviter, invitation_code, locale)
|
def invite(email, inviter, invitation_code, locale)
|
||||||
@inviter = inviter
|
|
||||||
@invitation_code = invitation_code
|
|
||||||
|
|
||||||
I18n.with_locale(locale) do
|
I18n.with_locale(locale) do
|
||||||
mail_opts = {to: email, from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>",
|
mail_opts = {to: email, from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>",
|
||||||
subject: I18n.t("notifier.invited_you", name: @inviter.name),
|
subject: I18n.t("notifier.invited_you", name: inviter.name)}
|
||||||
host: AppConfig.pod_uri.host}
|
name = inviter.full_name.empty? ? inviter.diaspora_handle : "#{inviter.name} (#{inviter.diaspora_handle})"
|
||||||
|
body = I18n.t("notifier.invite.message",
|
||||||
|
invite_url: invite_code_url(invitation_code),
|
||||||
|
diasporafoundation_url: "https://diasporafoundation.org/",
|
||||||
|
user: name,
|
||||||
|
diaspora_id: inviter.diaspora_handle)
|
||||||
|
|
||||||
mail(mail_opts) do |format|
|
mail(mail_opts) do |format|
|
||||||
format.text { render :layout => nil }
|
format.text { render "notifier/plain_markdown_email", layout: nil, locals: {body: body} }
|
||||||
format.html { render :layout => nil }
|
format.html { render "notifier/plain_markdown_email", layout: nil, locals: {body: body} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,10 @@ class ReportMailer < ApplicationMailer
|
||||||
private
|
private
|
||||||
|
|
||||||
def format(resource)
|
def format(resource)
|
||||||
|
body = I18n.t("notifier.report_email.body", resource)
|
||||||
mail(to: resource[:email], subject: I18n.t("notifier.report_email.subject", type: resource[:type])) do |format|
|
mail(to: resource[:email], subject: I18n.t("notifier.report_email.subject", type: resource[:type])) do |format|
|
||||||
format.html { render "report/report_email", locals: {resource: resource} }
|
format.html { render "notifier/plain_markdown_email", locals: {body: body} }
|
||||||
format.text { render "report/report_email", locals: {resource: resource} }
|
format.text { render "notifier/plain_markdown_email", locals: {body: body} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
%p
|
||||||
|
= t("devise.mailer.welcome", username: @resource.username)
|
||||||
|
%p
|
||||||
|
= t(".you_can_confirm")
|
||||||
|
%p
|
||||||
|
= link_to t(".confirm"), confirmation_url(@resource, confirmation_token: @token)
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
<%= t('devise.mailer.welcome', username: @resource.username) %>
|
|
||||||
|
|
||||||
<%= t('.you_can_confirm') %>
|
|
||||||
|
|
||||||
[<%= t('.confirm') %>][1]
|
|
||||||
|
|
||||||
[1]: <%= confirmation_url(@resource, confirmation_token: @token) %>
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= t("devise.mailer.welcome", username: @resource.username) %>
|
||||||
|
|
||||||
|
<%= t(".you_can_confirm") %>
|
||||||
|
<%= confirmation_url(@resource, confirmation_token: @token) %>
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<%= t('.message', :invite_url => invite_code_url(@invitation_code)) %>
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
%p
|
||||||
|
= t("devise.mailer.hello", username: @resource.username)
|
||||||
|
%p
|
||||||
|
= t(".someone_requested")
|
||||||
|
%p
|
||||||
|
= link_to t(".change"), edit_password_url(@resource, reset_password_token: @token)
|
||||||
|
%p
|
||||||
|
= t(".then_connect", username: @resource.username)
|
||||||
|
%p
|
||||||
|
= t(".wont_change")
|
||||||
|
%p
|
||||||
|
= t(".ignore")
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
<%= t('devise.mailer.hello', username: @resource.username) %>
|
|
||||||
|
|
||||||
<%= t('.someone_requested') %>
|
|
||||||
|
|
||||||
[<%= t('.change') %>][1]
|
|
||||||
|
|
||||||
[1]: <%= edit_password_url(@resource, reset_password_token: @token) %>
|
|
||||||
|
|
||||||
<%= t('.then_connect', username: @resource.username) %>
|
|
||||||
|
|
||||||
<%= t('.wont_change') %>
|
|
||||||
|
|
||||||
<%= t('.ignore') %>
|
|
||||||
11
app/views/devise/mailer/reset_password_instructions.text.erb
Normal file
11
app/views/devise/mailer/reset_password_instructions.text.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<%= t("devise.mailer.hello", username: @resource.username) %>
|
||||||
|
|
||||||
|
<%= t(".someone_requested") %>
|
||||||
|
|
||||||
|
<%= t(".change") %>: <%= edit_password_url(@resource, reset_password_token: @token) %>
|
||||||
|
|
||||||
|
<%= t(".then_connect", username: @resource.username) %>
|
||||||
|
|
||||||
|
<%= t(".wont_change") %>
|
||||||
|
|
||||||
|
<%= t(".ignore") %>
|
||||||
8
app/views/devise/mailer/unlock_instructions.html.haml
Normal file
8
app/views/devise/mailer/unlock_instructions.html.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
%p
|
||||||
|
= t("devise.mailer.hello", username: @resource.username)
|
||||||
|
%p
|
||||||
|
= t(".account_locked")
|
||||||
|
%p
|
||||||
|
= t(".click_to_unlock")
|
||||||
|
%p
|
||||||
|
= link_to t(".unlock"), unlock_url(@resource, unlock_token: @token)
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<%= t('devise.mailer.hello', username: @resource.username) %>
|
|
||||||
|
|
||||||
<%= t('.account_locked') %>
|
|
||||||
|
|
||||||
<%= t('.click_to_unlock') %>
|
|
||||||
|
|
||||||
[<%= t('.unlock') %>][1]
|
|
||||||
|
|
||||||
[1]: <%= unlock_url(@resource, unlock_token: @token) %>
|
|
||||||
6
app/views/devise/mailer/unlock_instructions.text.erb
Normal file
6
app/views/devise/mailer/unlock_instructions.text.erb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<%= t("devise.mailer.hello", username: @resource.username) %>
|
||||||
|
|
||||||
|
<%= t(".account_locked") %>
|
||||||
|
|
||||||
|
<%= t(".click_to_unlock") %>
|
||||||
|
<%= unlock_url(@resource, unlock_token: @token) %>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
%table{cellspacing: 0, cellpadding: 0, border: 0,
|
%table{cellspacing: 0, cellpadding: 0, border: 0,
|
||||||
style: "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px"}
|
style: "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px"}
|
||||||
%tr
|
%tr
|
||||||
- if @notification.try(:sender)
|
- if @notification&.sender.present?
|
||||||
%td{width: "60px", style: "vertical-align: top"}>
|
%td{width: "60px", style: "vertical-align: top"}>
|
||||||
%div{style: "background-color: #eee; height: 50px; width: 50px"}
|
%div{style: "background-color: #eee; height: 50px; width: 50px"}
|
||||||
= image_tag @notification.sender.profile.image_url(:thumb_small), alt: @notification.sender.name,
|
= image_tag @notification.sender.profile.image_url(:thumb_small), alt: @notification.sender.name,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
!= yield
|
!= yield
|
||||||
|
|
||||||
|
!= "-- "
|
||||||
!= t("notifier.email_sent_by_diaspora", pod_name: pod_name)
|
!= t("notifier.email_sent_by_diaspora", pod_name: pod_name)
|
||||||
!= t("notifier.to_change_your_notification_settings")
|
!= "#{t('notifier.to_change_your_notification_settings')}: #{edit_user_url}"
|
||||||
!= edit_user_url
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<%= t('notifier.remove_old_user.body', pod_url: @pod_url, login_url: @login_url, after_days: @after_days, remove_after: @remove_after) %>
|
|
||||||
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
:css
|
|
||||||
body{
|
|
||||||
width:600px;
|
|
||||||
font-family: 'Helvetica',sans-serif;
|
|
||||||
}
|
|
||||||
#container{
|
|
||||||
}
|
|
||||||
header{
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
p{
|
|
||||||
padding:5px;
|
|
||||||
}
|
|
||||||
p.small{
|
|
||||||
font-size:smaller;
|
|
||||||
color:#999;
|
|
||||||
font-style:italic;
|
|
||||||
}
|
|
||||||
a{
|
|
||||||
color:#107FC9;
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
||||||
a:hover{
|
|
||||||
color: #22AAE0;
|
|
||||||
}
|
|
||||||
a:active{
|
|
||||||
color: #005D9C;
|
|
||||||
}
|
|
||||||
5
app/views/notifier/also_commented.html.haml
Normal file
5
app/views/notifier/also_commented.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
%p
|
||||||
|
= comment_message(@notification.comment, process_newlines: true)
|
||||||
|
%p
|
||||||
|
= link_to t("notifier.comment_on_post.reply", name: @notification.comment.post.author_first_name),
|
||||||
|
post_url(@notification.comment.post, anchor: @notification.comment.guid)
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<%= comment_message(@notification.comment, :process_newlines => true) %>
|
|
||||||
|
|
||||||
[<%= t('notifier.comment_on_post.reply', :name => @notification.comment_post.author_first_name) %>][1]
|
|
||||||
|
|
||||||
[1]: <%= post_url(@notification.comment_post, anchor: @notification.comment.guid) %>
|
|
||||||
4
app/views/notifier/also_commented.text.erb
Normal file
4
app/views/notifier/also_commented.text.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= comment_message(@notification.comment) %>
|
||||||
|
|
||||||
|
<%= t("notifier.comment_on_post.reply", name: @notification.comment.post.author_first_name) %>
|
||||||
|
<%= post_url(@notification.comment.post, anchor: @notification.comment.guid) %>
|
||||||
5
app/views/notifier/comment_on_post.html.haml
Normal file
5
app/views/notifier/comment_on_post.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
%p
|
||||||
|
= comment_message(@notification.comment, process_newlines: true)
|
||||||
|
%p
|
||||||
|
= link_to t("notifier.comment_on_post.reply", name: @notification.comment.post.author_first_name),
|
||||||
|
post_url(@notification.comment.post, anchor: @notification.comment.guid)
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<%= comment_message(@notification.comment, :process_newlines => true) %>
|
|
||||||
|
|
||||||
[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.parent_author_name) %>][1]
|
|
||||||
|
|
||||||
[1]: <%= post_url(@notification.comment.post, anchor: @notification.comment.guid) %>
|
|
||||||
4
app/views/notifier/comment_on_post.text.erb
Normal file
4
app/views/notifier/comment_on_post.text.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= comment_message(@notification.comment) %>
|
||||||
|
|
||||||
|
<%= t("notifier.comment_on_post.reply", name: @notification.comment.post.author_first_name) %>
|
||||||
|
<%= post_url(@notification.comment.post, anchor: @notification.comment.guid) %>
|
||||||
6
app/views/notifier/confirm_email.html.haml
Normal file
6
app/views/notifier/confirm_email.html.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
%p
|
||||||
|
= t("notifier.hello", name: @notification.recipient_first_name)
|
||||||
|
%p
|
||||||
|
= t("notifier.confirm_email.click_link", unconfirmed_email: @notification.recipient_unconfirmed_email)
|
||||||
|
%p
|
||||||
|
= link_to nil, confirm_email_url(token: @notification.recipient_confirm_email_token)
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<%= t('notifier.hello', :name => @notification.recipient_first_name) %>
|
|
||||||
|
|
||||||
<%= t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient_unconfirmed_email) %>
|
|
||||||
|
|
||||||
<<%= confirm_email_url(:token => @notification.recipient_confirm_email_token) %>>
|
|
||||||
5
app/views/notifier/confirm_email.text.erb
Normal file
5
app/views/notifier/confirm_email.text.erb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<%= t("notifier.hello", name: @notification.recipient_first_name) %>
|
||||||
|
|
||||||
|
<%= t("notifier.confirm_email.click_link", unconfirmed_email: @notification.recipient_unconfirmed_email) %>
|
||||||
|
|
||||||
|
<%= confirm_email_url(token: @notification.recipient_confirm_email_token) %>
|
||||||
5
app/views/notifier/contacts_birthday.html.haml
Normal file
5
app/views/notifier/contacts_birthday.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
%p
|
||||||
|
= t(".birthday", name: @notification.person.name)
|
||||||
|
%p
|
||||||
|
= link_to t(".view_profile", name: @notification.person.first_name),
|
||||||
|
local_or_remote_person_path(@notification.person, absolute: true)
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
|
|
||||||
<%= t(".birthday", name: @notification.person.name) %>
|
|
||||||
|
|
||||||
[<%= t(".view_profile", name: @notification.person.name) %>][1]
|
|
||||||
|
|
||||||
[1]: <%= local_or_remote_person_path(@notification.person, absolute: true) %>
|
|
||||||
4
app/views/notifier/contacts_birthday.text.erb
Normal file
4
app/views/notifier/contacts_birthday.text.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= t(".birthday", name: @notification.person.name) %>
|
||||||
|
|
||||||
|
<%= t(".view_profile", name: @notification.person.first_name) %>
|
||||||
|
<%= local_or_remote_person_path(@notification.person, absolute: true) %>
|
||||||
4
app/views/notifier/csrf_token_fail.html.haml
Normal file
4
app/views/notifier/csrf_token_fail.html.haml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
- message = t("notifier.csrf_token_fail.body",
|
||||||
|
name: @notification.recipient_first_name,
|
||||||
|
link: "https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)")
|
||||||
|
!= Redcarpet::Markdown.new(Diaspora::Markdownify::Email).render(message)
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<%= t("notifier.csrf_token_fail.body", name: @notification.recipient_first_name, link: "https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)") %>
|
|
||||||
3
app/views/notifier/csrf_token_fail.text.erb
Normal file
3
app/views/notifier/csrf_token_fail.text.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<%= t("notifier.csrf_token_fail.body",
|
||||||
|
name: @notification.recipient_first_name,
|
||||||
|
link: "https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)") %>
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<%= t('.message',
|
|
||||||
invite_url: invite_code_url(@invitation_code),
|
|
||||||
diasporafoundation_url: 'https://diasporafoundation.org/',
|
|
||||||
user: @inviter.try(:full_name).empty? ? @inviter.try(:diaspora_handle) : "#{@inviter.name} (#{@inviter.diaspora_handle})",
|
|
||||||
diaspora_id: @inviter.try(:diaspora_handle))
|
|
||||||
%>
|
|
||||||
11
app/views/notifier/liked.html.haml
Normal file
11
app/views/notifier/liked.html.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
- if @notification.like_target.public?
|
||||||
|
%p
|
||||||
|
#{t('.liked', name: @notification.sender_name)}:
|
||||||
|
%p
|
||||||
|
= post_message(@notification.like_target, process_newlines: true)
|
||||||
|
- else
|
||||||
|
%p
|
||||||
|
#{t('notifier.liked.limited_post', name: @notification.sender_name)}.
|
||||||
|
|
||||||
|
%p
|
||||||
|
= link_to t(".view_post"), post_url(@notification.like_target)
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<% if @notification.like_target.public? %>
|
|
||||||
<%= "#{t('.liked', :name => "#{@notification.sender_name}")}:" %>
|
|
||||||
|
|
||||||
<%= post_message(@notification.like_target, :process_newlines => true) %>
|
|
||||||
<% else %>
|
|
||||||
<%= "#{t('notifier.liked.limited_post', :name => "#{@notification.sender_name}")}." %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
[<%= t('.view_post') %>][1]
|
|
||||||
|
|
||||||
[1]: <%= post_url(@notification.like_target) %>
|
|
||||||
10
app/views/notifier/liked.text.erb
Normal file
10
app/views/notifier/liked.text.erb
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<% if @notification.like_target.public? %>
|
||||||
|
<%= "#{t(".liked", name: @notification.sender_name)}:" %>
|
||||||
|
|
||||||
|
<%= post_message(@notification.like_target) %>
|
||||||
|
<% else %>
|
||||||
|
<%= "#{t("notifier.liked.limited_post", name: @notification.sender_name)}." %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= t(".view_post") %>
|
||||||
|
<%= post_url(@notification.like_target) %>
|
||||||
10
app/views/notifier/mentioned.html.haml
Normal file
10
app/views/notifier/mentioned.html.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
- if @notification.post.public?
|
||||||
|
%p
|
||||||
|
= post_message(@notification.post, process_newlines: true)
|
||||||
|
- else
|
||||||
|
%p
|
||||||
|
= t("notifier.mentioned.limited_post")
|
||||||
|
|
||||||
|
%p
|
||||||
|
= link_to t("notifier.comment_on_post.reply", name: @notification.post.author_first_name),
|
||||||
|
post_url(@notification.post)
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<% if @notification.post.public? %>
|
|
||||||
<%= post_message(@notification.post, :process_newlines => true) %>
|
|
||||||
<% else %>
|
|
||||||
<%= t('notifier.mentioned.limited_post') %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
[<%= t("notifier.comment_on_post.reply", name: @notification.post_author_name) %>][1]
|
|
||||||
|
|
||||||
[1]: <%= post_url(@notification.post) %>
|
|
||||||
8
app/views/notifier/mentioned.text.erb
Normal file
8
app/views/notifier/mentioned.text.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<% if @notification.post.public? %>
|
||||||
|
<%= post_message(@notification.post) %>
|
||||||
|
<% else %>
|
||||||
|
<%= t("notifier.mentioned.limited_post") %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= t("notifier.comment_on_post.reply", name: @notification.post.author_first_name) %>
|
||||||
|
<%= post_url(@notification.post) %>
|
||||||
10
app/views/notifier/mentioned_in_comment.html.haml
Normal file
10
app/views/notifier/mentioned_in_comment.html.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
- if @notification.comment.public?
|
||||||
|
%p
|
||||||
|
= @notification.comment.message.plain_text_without_markdown
|
||||||
|
- else
|
||||||
|
%p
|
||||||
|
= t("notifier.mentioned_in_comment.limited_post")
|
||||||
|
|
||||||
|
%p
|
||||||
|
= link_to t("notifier.mentioned_in_comment.reply"),
|
||||||
|
post_url(@notification.comment.post, anchor: @notification.comment.guid)
|
||||||
|
|
@ -4,6 +4,5 @@
|
||||||
<%= t("notifier.mentioned_in_comment.limited_post") %>
|
<%= t("notifier.mentioned_in_comment.limited_post") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
[<%= t("notifier.mentioned_in_comment.reply") %>][1]
|
<%= t("notifier.mentioned_in_comment.reply") %>
|
||||||
|
<%= post_url(@notification.comment.parent, anchor: @notification.comment.guid) %>
|
||||||
[1]: <%= post_url(@notification.comment.parent, anchor: @notification.comment.guid) %>
|
|
||||||
2
app/views/notifier/plain_markdown_email.html.haml
Normal file
2
app/views/notifier/plain_markdown_email.html.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
%div{style: "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px"}
|
||||||
|
!= Redcarpet::Markdown.new(Diaspora::Markdownify::Email).render(body)
|
||||||
1
app/views/notifier/plain_markdown_email.text.haml
Normal file
1
app/views/notifier/plain_markdown_email.text.haml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!= body
|
||||||
4
app/views/notifier/private_message.html.haml
Normal file
4
app/views/notifier/private_message.html.haml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
%p
|
||||||
|
= t("notifier.a_private_message")
|
||||||
|
%p
|
||||||
|
= link_to t(".reply_to_or_view"), conversations_url(conversation_id: @notification.conversation)
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<%= t('notifier.a_private_message') %>
|
|
||||||
|
|
||||||
[<%= t('.reply_to_or_view') %>][1]
|
|
||||||
|
|
||||||
[1]: <%= conversations_url(:conversation_id => @notification.conversation) %>
|
|
||||||
4
app/views/notifier/private_message.text.erb
Normal file
4
app/views/notifier/private_message.text.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= t("notifier.a_private_message") %>
|
||||||
|
|
||||||
|
<%= t(".reply_to_or_view") %>
|
||||||
|
<%= conversations_url(conversation_id: @notification.conversation) %>
|
||||||
6
app/views/notifier/reshared.html.haml
Normal file
6
app/views/notifier/reshared.html.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
%p
|
||||||
|
#{t('.reshared', name: @notification.sender_name)}:
|
||||||
|
%p
|
||||||
|
= post_message(@notification.reshare_root, process_newlines: true)
|
||||||
|
%p
|
||||||
|
= link_to t(".view_post"), post_url(@notification.reshare)
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
<%= "#{t('.reshared', :name => "#{@notification.sender_name}")}:" %>
|
|
||||||
|
|
||||||
<%= post_message(@notification.reshare_root, :process_newlines => true) %>
|
|
||||||
|
|
||||||
[<%= t('.view_post') %>][1]
|
|
||||||
|
|
||||||
[1]: <%= post_url(@notification.reshare) %>
|
|
||||||
6
app/views/notifier/reshared.text.erb
Normal file
6
app/views/notifier/reshared.text.erb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<%= "#{t(".reshared", name: @notification.sender_name)}:" %>
|
||||||
|
|
||||||
|
<%= post_message(@notification.reshare_root) %>
|
||||||
|
|
||||||
|
<%= t(".view_post") %>
|
||||||
|
<%= post_url(@notification.reshare) %>
|
||||||
8
app/views/notifier/single_admin.html.haml
Normal file
8
app/views/notifier/single_admin.html.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
%p
|
||||||
|
= t("notifier.hello", name: @receiver.username)
|
||||||
|
%p
|
||||||
|
= @string
|
||||||
|
%p
|
||||||
|
= t("notifier.thanks")
|
||||||
|
%br/
|
||||||
|
= t("notifier.single_admin.admin")
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
<%= t('notifier.hello', :name => @receiver.username) %>
|
|
||||||
|
|
||||||
<%= @string %>
|
|
||||||
|
|
||||||
<%= t('notifier.thanks') %>
|
|
||||||
|
|
||||||
<%= t('notifier.single_admin.admin') %>
|
|
||||||
6
app/views/notifier/single_admin.text.erb
Normal file
6
app/views/notifier/single_admin.text.erb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<%= t("notifier.hello", name: @receiver.username) %>
|
||||||
|
|
||||||
|
<%= @string %>
|
||||||
|
|
||||||
|
<%= t("notifier.thanks") %>
|
||||||
|
<%= t("notifier.single_admin.admin") %>
|
||||||
7
app/views/notifier/started_sharing.html.haml
Normal file
7
app/views/notifier/started_sharing.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
%p
|
||||||
|
= @notification.sender_name
|
||||||
|
= t(".sharing")
|
||||||
|
|
||||||
|
%p
|
||||||
|
= link_to t(".view_profile", name: @notification.sender_first_name),
|
||||||
|
local_or_remote_person_path(@notification.sender, absolute: true)
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<%= @notification.sender_name %> <%= t('.sharing') %>
|
|
||||||
|
|
||||||
[<%= t('.view_profile', :name => @notification.sender_first_name) %>][1]
|
|
||||||
|
|
||||||
[1]: <%= local_or_remote_person_path(@notification.sender, :absolute => true) %>
|
|
||||||
4
app/views/notifier/started_sharing.text.erb
Normal file
4
app/views/notifier/started_sharing.text.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= @notification.sender_name %> <%= t(".sharing") %>
|
||||||
|
|
||||||
|
<%= t(".view_profile", name: @notification.sender_first_name) %>
|
||||||
|
<%= local_or_remote_person_path(@notification.sender, absolute: true) %>
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<%= t("notifier.report_email.body",
|
|
||||||
url: resource[:url],
|
|
||||||
type: resource[:type],
|
|
||||||
id: resource[:id],
|
|
||||||
reason: resource[:reason]) %>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<%= t('notifier.export_email.body', url: download_profile_user_url, name: @user.first_name) %>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<%= t('notifier.export_failure_email.body', name: @user.first_name) %>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<%= t('notifier.export_photos_email.body', url: download_photos_user_url, name: @user.first_name) %>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<%= t('notifier.export_photos_failure_email.body', name: @user.first_name) %>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
Rails.application.config.markerb.renderer = Diaspora::Markdownify::Email
|
|
||||||
|
|
@ -724,7 +724,7 @@ en:
|
||||||
started_sharing:
|
started_sharing:
|
||||||
subject: "%{name} started sharing with you on diaspora*"
|
subject: "%{name} started sharing with you on diaspora*"
|
||||||
sharing: "has started sharing with you!"
|
sharing: "has started sharing with you!"
|
||||||
view_profile: "View %{name}’s profile"
|
view_profile: "View %{name}’s profile >"
|
||||||
comment_on_post:
|
comment_on_post:
|
||||||
limited_subject: "There's a new comment on one of your posts"
|
limited_subject: "There's a new comment on one of your posts"
|
||||||
reply: "Reply or view %{name}’s post >"
|
reply: "Reply or view %{name}’s post >"
|
||||||
|
|
@ -749,7 +749,7 @@ en:
|
||||||
contacts_birthday:
|
contacts_birthday:
|
||||||
subject: "%{name} has their birthday today"
|
subject: "%{name} has their birthday today"
|
||||||
birthday: "%{name} has their birthday today. Wish them 'Happy Birthday'!"
|
birthday: "%{name} has their birthday today. Wish them 'Happy Birthday'!"
|
||||||
view_profile: "View %{name}’s profile"
|
view_profile: "View %{name}’s profile >"
|
||||||
confirm_email:
|
confirm_email:
|
||||||
subject: "Please activate your new email address %{unconfirmed_email}"
|
subject: "Please activate your new email address %{unconfirmed_email}"
|
||||||
click_link: "To activate your new email address %{unconfirmed_email}, please follow this link:"
|
click_link: "To activate your new email address %{unconfirmed_email}, please follow this link:"
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ describe Workers::ResetPassword do
|
||||||
Workers::ResetPassword.new.perform(alice.id)
|
Workers::ResetPassword.new.perform(alice.id)
|
||||||
mail = Devise.mailer.deliveries.last
|
mail = Devise.mailer.deliveries.last
|
||||||
expect(mail.to).to eq([alice.email])
|
expect(mail.to).to eq([alice.email])
|
||||||
expect(mail.body).to include("change your password")
|
expect(mail.body.encoded).to include("change your password")
|
||||||
expect(mail.body).to include(alice.username)
|
expect(mail.body.encoded).to include(alice.username)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue