effective_classifieds 0.6.5 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/classified.rb +6 -2
- data/app/views/effective/classified_wizards/checkout.html.haml +1 -1
- data/app/views/effective/classified_wizards/submitted.html.haml +2 -2
- data/app/views/effective/classifieds/_fields.html.haml +1 -1
- data/config/effective_classifieds.rb +3 -0
- data/lib/effective_classifieds/version.rb +1 -1
- data/lib/effective_classifieds.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb913b24db42f767a00e6510007f7cbdd4a23f41cc12250418a7e81328746f9
|
4
|
+
data.tar.gz: 604f561f584ec2199be9641ba9d7a9616f3a496c147c85e3eaa101451265f265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a05e61dba76290ffeac816e406e72cecf48998311b633c1deb64dcef168ee1e03521725a64c79d8ec3609aec98e1b279c116680bbfcdfac0b1618018c3ac570
|
7
|
+
data.tar.gz: f7c42880255906ef28717bf3cbf93cf4f2e8a66bb9b3396e3052826828543523ff4145bec96e2851617b5a198e2f070d041b37cb42e3c54cbbfca95dd38e98ce
|
@@ -135,10 +135,14 @@ module Effective
|
|
135
135
|
self.errors.add(:end_on, 'must be after start date') if end_on < start_on
|
136
136
|
end
|
137
137
|
|
138
|
+
def end_on_distance
|
139
|
+
date = Time.zone.now
|
140
|
+
ApplicationController.helpers.distance_of_time_in_words(date + EffectiveClassifieds.max_duration, date).gsub('about', '').strip
|
141
|
+
end
|
142
|
+
|
138
143
|
validate(if: -> { start_on.present? && end_on.present? && EffectiveClassifieds.max_duration.present? && !importing }) do
|
139
144
|
if (end_on - start_on) > EffectiveClassifieds.max_duration
|
140
|
-
|
141
|
-
self.errors.add(:end_on, "must be within #{distance} of start date")
|
145
|
+
self.errors.add(:end_on, "must be within #{end_on_distance} of start date")
|
142
146
|
end
|
143
147
|
end
|
144
148
|
|
@@ -2,4 +2,4 @@
|
|
2
2
|
= render 'effective/classified_wizards/content', resource: resource
|
3
3
|
|
4
4
|
= card do
|
5
|
-
= render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:submitted), deferred_url: wizard_path(:checkout), declined_url: wizard_path(:checkout))
|
5
|
+
= render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:submitted), deferred_url: wizard_path(:checkout), declined_url: wizard_path(:checkout), skip_deferred: EffectiveClassifieds.skip_deferred)
|
@@ -9,11 +9,11 @@
|
|
9
9
|
- if resource.checkout_required?
|
10
10
|
- raise('expected a purchased classified submit_order') unless resource.submit_order&.purchased?
|
11
11
|
|
12
|
-
.alert.alert-
|
12
|
+
.alert.alert-success.mb-4
|
13
13
|
This #{classified_label.downcase} was submitted on #{classified.submitted_at.strftime('%F')}.
|
14
14
|
|
15
15
|
- unless classified.approved?
|
16
|
-
.alert.alert-
|
16
|
+
.alert.alert-warning.mb-4
|
17
17
|
Your #{classified_label.downcase} must still be approved before it will be displayed.
|
18
18
|
|
19
19
|
.mb-4= link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
|
@@ -17,7 +17,7 @@
|
|
17
17
|
= f.date_field :start_on, label: "Start", hint: 'The posting will be displayed starting after this date.'
|
18
18
|
|
19
19
|
.col-lg-6
|
20
|
-
= f.date_field :end_on, label: "Expire", hint:
|
20
|
+
= f.date_field :end_on, label: "Expire", hint: "The posting will no longer be displayed after this date. Please enter a date within #{f.object.end_on_distance} of start date"
|
21
21
|
|
22
22
|
- if f.object.persisted? && !f.object.draft?
|
23
23
|
= f.check_box :archived, label: 'Yes, this posting is archived. It will not be displayed.'
|
@@ -21,6 +21,9 @@ EffectiveClassifieds.setup do |config|
|
|
21
21
|
# Automatically approve classified ad submissions, otherwise require admin approval
|
22
22
|
config.auto_approve = false
|
23
23
|
|
24
|
+
# Can checkout with phone or cheque 'deferred' payment providers
|
25
|
+
config.skip_deferred = true
|
26
|
+
|
24
27
|
# Mailer Settings
|
25
28
|
# Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
|
26
29
|
#
|
@@ -10,7 +10,7 @@ module EffectiveClassifieds
|
|
10
10
|
:classifieds_table_name, :classified_wizards_table_name,
|
11
11
|
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
|
12
12
|
:layout, :categories, :per_page, :use_effective_roles, :max_duration, :auto_approve,
|
13
|
-
:classified_wizard_class_name
|
13
|
+
:classified_wizard_class_name, :skip_deferred
|
14
14
|
]
|
15
15
|
end
|
16
16
|
|
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.6.
|
4
|
+
version: 0.6.7
|
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:
|
11
|
+
date: 2024-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: effective_email_templates
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: effective_test_bot
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|