rails_email_preview 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 210079aee23a1a64d8d99202882da2d987f0871c
4
- data.tar.gz: dd6ef6cff8f2b403fb85988d47480dd19272caea
3
+ metadata.gz: 264f8217c8a8d10e2f72d6f32e6cfee539e1a572
4
+ data.tar.gz: bb09d40b77cfe02fe218606c284431e41062f500
5
5
  SHA512:
6
- metadata.gz: 8b7ee3fd00a5d0e9d8e5e278c6b99420bb8392ed3e1f2dccf81f462cc54715a7c022a00498b845fe76b7ceb366ce4f9409a5b40dcef5a15da6e0b2461d00d045
7
- data.tar.gz: a65c22c4684cf836bdc9c4f2dbaea3570373f6d26dfbe8d11cc2faec485849666d78edefc2f71acc4d420b3a6122885986b145282c27c164197b1ad70a2c4c49
6
+ metadata.gz: 48c8116fa52466924fd4300a871763464bd3ba4358eb43d7703a8028fc1fc4f4e5ede21709c87dced53de8c4d6c9d7c9c102bf4d1f524d4021019689133a1b1d
7
+ data.tar.gz: 5ef7135d0005aa9010b889c6b1cae3fcb34630ad75ca2f2b35f871e48c2d8bb9e1dbdd83cd25c14f289a308ade1288447755ad2a192272b53da2fb15a0969756
data/README.md CHANGED
@@ -83,7 +83,7 @@ Email editing
83
83
  -------------
84
84
 
85
85
  You can use [comfortable_mexican_sofa](https://github.com/comfy/comfortable-mexican-sofa) for storing and editing emails.
86
- [See ComfortableMexicanSofa integration guide](https://github.com/glebm/rails_email_preview/wiki/Comfortable-Mexican-Sofa-integration-for-email-editing).
86
+ See [ComfortableMexicanSofa integration guide](https://github.com/glebm/rails_email_preview/wiki/Edit-Emails-with-Comfortable-Mexican-Sofa).
87
87
 
88
88
  This is what it looks like:
89
89
 
@@ -1,14 +1,18 @@
1
1
  class RailsEmailPreview::EmailsController < RailsEmailPreview::ApplicationController
2
2
  include ERB::Util
3
+ around_filter :set_locale_for_mail, only: :show_raw
3
4
  before_filter :load_preview_class, except: :index
4
- before_filter :set_locale, except: :index
5
5
 
6
6
  def index
7
7
  @preview_class_names = (RailsEmailPreview.preview_classes || []).map { |klass| klass.is_a?(String) ? klass : klass.name }
8
8
  end
9
9
 
10
10
  def show
11
- @mail = @preview_class.new.send(params[:mail_action])
11
+ @email_locale = (params[:email_locale].presence || I18n.locale).to_s
12
+ I18n.with_locale(@email_locale) do
13
+ @part_type = params[:part_type] || 'text/html'
14
+ @mail = @preview_class.new.send(params[:mail_action])
15
+ end
12
16
  end
13
17
 
14
18
  def show_raw
@@ -33,8 +37,10 @@ class RailsEmailPreview::EmailsController < RailsEmailPreview::ApplicationContro
33
37
 
34
38
  private
35
39
 
36
- def set_locale
37
- I18n.locale = params[:email_locale] || params[:locale] || I18n.default_locale
40
+ def set_locale_for_mail
41
+ I18n.with_locale(params[:locale]) {
42
+ yield if block_given?
43
+ }
38
44
  end
39
45
 
40
46
  def load_preview_class
@@ -8,7 +8,7 @@ a.btn.btn-link href=rails_email_preview.root_url &laquo; Back to list
8
8
  br
9
9
  p.btn-group
10
10
  - I18n.available_locales.each do |locale|
11
- a.btn.btn-link href=rails_email_preview.email_url(params.merge(part_type: @part_type, email_locale: locale)) class=('active' if I18n.locale.to_s == locale.to_s) = locale
11
+ a.btn.btn-link href=rails_email_preview.email_url(params.merge(part_type: @part_type, email_locale: locale)) class=('active' if @email_locale == locale.to_s) = locale
12
12
  dl
13
13
  dt From:
14
14
  dd= @mail.from * ', '
@@ -40,5 +40,5 @@ javascript:
40
40
  }
41
41
 
42
42
  pre#loading-el.lead #{icon 'spinner', 'spin'} Loading...
43
- iframe#src-iframe[src=rails_email_preview.raw_email_url(params.slice(:mail_class, :mail_action, :part_type).merge(locale: I18n.locale.to_s))
43
+ iframe#src-iframe[src=rails_email_preview.raw_email_url(params.slice(:mail_class, :mail_action, :part_type).merge(locale: @email_locale))
44
44
  width="100%" height=1 onLoad="iFrameAutoResize('src-iframe')" style="border:none;padding:0;margin:0"]
@@ -1,3 +1,3 @@
1
1
  module RailsEmailPreview
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  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.0.7
4
+ version: 0.0.8
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-06 00:00:00.000000000 Z
11
+ date: 2013-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,7 +66,10 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Preview emails in browser (rails engine)
69
+ description: |-
70
+ Implemented as a rails engine with a simple UI for previewing your app emails,
71
+ I18n support, easy premailer integration and editing via comfortable_mexican_sofa
72
+ (https://github.com/comfy/comfortable-mexican-sofa).
70
73
  email: glex.spb@gmail.com
71
74
  executables: []
72
75
  extensions: []
@@ -86,8 +89,9 @@ files:
86
89
  - Rakefile
87
90
  - Gemfile
88
91
  - README.md
89
- homepage:
90
- licenses: []
92
+ homepage: https://github.com/glebm/rails_email_preview
93
+ licenses:
94
+ - MIT
91
95
  metadata: {}
92
96
  post_install_message:
93
97
  rdoc_options: []