Merge pull request #2888 from evazion/fix-dtext-email-links
Fix: Incorrect Relative Links for User Feedbacks #2887
This commit is contained in:
@@ -49,9 +49,9 @@ module ApplicationHelper
|
|||||||
raw %{<a href="#{h(url)}" #{attributes}>#{text}</a>}
|
raw %{<a href="#{h(url)}" #{attributes}>#{text}</a>}
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_text(text, options = {})
|
def format_text(text, ragel: true, **options)
|
||||||
if options[:ragel]
|
if ragel
|
||||||
raw(DTextRagel.parse(text))
|
raw DTextRagel.parse(text, **options)
|
||||||
else
|
else
|
||||||
DText.parse(text)
|
DText.parse(text)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<p><%= h @dmail.from.name %> said:</p>
|
<p><%= @dmail.from.name %> said:</p>
|
||||||
|
|
||||||
<div>
|
<div class="prose">
|
||||||
<%= DText.parse(@dmail.body) %>
|
<%= format_text(@dmail.body, base_url: root_url) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><%= link_to "View message", dmail_url(@dmail, :host => Danbooru.config.hostname, :only_path => false) %> | <%= link_to "Unsubscribe", maintenance_user_email_notification_url(:user_id => @dmail.owner.id, :sig => email_sig(@dmail.owner), :host => Danbooru.config.hostname, :only_path => false) %></p>
|
<p><%= link_to "View message", dmail_url(@dmail, :host => Danbooru.config.hostname, :only_path => false) %> | <%= link_to "Unsubscribe", maintenance_user_email_notification_url(:user_id => @dmail.owner.id, :sig => email_sig(@dmail.owner), :host => Danbooru.config.hostname, :only_path => false) %></p>
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ module Danbooru
|
|||||||
else
|
else
|
||||||
config.x.git_hash = nil
|
config.x.git_hash = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.after_initialize do
|
||||||
|
Rails.application.routes.default_url_options = {
|
||||||
|
host: Danbooru.config.hostname,
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
I18n.enforce_available_locales = false
|
I18n.enforce_available_locales = false
|
||||||
|
|||||||
6
test/mailers/previews/user_mailer_preview.rb
Normal file
6
test/mailers/previews/user_mailer_preview.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class UserMailerPreview < ActionMailer::Preview
|
||||||
|
def dmail_notice
|
||||||
|
dmail = User.admins.first.dmails.first
|
||||||
|
UserMailer.dmail_notice(dmail)
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user