effective_classifieds 0.4.11 → 0.4.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f03f965b89f0bf85f9aa3e719028222db5ce54a45d1cfe27404c1cce77f20ac0
4
- data.tar.gz: fac5220170dfcf7ce73e3b59b912768842572281b8142e6f46ba5fd34f8ebe63
3
+ metadata.gz: 2d802fe2eac42d3af8f640f04c62dccbbe373562b72f17953f1f7628cb035516
4
+ data.tar.gz: de411167ca89c14a53a0c1f5e0da3180e9bbc7ef1bf1e23661cba0c41b08eaa2
5
5
  SHA512:
6
- metadata.gz: e92522ded518276b104933226a139d73ffd6d7308c78fa2b212c06996cdc444f7e0a03836f171447d13256c838bbc99180589dffc4582e34be246c96049d9429
7
- data.tar.gz: 86012d68e09487e01b305eac9da835a4710732a9c555e16dbdcbef2bb277a51a1ee3038160a653cf5dd7290bc849d3cd2d83f82cf0c6395c925e08a7cf94d35b
6
+ metadata.gz: 763605c34d15d43a3fbbd6e8709bfcdce16d7e914033c97e1ae2e4c8b51e1b64d287926ea847ea3ed5ce452e96507972b2fe0c6e559183388642c935799abb80
7
+ data.tar.gz: aa4bffcfe58593301ecfd435b6514f0e6e2662504cfab015a5a1137f48854c1852458991f45ecfd0896f4847f06a7f5230adade329254bfe2c1b55d0d8b9ec71
@@ -21,11 +21,16 @@ class EffectiveClassifiedWizardsDatatable < Effective::Datatable
21
21
  actions_col(actions: []) do |wizard|
22
22
  if wizard.draft?
23
23
  dropdown_link_to('Continue', effective_classifieds.classified_wizard_build_path(wizard, wizard.next_step), 'data-turbolinks' => false)
24
- else
24
+ elsif wizard.classified.present?
25
+ dropdown_link_to('Show', effective_classifieds.classified_path(wizard.classified))
25
26
  dropdown_link_to('Edit', effective_classifieds.edit_classified_path(wizard.classified))
27
+ dropdown_link_to('Show Wizard', effective_classifieds.classified_wizard_path(wizard), 'data-turbolinks' => false)
28
+ end
29
+
30
+ if EffectiveResources.authorized?(self, :destroy, wizard)
31
+ dropdown_link_to('Delete', effective_classifieds.classified_wizard_path(wizard), 'data-confirm': "Really delete #{wizard}?", 'data-method': :delete)
26
32
  end
27
33
 
28
- dropdown_link_to('Delete', effective_classifieds.classified_wizard_path(wizard), 'data-confirm': "Really delete #{wizard}?", 'data-method': :delete)
29
34
  end
30
35
  end
31
36
 
@@ -127,11 +127,11 @@ module Effective
127
127
  validates :phone, presence: true
128
128
  end
129
129
 
130
- validate(if: -> { start_on.present? && end_on.present? }) do
130
+ validate(if: -> { start_on.present? && end_on.present? && !importing }) do
131
131
  self.errors.add(:end_on, 'must be after start date') if end_on < start_on
132
132
  end
133
133
 
134
- validate(if: -> { start_on.present? && end_on.present? && EffectiveClassifieds.max_duration.present? }) do
134
+ validate(if: -> { start_on.present? && end_on.present? && EffectiveClassifieds.max_duration.present? && !importing }) do
135
135
  if (end_on - start_on) > EffectiveClassifieds.max_duration
136
136
  distance = ApplicationController.helpers.distance_of_time_in_words(end_on + EffectiveClassifieds.max_duration, end_on).gsub('about', '').strip
137
137
  self.errors.add(:end_on, "must be within #{distance} of start date")
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.4.11'.freeze
2
+ VERSION = '0.4.13'.freeze
3
3
  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.11
4
+ version: 0.4.13
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: 2023-03-10 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails