effective_classifieds 0.2.3 → 0.3.0
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 +4 -4
- data/app/mailers/effective/classifieds_mailer.rb +5 -10
- data/app/views/effective/classifieds/_fields.html.haml +4 -2
- data/app/views/effective/classifieds_mailer/classified_submitted.html.haml +1 -1
- data/config/effective_classifieds.rb +1 -1
- data/lib/effective_classifieds/version.rb +1 -1
- data/lib/effective_classifieds.rb +2 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb0cfd942db297b12029c3482f9640b4016070b23293a8920f09cf7308b9f511
|
4
|
+
data.tar.gz: 5677c6e19346e790344bf5dfaca5d411a06ec089e660a6fb0c13f19481b3393e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af2f02865c7961f045b3f259e6ba238b5b8f1485a72645771f278806a929887256971e8ca71e5d220e1e5f41cd04abd0354325ac72b380956d6e9b4e755b10d
|
7
|
+
data.tar.gz: 0c80ae59bf92b7777cc0924a08c950a8687aee561ebe4901d4fe7023d8023f10ad03897eb68e29edcafac462fbc405911e9eccd8055a86b4c0b08e31bbe54017
|
@@ -1,21 +1,16 @@
|
|
1
1
|
module Effective
|
2
2
|
class ClassifiedsMailer < EffectiveClassifieds.parent_mailer_class
|
3
3
|
|
4
|
-
|
5
|
-
layout -> { EffectiveClassifieds.mailer_layout }
|
4
|
+
include EffectiveMailer
|
6
5
|
|
7
6
|
def classified_submitted(resource, opts = {})
|
8
|
-
raise('expected an Effective::
|
7
|
+
raise('expected an Effective::Classified') unless resource.kind_of?(Effective::Classified)
|
9
8
|
|
10
9
|
@classified = resource
|
10
|
+
subject = subject_for(__method__, 'Classified Submitted', resource, opts)
|
11
|
+
headers = headers_for(resource, opts)
|
11
12
|
|
12
|
-
mail(to:
|
13
|
-
end
|
14
|
-
|
15
|
-
protected
|
16
|
-
|
17
|
-
def headers_for(resource, opts = {})
|
18
|
-
resource.respond_to?(:log_changes_datatable) ? opts.merge(log: resource) : opts
|
13
|
+
mail(to: mailer_admin, subject: subject, **headers)
|
19
14
|
end
|
20
15
|
|
21
16
|
end
|
@@ -21,8 +21,10 @@
|
|
21
21
|
- if f.object.persisted? && !f.object.draft?
|
22
22
|
= f.check_box :archived, label: 'Yes, this classified is archived and will not be displayed'
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
- if defined?(EffectiveArticleEditor)
|
25
|
+
= f.article_editor :body, label: 'Body content', hint: 'The main body content of your classified ad. Be sure to include all relevant information!'
|
26
|
+
- else
|
27
|
+
= f.rich_text_area :body, label: 'Body content', hint: 'The main body content of your classified ad. Be sure to include all relevant information!'
|
26
28
|
|
27
29
|
%h2.mt-5.mb-0 Contact Information
|
28
30
|
%p
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
%hr
|
14
14
|
|
15
|
-
-
|
15
|
+
- unless @classified.approved?
|
16
16
|
%p= link_to('Approve Classified Ad', effective_classifieds.edit_admin_classified_path(@classified))
|
17
17
|
|
18
18
|
%p= link_to('View Classified Ad', effective_classifieds.classified_path(@classified))
|
@@ -37,5 +37,5 @@ EffectiveClassifieds.setup do |config|
|
|
37
37
|
# config.mailer_layout = nil # Default mailer layout
|
38
38
|
# config.mailer_sender = nil # Default From value
|
39
39
|
# config.mailer_admin = nil # Default To value for Admin correspondence
|
40
|
-
|
40
|
+
# config.mailer_subject = nil # Proc.new method used to customize Subject
|
41
41
|
end
|
@@ -8,9 +8,9 @@ module EffectiveClassifieds
|
|
8
8
|
def self.config_keys
|
9
9
|
[
|
10
10
|
:classifieds_table_name, :classified_wizards_table_name,
|
11
|
+
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
|
11
12
|
:layout, :categories, :per_page, :use_effective_roles, :max_duration, :auto_approve,
|
12
|
-
:classified_wizard_class_name
|
13
|
-
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin
|
13
|
+
:classified_wizard_class_name
|
14
14
|
]
|
15
15
|
end
|
16
16
|
|
@@ -24,22 +24,4 @@ module EffectiveClassifieds
|
|
24
24
|
mailer&.constantize || Effective::ClassifiedsMailer
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.parent_mailer_class
|
28
|
-
return parent_mailer.constantize if parent_mailer.present?
|
29
|
-
ActionMailer::Base
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.send_email(email, *args)
|
33
|
-
raise('expected args to be an Array') unless args.kind_of?(Array)
|
34
|
-
|
35
|
-
if defined?(Tenant)
|
36
|
-
tenant = Tenant.current || raise('expected a current tenant')
|
37
|
-
args.last.kind_of?(Hash) ? args.last.merge!(tenant: tenant) : args << { tenant: tenant }
|
38
|
-
end
|
39
|
-
|
40
|
-
deliver_method = EffectiveClassifieds.deliver_method || EffectiveResources.deliver_method
|
41
|
-
|
42
|
-
EffectiveClassifieds.mailer_class.send(email, *args).send(deliver_method)
|
43
|
-
end
|
44
|
-
|
45
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_classifieds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
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: 2022-
|
11
|
+
date: 2022-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|