effective_classifieds 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/classifieds_controller.rb +0 -1
- data/app/datatables/admin/effective_classifieds_datatable.rb +1 -0
- data/app/datatables/effective_classified_wizards_datatable.rb +4 -0
- data/app/models/effective/classified.rb +7 -2
- data/app/views/admin/classifieds/_form.html.haml +5 -0
- data/app/views/effective/classifieds/_fields.html.haml +1 -1
- data/config/effective_classifieds.rb +1 -1
- data/db/migrate/101_create_effective_classifieds.rb +3 -0
- data/lib/effective_classifieds/version.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: e96a880538ec95e1745ec13e6ac7520f9de680e824068182247bde290794b6e4
|
4
|
+
data.tar.gz: 18b832496e4a994383c2dced4291c60b7563b4f772b00dbb401e1a9a2f97e673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cff4f5bd000f79a03f1342f0e030ca4459a5ed825d512e014547d8aa4cd8744f5aa577bca1c4ba430fa57795017db9d2f20469118e57ab8fd3141e2439f1a5ec
|
7
|
+
data.tar.gz: 0ba27c2ed0d734c3bedf9e034c0f43e63c2f9d5619c071878e158b52510fd8079969ddcb0e3675cb1623ba6e698e48d10d2ce2b86efd6c0c2929df7718594ce5
|
@@ -12,6 +12,10 @@ class EffectiveClassifiedWizardsDatatable < Effective::Datatable
|
|
12
12
|
|
13
13
|
col :classifieds, search: :string, label: 'Title'
|
14
14
|
|
15
|
+
col :tracks_count, label: 'Views' do |wizard|
|
16
|
+
wizard.classified&.tracks_count
|
17
|
+
end
|
18
|
+
|
15
19
|
col :owner, visible: false, search: :string
|
16
20
|
|
17
21
|
col :status, visible: false do |wizard|
|
@@ -10,6 +10,7 @@ module Effective
|
|
10
10
|
acts_as_slugged
|
11
11
|
acts_as_purchasable
|
12
12
|
log_changes if respond_to?(:log_changes)
|
13
|
+
acts_as_trackable if respond_to?(:acts_as_trackable)
|
13
14
|
acts_as_role_restricted if respond_to?(:acts_as_role_restricted)
|
14
15
|
|
15
16
|
# This will be the owner of the classified ad submission
|
@@ -135,10 +136,14 @@ module Effective
|
|
135
136
|
self.errors.add(:end_on, 'must be after start date') if end_on < start_on
|
136
137
|
end
|
137
138
|
|
139
|
+
def end_on_distance
|
140
|
+
date = Time.zone.now
|
141
|
+
ApplicationController.helpers.distance_of_time_in_words(date + EffectiveClassifieds.max_duration, date).gsub('about', '').strip
|
142
|
+
end
|
143
|
+
|
138
144
|
validate(if: -> { start_on.present? && end_on.present? && EffectiveClassifieds.max_duration.present? && !importing }) do
|
139
145
|
if (end_on - start_on) > EffectiveClassifieds.max_duration
|
140
|
-
|
141
|
-
self.errors.add(:end_on, "must be within #{distance} of start date")
|
146
|
+
self.errors.add(:end_on, "must be within #{end_on_distance} of start date")
|
142
147
|
end
|
143
148
|
end
|
144
149
|
|
@@ -13,6 +13,11 @@
|
|
13
13
|
- datatable = Admin::EffectiveOrdersDatatable.new(parent: classified.classified_wizard, owner: classified.owner, user: classified.owner, total: false)
|
14
14
|
= render_datatable(datatable, simple: true)
|
15
15
|
|
16
|
+
- if classified.class.respond_to?(:acts_as_trackable?)
|
17
|
+
= tab 'Tracks' do
|
18
|
+
- datatable = Admin::EffectiveTracksDatatable.new(owner: classified)
|
19
|
+
= render_datatable(datatable, inline: true, namespace: :admin)
|
20
|
+
|
16
21
|
- if classified.respond_to?(:log_changes_datatable)
|
17
22
|
= tab 'Logs' do
|
18
23
|
= render_inline_datatable(classified.log_changes_datatable)
|
@@ -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.'
|
@@ -22,7 +22,7 @@ EffectiveClassifieds.setup do |config|
|
|
22
22
|
config.auto_approve = false
|
23
23
|
|
24
24
|
# Can checkout with phone or cheque 'deferred' payment providers
|
25
|
-
config.skip_deferred =
|
25
|
+
config.skip_deferred = true
|
26
26
|
|
27
27
|
# Mailer Settings
|
28
28
|
# Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
|
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.7.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: 2024-
|
11
|
+
date: 2024-06-27 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
|