rails_email_preview 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/helpers/rails_email_preview/emails_helper.rb +9 -0
- data/app/views/integrations/cms/_customize_cms_for_rails_email_preview.html.slim +7 -5
- data/app/views/rails_email_preview/emails/_headers.html.slim +13 -2
- data/lib/rails_email_preview.rb +8 -7
- data/lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb +6 -2
- data/lib/rails_email_preview/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa7d4eb9873fb41236d985af8f4d4944a6aa7056
|
4
|
+
data.tar.gz: a2b36c22f1f76369e2f400fecda49383fa1f0dfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67f0eb7c5cb4ad07bd3f991aa0cc8c000a67d56982c140cc46a70a5674e75aa125096d6ac1ee376a8d00d1923bfd20ca0aad4e1724b71a1efff8ccaf8fce2b3f
|
7
|
+
data.tar.gz: af01ce4227f49d190fb846a1152e5ecf611b69397b0fa1d40eedfb5c7727bbced5d741cec44e951ab872c5ed211a4a198bf9e6a994cfa3f9b4d0d06b49cb4ba7
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ You will need to provide data for preview of each email:
|
|
44
44
|
# Let REP know about UserMailerPreview:
|
45
45
|
# touch config/initializers/rails_email_preview.rb
|
46
46
|
RailsEmailPreview.setup do |config|
|
47
|
-
config.preview_classes =
|
47
|
+
config.preview_classes = %w( UserMailerPreview )
|
48
48
|
end
|
49
49
|
|
50
50
|
|
@@ -7,13 +7,15 @@ javascript:
|
|
7
7
|
$('.center-column').css('margin', 0);
|
8
8
|
|
9
9
|
// Snippet form:
|
10
|
+
var control = function(name) { return $('[name="snippet[' + name + ']"]').closest('.control-group'); };
|
11
|
+
|
12
|
+
control('label').find('.control-label').text("Subject");
|
13
|
+
control('content').find('.control-label').text("Body");
|
14
|
+
|
10
15
|
// Hide identifier and categories
|
11
|
-
|
16
|
+
control('identifier').hide();
|
12
17
|
$('label[for="snippet_"]').closest('.control-group').hide();
|
13
|
-
|
14
|
-
$('[name="snippet[label]"]').closest('.control-group').find('.control-label').text("Subject");
|
15
|
-
// Content to Body
|
16
|
-
$('[name="snippet[content]"]').closest('.control-group').find('.control-label').text("Body");
|
18
|
+
|
17
19
|
// Do not mess with identifier
|
18
20
|
$('[data-slug]').removeAttr('data-slug');
|
19
21
|
}
|
@@ -1,4 +1,15 @@
|
|
1
|
+
ruby:
|
2
|
+
headers = {
|
3
|
+
'From' => @mail.from,
|
4
|
+
'To' => @mail.to,
|
5
|
+
'CC' => @mail.cc,
|
6
|
+
'BCC' => @mail.bcc,
|
7
|
+
'Subject' => @mail.subject || '(no subject)'
|
8
|
+
}.delete_if { |k, v| v.blank? }
|
9
|
+
|
10
|
+
|
11
|
+
|
1
12
|
dl
|
2
|
-
-
|
13
|
+
- headers.each do |header, value|
|
3
14
|
dt #{header}
|
4
|
-
dd #{value}
|
15
|
+
dd #{format_header(value)}
|
data/lib/rails_email_preview.rb
CHANGED
@@ -25,12 +25,13 @@ module RailsEmailPreview
|
|
25
25
|
self.edit_link_text = '✎ Edit Text'
|
26
26
|
mattr_accessor :edit_link_style
|
27
27
|
self.edit_link_style = <<-CSS.strip.gsub(/\n+/m, ' ')
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
display: block;
|
29
|
+
font-family: Monaco, Helvetica, sans-serif;
|
30
|
+
color: #7a4b8a;
|
31
|
+
border: 2px dashed #7a4b8a;
|
32
|
+
font-size: 20px;
|
33
|
+
padding: 8px 12px;
|
34
|
+
margin-top: 0.6em;
|
35
|
+
margin-bottom: 0.6em;
|
35
36
|
CSS
|
36
37
|
end
|
@@ -67,13 +67,17 @@ module RailsEmailPreview
|
|
67
67
|
})
|
68
68
|
end
|
69
69
|
|
70
|
-
result
|
70
|
+
result = safe_join [result, "\n\n",
|
71
|
+
"<table><tr><td>".html_safe,
|
72
|
+
cms_edit_email_snippet_link(cms_path),
|
73
|
+
"</td></tr></table>".html_safe,
|
74
|
+
"\n"]
|
71
75
|
end
|
72
76
|
result
|
73
77
|
end
|
74
78
|
|
75
79
|
def cms_edit_email_snippet_link(path)
|
76
|
-
link_to(RailsEmailPreview.edit_link_text, path, style: RailsEmailPreview.edit_link_style, 'onClick' => '')
|
80
|
+
link_to(RailsEmailPreview.edit_link_text, path, style: RailsEmailPreview.edit_link_style.html_safe, 'onClick' => '')
|
77
81
|
end
|
78
82
|
end
|
79
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_email_preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Mazovetskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- app/assets/stylesheets/rails_email_preview/application.css.sass
|
78
78
|
- app/controllers/rails_email_preview/application_controller.rb
|
79
79
|
- app/controllers/rails_email_preview/emails_controller.rb
|
80
|
+
- app/helpers/rails_email_preview/emails_helper.rb
|
80
81
|
- app/views/integrations/cms/_customize_cms_for_rails_email_preview.html.slim
|
81
82
|
- app/views/layouts/rails_email_preview/application.html.slim
|
82
83
|
- app/views/rails_email_preview/emails/_email_iframe.html.slim
|