rails_email_preview 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/integrations/cms/_customize_cms_for_rails_email_preview.html.slim +9 -5
- data/app/views/rails_email_preview/emails/show.html.slim +13 -12
- data/config/locales/de.yml +3 -2
- data/config/locales/en.yml +3 -2
- data/lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb +10 -8
- data/lib/rails_email_preview/version.rb +1 -1
- data/lib/rails_email_preview.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 470b4acb87f3f09970b99c473dc2513e4e7b4cd7
|
4
|
+
data.tar.gz: 1a408bcd46fb2917eb812098a1d5da1d0c2e0498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 535c2d3ea7abdab5ce70e4031354958ebf1eab6788676215cce6642b875e5871cb6bef12343674a010db05e48b43a0038a93ae8bbb27321de97377626a5bd419
|
7
|
+
data.tar.gz: 2b8825c44c05aaa3dbf24fc82e2d7d42cbcf5cd7ba3c52f654a4afbf0165e9d7877652342483d77d9574528fc04dc25234499e9566935a5d276a2089f4e457fd
|
@@ -4,18 +4,22 @@ ruby:
|
|
4
4
|
if snippet && (p = ::RailsEmailPreview::Integrations::ComfortableMexicanSofa.rep_email_params_from_snippet(snippet))
|
5
5
|
show_url = rails_email_preview.rep_raw_email_url(p.merge part_type: 'text/html')
|
6
6
|
end
|
7
|
+
customize_form = show_url.present? || snippet && !snippet.persisted?
|
7
8
|
|
8
|
-
- if
|
9
|
+
- if customize_form
|
9
10
|
javascript:
|
10
11
|
jQuery(function($) {
|
11
12
|
if (window.parent && (new RegExp('#{rails_email_preview.rep_root_path}')).test(parent.location.href)) {
|
12
13
|
// Hide nav:
|
13
14
|
$('.left-column,.right-column').hide();
|
14
15
|
$('.center-column').css('margin', 0);
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
)
|
16
|
+
|
17
|
+
var showUrl = '#{show_url}';
|
18
|
+
|
19
|
+
if (showUrl) {
|
20
|
+
$('.page-header h2').html(
|
21
|
+
"#{t '.edit_email'}" + " <a class='btn btn-primary' href='" + showUrl + "'>#{t '.view_link'}</a>");
|
22
|
+
}
|
19
23
|
|
20
24
|
// Snippet form:
|
21
25
|
var control = function(name) { return $('[name^="snippet[' + name + ']"]').closest('.control-group'); };
|
@@ -6,18 +6,19 @@
|
|
6
6
|
li.active: a href=(request.url) = current_email_name
|
7
7
|
|
8
8
|
div class=rep_style[:panel_class]
|
9
|
-
div class=rep_style[:
|
10
|
-
|
11
|
-
|
12
|
-
=
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
9
|
+
div class=rep_style[:panel_body_class]
|
10
|
+
div class=rep_style[:row_class]
|
11
|
+
-# From, To, Subject and other headers
|
12
|
+
div class=rep_col_class(8)
|
13
|
+
= render 'rails_email_preview/emails/headers'
|
14
|
+
-# Locale, format and actions
|
15
|
+
div class=rep_col_class(4)
|
16
|
+
ul.list-unstyled.text-right.rep-email-options
|
17
|
+
- if I18n.available_locales.length > 1
|
18
|
+
li= render 'rails_email_preview/emails/i18n_nav'
|
19
|
+
- if RailsEmailPreview.enable_send_email
|
20
|
+
li= render 'rails_email_preview/emails/send_form'
|
21
|
+
li= render 'rails_email_preview/emails/format_nav'
|
21
22
|
|
22
23
|
-# actual email content, rendered in an iframe to prevent browser styles from interfering
|
23
24
|
.margin-right
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -61,20 +61,22 @@ module RailsEmailPreview
|
|
61
61
|
if cms_email_edit_link?
|
62
62
|
snippet = site.snippets.find_by_identifier(snippet_id)
|
63
63
|
|
64
|
+
route_name = respond_to?(:new_cms_admin_site_snippet_path) ? :cms_admin_site_snippet : :admin_cms_site_snippet
|
65
|
+
|
64
66
|
|
65
67
|
cms_path = if snippet
|
66
68
|
unless content
|
67
69
|
fallback_snippet = default_site.snippets.find_by_identifier(snippet_id)
|
68
70
|
prefill_from_default = {label: fallback_snippet.label, content: fallback_snippet.content}
|
69
71
|
end
|
70
|
-
|
71
|
-
snippet: prefill_from_default || nil)
|
72
|
+
send :"edit_#{route_name}_path", site_id: site.id, id: snippet.id, snippet: prefill_from_default || nil
|
72
73
|
else
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
send :"new_#{route_name}_path", site_id: site.id,
|
75
|
+
snippet: {
|
76
|
+
label: "#{snippet_id.sub('-', ' / ').humanize}",
|
77
|
+
identifier: snippet_id,
|
78
|
+
category_ids: [site.categories.find_by_label('email').try(:id)]
|
79
|
+
}
|
78
80
|
end
|
79
81
|
|
80
82
|
result = safe_join ["<table class='rep-edit-link'><tr><td>".html_safe, cms_edit_email_snippet_link(cms_path),
|
@@ -106,4 +108,4 @@ ActionMailer::Base.module_eval do
|
|
106
108
|
end
|
107
109
|
|
108
110
|
require 'comfortable_mexican_sofa'
|
109
|
-
ComfortableMexicanSofa::ViewHooks.add :
|
111
|
+
ComfortableMexicanSofa::ViewHooks.add :navigation, 'integrations/cms/customize_cms_for_rails_email_preview'
|
data/lib/rails_email_preview.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.14
|
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-11-
|
11
|
+
date: 2013-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|