rails_email_preview 0.2.18 → 0.2.19
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/assets/stylesheets/rails_email_preview/_bootstrap.css.scss +4659 -2806
- data/app/assets/stylesheets/rails_email_preview/_bootstrap_theme.css.scss +199 -238
- data/app/views/layouts/rails_email_preview/application.html.slim +1 -1
- data/lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb +13 -2
- data/lib/rails_email_preview/version.rb +1 -1
- metadata +35 -35
@@ -41,6 +41,15 @@ module RailsEmailPreview
|
|
41
41
|
RequestStore.store[:rep_edit_links]
|
42
42
|
end
|
43
43
|
|
44
|
+
def cms_snippet_render_method
|
45
|
+
[
|
46
|
+
# Newer CMS
|
47
|
+
:cms_snippet_render,
|
48
|
+
# Older CMS
|
49
|
+
:cms_snippet_content
|
50
|
+
].detect { |m| respond_to? m }
|
51
|
+
end
|
52
|
+
|
44
53
|
# Will return snippet content, passing through Kramdown
|
45
54
|
# Will also render an "✎ Edit text" link if used from
|
46
55
|
def cms_email_snippet(snippet_id = self.cms_email_id)
|
@@ -48,9 +57,10 @@ module RailsEmailPreview
|
|
48
57
|
site = Cms::Site.find_by_locale(I18n.locale.to_s)
|
49
58
|
if Cms::Snippet.where(identifier: snippet_id).exists?
|
50
59
|
# Fallback default locale: (# prefill)
|
51
|
-
|
60
|
+
content = send(cms_snippet_render_method, snippet_id, site)
|
61
|
+
unless content.present?
|
52
62
|
default_site = Cms::Site.find_by_locale(I18n.default_locale.to_s)
|
53
|
-
fallback_content =
|
63
|
+
fallback_content = send(cms_snippet_render_method, snippet_id, default_site).presence
|
54
64
|
end
|
55
65
|
result = (content || fallback_content).to_s
|
56
66
|
else
|
@@ -93,6 +103,7 @@ module RailsEmailPreview
|
|
93
103
|
id_prefix = 'email-'
|
94
104
|
return unless snippet && snippet.identifier && snippet.identifier.starts_with?(id_prefix)
|
95
105
|
mailer_cl, act = snippet.identifier[id_prefix.length..-1].split('-')
|
106
|
+
act.sub! /_email\Z/, ''
|
96
107
|
{ preview_id: "#{mailer_cl}_preview-#{act}",
|
97
108
|
email_locale: snippet.site.locale }
|
98
109
|
end
|
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_email_preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Mazovetskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: slim-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sass-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: turbolinks
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: request_store
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: i18n-tasks
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 0.3.7
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.3.7
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: capybara
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 0.4.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.4.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 2.12.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 2.12.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec-rails
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: poltergeist
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
description: A Rails Engine to preview plain text and html email in your browser.
|
@@ -157,6 +157,10 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
+
- Gemfile
|
161
|
+
- MIT-LICENSE
|
162
|
+
- README.md
|
163
|
+
- Rakefile
|
160
164
|
- app/assets/javascripts/rails_email_preview/application.js.coffee
|
161
165
|
- app/assets/stylesheets/rails_email_preview/_bootstrap.css.scss
|
162
166
|
- app/assets/stylesheets/rails_email_preview/_bootstrap_theme.css.scss
|
@@ -178,23 +182,19 @@ files:
|
|
178
182
|
- app/views/rails_email_preview/emails/index.html.slim
|
179
183
|
- app/views/rails_email_preview/emails/show.html.slim
|
180
184
|
- app/views/rails_email_preview/emails/show_body.html.slim
|
185
|
+
- config/i18n-tasks.yml
|
186
|
+
- config/initializers/rails_email_preview.rb
|
187
|
+
- config/locales/de.yml
|
188
|
+
- config/locales/en.yml
|
189
|
+
- config/routes.rb
|
181
190
|
- lib/generators/rails_email_preview/install_generator.rb
|
182
191
|
- lib/generators/rails_email_preview/update_previews_generator.rb
|
192
|
+
- lib/rails_email_preview.rb
|
183
193
|
- lib/rails_email_preview/delivery_handler.rb
|
184
194
|
- lib/rails_email_preview/engine.rb
|
185
195
|
- lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb
|
186
196
|
- lib/rails_email_preview/main_app_route_delegator.rb
|
187
197
|
- lib/rails_email_preview/version.rb
|
188
|
-
- lib/rails_email_preview.rb
|
189
|
-
- config/i18n-tasks.yml
|
190
|
-
- config/initializers/rails_email_preview.rb
|
191
|
-
- config/locales/de.yml
|
192
|
-
- config/locales/en.yml
|
193
|
-
- config/routes.rb
|
194
|
-
- MIT-LICENSE
|
195
|
-
- Rakefile
|
196
|
-
- Gemfile
|
197
|
-
- README.md
|
198
198
|
homepage: https://github.com/glebm/rails_email_preview
|
199
199
|
licenses:
|
200
200
|
- MIT
|
@@ -205,17 +205,17 @@ require_paths:
|
|
205
205
|
- lib
|
206
206
|
required_ruby_version: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
|
-
- -
|
208
|
+
- - ">="
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- -
|
213
|
+
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.
|
218
|
+
rubygems_version: 2.2.2
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: Preview emails in browser (rails engine)
|