mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 13:08:55 +08:00
move styles to Styles
This commit is contained in:
parent
017820e445
commit
77167f12ad
@ -13,17 +13,17 @@
|
|||||||
</style>
|
</style>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
</head>
|
</head>
|
||||||
<body style="Margin: 0;padding:0;min-width:100%;background-color:#ffffff">
|
<body>
|
||||||
<center class="wrapper" style="width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;">
|
<center class="wrapper">
|
||||||
<div class="webkit" style="max-width:600px">
|
<div class="webkit">
|
||||||
<!--[if (gte mso 9)|(IE)]>
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
<table width="600" align="center" cellspacing="0" cellpadding="0" border="0">
|
<table width="600" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<table class="outer" align="center" cellspacing="0" cellpadding="0" border="0" style="Margin: 0 auto; width: 100%; max-width: 600px">
|
<table class="outer" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 10px;">
|
<td class="container">
|
||||||
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
|
|
||||||
|
@ -91,6 +91,10 @@ module Email
|
|||||||
style('.rtl', 'direction: rtl;')
|
style('.rtl', 'direction: rtl;')
|
||||||
style('td.body', 'padding-top:5px;', colspan: "2")
|
style('td.body', 'padding-top:5px;', colspan: "2")
|
||||||
style('.whisper td.body', 'font-style: italic; color: #9c9c9c;')
|
style('.whisper td.body', 'font-style: italic; color: #9c9c9c;')
|
||||||
|
style('.wrapper', 'width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;')
|
||||||
|
style('.webkit', 'max-width:600px;')
|
||||||
|
style('.outer', 'Margin: 0 auto; width: 100%; max-width: 600px;')
|
||||||
|
style('.container', 'padding: 10px;')
|
||||||
correct_first_body_margin
|
correct_first_body_margin
|
||||||
correct_footer_style
|
correct_footer_style
|
||||||
reset_tables
|
reset_tables
|
||||||
@ -138,6 +142,7 @@ module Email
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_html
|
def format_html
|
||||||
|
style('body', 'Margin: 0;padding:0;min-width:100%;background-color:#ffffff;')
|
||||||
style('h3', 'margin: 15px 0 20px 0;')
|
style('h3', 'margin: 15px 0 20px 0;')
|
||||||
style('hr', 'background-color: #ddd; height: 1px; border: 1px;')
|
style('hr', 'background-color: #ddd; height: 1px; border: 1px;')
|
||||||
style('a', 'text-decoration: none; font-weight: bold; color: #006699;')
|
style('a', 'text-decoration: none; font-weight: bold; color: #006699;')
|
||||||
|
@ -120,6 +120,17 @@ describe Email::Styles do
|
|||||||
doc = notification_doc("<div class='user-avatar'><img src='/some-image.png'></div>")
|
doc = notification_doc("<div class='user-avatar'><img src='/some-image.png'></div>")
|
||||||
expect(doc.at('img')['width']).to eq('45')
|
expect(doc.at('img')['width']).to eq('45')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "adds correct styles to the wrapper" do
|
||||||
|
doc = notification_doc('<center class="wrapper"></center>')
|
||||||
|
expect(doc.at('center')['style']).to eq('width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;')
|
||||||
|
end
|
||||||
|
|
||||||
|
it "doesn't override inline attributes" do
|
||||||
|
doc = notification_doc('<table width="600" align="center"><tr><td>test</td></tr></table>')
|
||||||
|
expect(doc.at('table')['align']).to eq('center')
|
||||||
|
expect(doc.at('table')['width']).to eq('600')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "rewriting protocol relative URLs to the forum" do
|
context "rewriting protocol relative URLs to the forum" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user