effective_email_templates 0.4.0 → 0.4.1

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: 22f145ef5bb62900fbd74958509c12281582c84f
4
- data.tar.gz: 6ee09134ecff68909d39c29ff6f6fb4dbdbd3124
3
+ metadata.gz: 703e12d4f4476c8924a1a145564ff9523f41dc2a
4
+ data.tar.gz: 4799a4847e8a6c35493e9c942b1895fce7a76ea9
5
5
  SHA512:
6
- metadata.gz: ac82b99c9b4c8b756ea97fd244683c3e42f3b0e42a47b8a2fcbd48ebd0d44b94d17dd8723dbb8a6e73be355308bb5d2f066265891e814498e69cbb5b3b9cc3ed
7
- data.tar.gz: a6a8f151c292a9be331efb8393553a1edd99058e68c410d3bcb039bdd1938e8e52034c23e658c76723a2dcf2d1503197b2b86f932422ecd57f29168c53956832
6
+ metadata.gz: 1f20d75db1c3bafb6e2860ad8810011d1536cb93a8f5ab38941cbd82b8905b3feb282f7db8fa3b7ca28e96758b739b25b4aefd958ab79c2daedf366a476ec465
7
+ data.tar.gz: aabd380d63e9a267ec4ad6263d93824050c47e4b8f93993ec4b711cf69c40c26915605196fbd0a27f2a14362a3e670e99ee9b4831559e2ae27cd75561b9450a4
@@ -1,11 +1,16 @@
1
1
  module Admin
2
2
  class EmailTemplatesController < ApplicationController
3
- before_filter :authenticate_user! # This is devise, ensure we're logged in.
3
+ before_action :authenticate_user! # This is devise, ensure we're logged in.
4
4
 
5
5
  layout (EffectiveEmailTemplates.layout.kind_of?(Hash) ? EffectiveEmailTemplates.layout[:admin_email_templates] : EffectiveEmailTemplates.layout)
6
6
 
7
7
  def index
8
- @datatable = Effective::Datatables::EmailTemplates.new()
8
+ if Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
9
+ @datatable = Effective::Datatables::EmailTemplates.new()
10
+ else
11
+ @datatable = EffectiveEmailTemplatesDatatable.new(self)
12
+ end
13
+
9
14
  @page_title = 'Email Templates'
10
15
 
11
16
  authorize_effective_email_templates!
@@ -0,0 +1,22 @@
1
+ unless Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
2
+ class EffectiveEmailTemplatesDatatable < Effective::Datatable
3
+ datatable do
4
+ order :subject, :asc
5
+
6
+ col :id, visible: false
7
+ col :slug
8
+ col :subject
9
+ col :from
10
+ col :cc, visible: false, label: 'CC'
11
+ col :bcc, visible: false, label: 'BCC'
12
+ col :body, visible: false
13
+
14
+ actions_col :actions, partial: '/admin/email_templates/actions', partial_as: 'email_template'
15
+ end
16
+
17
+ collection do
18
+ Effective::EmailTemplate.all
19
+ end
20
+ end
21
+ end
22
+
@@ -1,4 +1,4 @@
1
- if defined?(EffectiveDatatables)
1
+ if Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
2
2
  module Effective
3
3
  module Datatables
4
4
  class EmailTemplates < Effective::Datatable
@@ -1,3 +1,3 @@
1
1
  module EffectiveEmailTemplates
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_email_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2017-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -177,6 +177,7 @@ files:
177
177
  - app/assets/javascripts/effective_email_templates.js
178
178
  - app/assets/stylesheets/effective_email_templates.css.scss
179
179
  - app/controllers/admin/email_templates_controller.rb
180
+ - app/datatables/effective_email_templates_datatable.rb
180
181
  - app/helpers/effective_email_templates_helper.rb
181
182
  - app/mailers/effective/email_template_mailer.rb
182
183
  - app/models/effective/access_denied.rb