effective_classifieds 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +122 -0
- data/Rakefile +18 -0
- data/app/assets/config/effective_classifieds_manifest.js +3 -0
- data/app/assets/javascripts/effective_classifieds/base.js +0 -0
- data/app/assets/javascripts/effective_classifieds.js +1 -0
- data/app/assets/stylesheets/effective_classifieds/base.scss +0 -0
- data/app/assets/stylesheets/effective_classifieds.scss +1 -0
- data/app/controllers/admin/classified_submissions_controller.rb +19 -0
- data/app/controllers/admin/classifieds_controller.rb +20 -0
- data/app/controllers/effective/classified_submissions_controller.rb +31 -0
- data/app/controllers/effective/classifieds_controller.rb +53 -0
- data/app/datatables/admin/effective_classified_submissions_datatable.rb +22 -0
- data/app/datatables/admin/effective_classifieds_datatable.rb +61 -0
- data/app/datatables/effective_classified_submissions_datatable.rb +37 -0
- data/app/datatables/effective_classifieds_datatable.rb +25 -0
- data/app/helpers/effective_classifieds_helper.rb +7 -0
- data/app/mailers/effective/classifieds_mailer.rb +22 -0
- data/app/models/concerns/effective_classifieds_classified_submission.rb +112 -0
- data/app/models/effective/classified.rb +164 -0
- data/app/models/effective/classified_submission.rb +7 -0
- data/app/views/admin/classifieds/_form.html.haml +12 -0
- data/app/views/admin/classifieds/_form_access.html.haml +10 -0
- data/app/views/admin/classifieds/_form_classified.html.haml +3 -0
- data/app/views/effective/classified_submissions/_classified.haml +12 -0
- data/app/views/effective/classified_submissions/_classified_submission.html.haml +8 -0
- data/app/views/effective/classified_submissions/_content.html.haml +1 -0
- data/app/views/effective/classified_submissions/_dashboard.html.haml +28 -0
- data/app/views/effective/classified_submissions/_layout.html.haml +3 -0
- data/app/views/effective/classified_submissions/_summary.html.haml +30 -0
- data/app/views/effective/classified_submissions/classified.html.haml +17 -0
- data/app/views/effective/classified_submissions/start.html.haml +16 -0
- data/app/views/effective/classified_submissions/submitted.html.haml +13 -0
- data/app/views/effective/classified_submissions/summary.html.haml +8 -0
- data/app/views/effective/classifieds/_classified.html.haml +50 -0
- data/app/views/effective/classifieds/_dashboard.html.haml +8 -0
- data/app/views/effective/classifieds/_fields.html.haml +28 -0
- data/app/views/effective/classifieds/_form.html.haml +3 -0
- data/app/views/effective/classifieds/_layout.html.haml +1 -0
- data/app/views/effective/classifieds/_spacer.html.haml +1 -0
- data/app/views/effective/classifieds/index.html.haml +8 -0
- data/app/views/effective/classifieds/show.html.haml +8 -0
- data/app/views/effective/classifieds_mailer/classified_submitted.html.haml +16 -0
- data/app/views/layouts/effective_classifieds_mailer_layout.html.haml +7 -0
- data/config/effective_classifieds.rb +45 -0
- data/config/routes.rb +24 -0
- data/db/migrate/01_create_effective_classifieds.rb.erb +62 -0
- data/db/seeds.rb +1 -0
- data/lib/effective_classifieds/engine.rb +18 -0
- data/lib/effective_classifieds/version.rb +3 -0
- data/lib/effective_classifieds.rb +45 -0
- data/lib/generators/effective_classifieds/install_generator.rb +31 -0
- data/lib/generators/templates/effective_classifieds_mailer_preview.rb +4 -0
- data/lib/tasks/effective_classifieds_tasks.rake +8 -0
- metadata +251 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'effective_resources'
|
2
|
+
require 'effective_datatables'
|
3
|
+
require 'effective_classifieds/engine'
|
4
|
+
require 'effective_classifieds/version'
|
5
|
+
|
6
|
+
module EffectiveClassifieds
|
7
|
+
|
8
|
+
def self.config_keys
|
9
|
+
[
|
10
|
+
:classifieds_table_name, :classified_submissions_table_name,
|
11
|
+
:layout, :categories, :per_page, :use_effective_roles, :max_duration, :auto_approve,
|
12
|
+
:classified_submission_class_name,
|
13
|
+
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin
|
14
|
+
]
|
15
|
+
end
|
16
|
+
|
17
|
+
include EffectiveGem
|
18
|
+
|
19
|
+
def self.ClassifiedSubmission
|
20
|
+
classified_submission_class_name&.constantize || Effective::ClassifiedSubmission
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.mailer_class
|
24
|
+
mailer&.constantize || Effective::ClassifiedsMailer
|
25
|
+
end
|
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
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module EffectiveMemberships
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
include Rails::Generators::Migration
|
5
|
+
|
6
|
+
desc 'Creates an EffectiveClassifieds initializer in your application.'
|
7
|
+
|
8
|
+
source_root File.expand_path('../../templates', __FILE__)
|
9
|
+
|
10
|
+
def self.next_migration_number(dirname)
|
11
|
+
if not ActiveRecord::Base.timestamped_migrations
|
12
|
+
Time.new.utc.strftime("%Y%m%d%H%M%S")
|
13
|
+
else
|
14
|
+
'%.3d' % (current_migration_number(dirname) + 1)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_initializer
|
19
|
+
template ('../' * 3) + 'config/effective_classifieds.rb', 'config/initializers/effective_classifieds.rb'
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_migration_file
|
23
|
+
@classifieds_table_name = ':' + EffectiveClassifieds.classifieds_table_name.to_s
|
24
|
+
@classified_submissions_table_name = ':' + EffectiveClassifieds.classified_submissions_table_name.to_s
|
25
|
+
|
26
|
+
migration_template ('../' * 3) + 'db/migrate/01_create_effective_classifieds.rb.erb', 'db/migrate/create_effective_classifieds.rb'
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,251 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: effective_classifieds
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Code and Effect
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 6.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 6.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: effective_bootstrap
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: effective_datatables
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 4.0.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 4.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: effective_resources
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: effective_roles
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sqlite3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: devise
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: haml-rails
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: pry-byebug
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: effective_test_bot
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: effective_developer
|
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'
|
167
|
+
description: Users submit classified ads for job openings and equipment sales
|
168
|
+
email:
|
169
|
+
- info@codeandeffect.com
|
170
|
+
executables: []
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files: []
|
173
|
+
files:
|
174
|
+
- MIT-LICENSE
|
175
|
+
- README.md
|
176
|
+
- Rakefile
|
177
|
+
- app/assets/config/effective_classifieds_manifest.js
|
178
|
+
- app/assets/javascripts/effective_classifieds.js
|
179
|
+
- app/assets/javascripts/effective_classifieds/base.js
|
180
|
+
- app/assets/stylesheets/effective_classifieds.scss
|
181
|
+
- app/assets/stylesheets/effective_classifieds/base.scss
|
182
|
+
- app/controllers/admin/classified_submissions_controller.rb
|
183
|
+
- app/controllers/admin/classifieds_controller.rb
|
184
|
+
- app/controllers/effective/classified_submissions_controller.rb
|
185
|
+
- app/controllers/effective/classifieds_controller.rb
|
186
|
+
- app/datatables/admin/effective_classified_submissions_datatable.rb
|
187
|
+
- app/datatables/admin/effective_classifieds_datatable.rb
|
188
|
+
- app/datatables/effective_classified_submissions_datatable.rb
|
189
|
+
- app/datatables/effective_classifieds_datatable.rb
|
190
|
+
- app/helpers/effective_classifieds_helper.rb
|
191
|
+
- app/mailers/effective/classifieds_mailer.rb
|
192
|
+
- app/models/concerns/effective_classifieds_classified_submission.rb
|
193
|
+
- app/models/effective/classified.rb
|
194
|
+
- app/models/effective/classified_submission.rb
|
195
|
+
- app/views/admin/classifieds/_form.html.haml
|
196
|
+
- app/views/admin/classifieds/_form_access.html.haml
|
197
|
+
- app/views/admin/classifieds/_form_classified.html.haml
|
198
|
+
- app/views/effective/classified_submissions/_classified.haml
|
199
|
+
- app/views/effective/classified_submissions/_classified_submission.html.haml
|
200
|
+
- app/views/effective/classified_submissions/_content.html.haml
|
201
|
+
- app/views/effective/classified_submissions/_dashboard.html.haml
|
202
|
+
- app/views/effective/classified_submissions/_layout.html.haml
|
203
|
+
- app/views/effective/classified_submissions/_summary.html.haml
|
204
|
+
- app/views/effective/classified_submissions/classified.html.haml
|
205
|
+
- app/views/effective/classified_submissions/start.html.haml
|
206
|
+
- app/views/effective/classified_submissions/submitted.html.haml
|
207
|
+
- app/views/effective/classified_submissions/summary.html.haml
|
208
|
+
- app/views/effective/classifieds/_classified.html.haml
|
209
|
+
- app/views/effective/classifieds/_dashboard.html.haml
|
210
|
+
- app/views/effective/classifieds/_fields.html.haml
|
211
|
+
- app/views/effective/classifieds/_form.html.haml
|
212
|
+
- app/views/effective/classifieds/_layout.html.haml
|
213
|
+
- app/views/effective/classifieds/_spacer.html.haml
|
214
|
+
- app/views/effective/classifieds/index.html.haml
|
215
|
+
- app/views/effective/classifieds/show.html.haml
|
216
|
+
- app/views/effective/classifieds_mailer/classified_submitted.html.haml
|
217
|
+
- app/views/layouts/effective_classifieds_mailer_layout.html.haml
|
218
|
+
- config/effective_classifieds.rb
|
219
|
+
- config/routes.rb
|
220
|
+
- db/migrate/01_create_effective_classifieds.rb.erb
|
221
|
+
- db/seeds.rb
|
222
|
+
- lib/effective_classifieds.rb
|
223
|
+
- lib/effective_classifieds/engine.rb
|
224
|
+
- lib/effective_classifieds/version.rb
|
225
|
+
- lib/generators/effective_classifieds/install_generator.rb
|
226
|
+
- lib/generators/templates/effective_classifieds_mailer_preview.rb
|
227
|
+
- lib/tasks/effective_classifieds_tasks.rake
|
228
|
+
homepage: https://github.com/code-and-effect/effective_classifieds
|
229
|
+
licenses:
|
230
|
+
- MIT
|
231
|
+
metadata: {}
|
232
|
+
post_install_message:
|
233
|
+
rdoc_options: []
|
234
|
+
require_paths:
|
235
|
+
- lib
|
236
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
237
|
+
requirements:
|
238
|
+
- - ">="
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: '0'
|
241
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
242
|
+
requirements:
|
243
|
+
- - ">="
|
244
|
+
- !ruby/object:Gem::Version
|
245
|
+
version: '0'
|
246
|
+
requirements: []
|
247
|
+
rubygems_version: 3.1.2
|
248
|
+
signing_key:
|
249
|
+
specification_version: 4
|
250
|
+
summary: Users submit classified ads for job openings and equipment sales
|
251
|
+
test_files: []
|