effective_classifieds 0.4.2 → 0.4.4

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: df39e5bbe0e896642cdc96ad0c9cdbdc57212336c65525fbf2043d1dc28ff388
4
- data.tar.gz: 59ebf626938ba7ce8e1b36ccb93ecee56a716bf82f976cc93bfde44d9a9b9292
3
+ metadata.gz: 3610f8cb04cfd110fbcdae4c20891c456bf8634ed3f7a9acebfd740a20056f06
4
+ data.tar.gz: fb3dc4d6373143bbb5df800b632c96990d45ff46d7dad78058fdfc78cffa767f
5
5
  SHA512:
6
- metadata.gz: e88a56f3e13df16ff3f9c1d61b876ad2af12e0d063e51ffa8a5e48fb8867d8e0f5854da72a277e543c1a8fe32a550a856ac8685c5ad73ea4ae75e9e2993693d8
7
- data.tar.gz: 915e64ffa124a81dd8ae883e324538069fdbfb145b04f359524c495e794fdb821861d854c1ef11a70b82a525b98d96a73e0ae38ede67b9570608aa738fbe77d2
6
+ metadata.gz: '00780eb893c3051744a5fa5f0fa92cf97fd0afc513ce30442988726e4fa04366f2f043dcd19479cf7fb45d0bf115b12ca95c662a0300ac1310df1d224e43335d'
7
+ data.tar.gz: 18ba35c92f0efe5fc40c715ff6c14e3d84dfa2ce88af2908e983161ec16e1abd5cb15aa06aa7b751c95dd17aadfdcd1e5d008af836519ef392ef958b65891c31
@@ -2,7 +2,7 @@ module Effective
2
2
  class ClassifiedsController < ApplicationController
3
3
  include Effective::CrudController
4
4
 
5
- page_title EffectiveClassifieds.classifieds_label, only: :index
5
+ page_title(only: :index) { EffectiveClassifieds.classifieds_label }
6
6
 
7
7
  def show
8
8
  @classified = resource_scope.find(params[:id])
@@ -5,6 +5,7 @@ module Effective
5
5
  self.table_name = EffectiveClassifieds.classifieds_table_name.to_s
6
6
 
7
7
  attr_accessor :current_user
8
+ attr_accessor :importing
8
9
 
9
10
  acts_as_slugged
10
11
  acts_as_purchasable
@@ -118,11 +119,13 @@ module Effective
118
119
 
119
120
  validates :start_on, presence: true
120
121
  validates :end_on, presence: true
121
- validates :location, presence: true
122
122
 
123
- validates :organization, presence: true
124
- validates :email, presence: true
125
- validates :phone, presence: true
123
+ with_options(unless: -> { importing }) do
124
+ validates :location, presence: true
125
+ validates :organization, presence: true
126
+ validates :email, presence: true
127
+ validates :phone, presence: true
128
+ end
126
129
 
127
130
  validate(if: -> { start_on.present? && end_on.present? }) do
128
131
  self.errors.add(:end_on, 'must be after start date') if end_on < start_on
@@ -10,13 +10,13 @@
10
10
 
11
11
  .row
12
12
  .col-lg-6
13
- = f.date_field :start_on, label: "Start",
14
- hint: 'The posting will be displayed starting after this date.',
15
- input_js: { minDate: minDate.strftime('%F') }
13
+ - if f.object.new_record?
14
+ = f.date_field :start_on, label: "Start", hint: 'The posting will be displayed starting after this date.', input_js: { minDate: minDate.strftime('%F') }
15
+ - else
16
+ = f.date_field :start_on, label: "Start", hint: 'The posting will be displayed starting after this date.'
16
17
 
17
18
  .col-lg-6
18
- = f.date_field :end_on, label: "Expire",
19
- hint: 'The posting will no longer be displayed after this date.'
19
+ = f.date_field :end_on, label: "Expire", hint: 'The posting will no longer be displayed after this date.'
20
20
 
21
21
  - if f.object.persisted? && !f.object.draft?
22
22
  = f.check_box :archived, label: 'Yes, this posting is archived. It will not be displayed.'
data/config/routes.rb CHANGED
@@ -8,6 +8,7 @@ EffectiveClassifieds::Engine.routes.draw do
8
8
  # Public routes
9
9
  scope module: 'effective' do
10
10
  resources :classifieds, only: [:index, :show, :edit, :update]
11
+ resources :jobs, only: [:index, :show, :edit, :update], controller: 'classifieds'
11
12
 
12
13
  resources :classified_wizards, only: [:new, :show, :destroy] do
13
14
  resources :build, controller: :classified_wizards, only: [:show, :update]
@@ -19,6 +20,8 @@ EffectiveClassifieds::Engine.routes.draw do
19
20
  resources :classifieds, except: [:show] do
20
21
  post :approve, on: :member
21
22
  end
23
+
24
+ resources :jobs, except: [:show], controller: 'classifieds'
22
25
  end
23
26
 
24
27
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.4.2'.freeze
2
+ VERSION = '0.4.4'.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.2
4
+ version: 0.4.4
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-02 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  - !ruby/object:Gem::Version
263
263
  version: '0'
264
264
  requirements: []
265
- rubygems_version: 3.3.7
265
+ rubygems_version: 3.1.2
266
266
  signing_key:
267
267
  specification_version: 4
268
268
  summary: Users submit classified ads for job openings and equipment sales