effective_classifieds 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/effective/classifieds_controller.rb +2 -3
  3. data/app/datatables/effective_classifieds_datatable.rb +4 -5
  4. data/app/models/concerns/effective_classifieds_classified_wizard.rb +2 -2
  5. data/app/views/admin/classifieds/_form.html.haml +1 -1
  6. data/app/views/admin/classifieds/_form_access.html.haml +2 -2
  7. data/app/views/effective/classified_wizards/_classified.html.haml +1 -1
  8. data/app/views/effective/classified_wizards/_dashboard.html.haml +5 -6
  9. data/app/views/effective/classified_wizards/_layout.html.haml +1 -1
  10. data/app/views/effective/classified_wizards/_summary.html.haml +25 -26
  11. data/app/views/effective/classified_wizards/billing.html.haml +1 -1
  12. data/app/views/effective/classified_wizards/start.html.haml +3 -4
  13. data/app/views/effective/classified_wizards/submitted.html.haml +3 -3
  14. data/app/views/effective/classified_wizards/summary.html.haml +1 -1
  15. data/app/views/effective/classifieds/_classified.html.haml +49 -51
  16. data/app/views/effective/classifieds/_dashboard.html.haml +3 -3
  17. data/app/views/effective/classifieds/_fields.html.haml +6 -6
  18. data/app/views/effective/classifieds/_layout.html.haml +2 -0
  19. data/app/views/effective/classifieds/_summary.html.haml +49 -0
  20. data/app/views/effective/classifieds/index.html.haml +8 -7
  21. data/app/views/effective/classifieds/show.html.haml +2 -2
  22. data/app/views/effective/classifieds_mailer/classified_submitted.html.haml +4 -4
  23. data/config/effective_classifieds.rb +3 -0
  24. data/lib/effective_classifieds/version.rb +1 -1
  25. data/lib/effective_classifieds.rb +1 -1
  26. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0aea0ae02dabe99cdca9471c23c158cdf007f31d7ae2fee4522103c2c3d678d7
4
- data.tar.gz: 0f4272176f66730441f1fa4b46e6858dd784ae3b5c95ccd23ef001415f206dfd
3
+ metadata.gz: 7791ff5277633953b3d9d43f9cdf8521954411ef5eb00ece46e14386cff7b0f4
4
+ data.tar.gz: '083ed5e9866481fc5513262496053f5ba4f5ea3b597d7d5a7218035dd75ecda5'
5
5
  SHA512:
6
- metadata.gz: f62c3c700c9701fe44c1a2fc9be24f458c2aff875c0f32509d26f367ed8ad30e78b52e7cfb735bb34c5a8fb22908f6c88e81b0858fd3c51c9cda5de8e2242305
7
- data.tar.gz: 2eece6889e8473c8acbc3c23a74b924894e89db234845ba0574784da9f0b3f6748ffb6e51596ee877c4f0c44a0a624c6fbfc16c423d901c95e182d73a4ee75e3
6
+ metadata.gz: fe6fc5ad68ad34f5c34915a997b08cb8550d8245e254d25b8c2e0f121e88e58b7d9af2918e0f4207e98746ad0040e00268fb88772956453121a82d0eaec63c9b
7
+ data.tar.gz: d8503e3830fdedbf1b7ac6d01df2050c134ce23dd7fc5151462218572620fd02df1b8f754e9bc1b4e200c7640278a4a93ff1f3de1a599faa647a9c6a4ebf607c
@@ -14,9 +14,8 @@ module Effective
14
14
  if EffectiveResources.authorized?(self, :admin, :effective_classifieds)
15
15
  flash.now[:warning] = [
16
16
  'Hi Admin!',
17
- ('You are viewing a hidden classified.' unless @classified.published?),
18
- 'Click here to',
19
- ("<a href='#{effective_classifieds.edit_admin_classified_path(@classified)}' class='alert-link'>edit classified settings</a>.")
17
+ ('You are viewing a hidden posting.' unless @classified.published?),
18
+ ("<a href='#{effective_classifieds.edit_admin_classified_path(@classified)}' class='alert-link'>Click here to edit settings</a>.")
20
19
  ].compact.join(' ')
21
20
  end
22
21
 
@@ -4,16 +4,15 @@ class EffectiveClassifiedsDatatable < Effective::Datatable
4
4
  length :all
5
5
  order :start_on
6
6
 
7
- col :start_on, as: :date, label: 'Posted'
7
+ col :start_on, as: :date, label: 'Published'
8
+ col :end_on, as: :date, label: 'Closing'
8
9
 
9
10
  col :title do |classified|
10
11
  link_to classified, effective_classifieds.classified_path(classified)
11
12
  end
12
13
 
13
- col :end_on, as: :date, label: 'Expires', visible: false
14
-
15
- col :organization, visible: false
16
- col :location, visible: false
14
+ col :organization
15
+ col :location
17
16
 
18
17
  col :body, visible: false
19
18
  col :website, visible: false
@@ -28,7 +28,7 @@ module EffectiveClassifiedsClassifiedWizard
28
28
 
29
29
  acts_as_wizard(
30
30
  start: 'Start',
31
- classified: 'Classified',
31
+ classified: 'Posting',
32
32
  summary: 'Review',
33
33
  billing: 'Billing Address',
34
34
  checkout: 'Checkout',
@@ -107,7 +107,7 @@ module EffectiveClassifiedsClassifiedWizard
107
107
 
108
108
  # Instance Methods
109
109
  def to_s
110
- 'classified ad submission'
110
+ 'posting submission'
111
111
  end
112
112
 
113
113
  def in_progress?
@@ -1,5 +1,5 @@
1
1
  = tabs do
2
- = tab 'Classified' do
2
+ = tab 'Posting' do
3
3
  = render 'admin/classifieds/form_classified', classified: classified
4
4
 
5
5
  - if classified.persisted?
@@ -1,10 +1,10 @@
1
1
  = effective_form_with(model: classified, url: classified.persisted? ? effective_classifieds.admin_classified_path(classified.id) : effective_classifieds.admin_classifieds_path) do |f|
2
- = f.check_box :authenticate_user, label: 'Yes, the user must be be signed in to view this classified', hint: 'Sign up is required to register for any classified'
2
+ = f.check_box :authenticate_user, label: 'Yes, the user must be be signed in to view', hint: 'Sign up is required to register for any classified'
3
3
 
4
4
  - if EffectiveClassifieds.use_effective_roles
5
5
  = f.checks :roles, EffectiveRoles.roles_collection(f.object)
6
6
 
7
7
  %p.text-hint
8
- * leave blank for a regular public classified that anyone can view
8
+ * Do not select a role to allow anyone with an account to view
9
9
 
10
10
  = f.submit
@@ -7,4 +7,4 @@
7
7
  = link_to('Edit', wizard_path(:classified)) if edit_effective_wizard?
8
8
 
9
9
  - classified = classified_wizard.classified
10
- = render 'effective/classifieds/classified', classified: classified
10
+ = render 'effective/classifieds/summary', classified: classified
@@ -5,10 +5,9 @@
5
5
  - datatable = EffectiveResources.best('EffectiveClassifiedWizardsDatatable').new(self, namespace: :effective)
6
6
 
7
7
  - if submission.present?
8
- %h2 In-progress Classified Ads
8
+ %h2 In-progress Postings
9
9
 
10
- %p
11
- Your submission for #{submission.classified.presence || 'a classified'} is incomplete.
10
+ %p Your posting submission is incomplete:
12
11
 
13
12
  %p
14
13
  Please
@@ -19,12 +18,12 @@
19
18
 
20
19
  %hr
21
20
 
22
- %h2 Classified Ads
21
+ %h2= EffectiveClassifieds.classifieds_label
23
22
 
24
23
  - if datatable.present?
25
24
  = render_simple_datatable(datatable)
26
25
  - else
27
- %p You don't have any classified ads. When you do, we'll show them here.
26
+ %p You don't have any postings. When you do, we'll show them here.
28
27
 
29
28
  - if submission.blank?
30
- %p= link_to 'Submit New Classified Ad', effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
29
+ %p= link_to "Submit New #{EffectiveClassifieds.classifieds_label} Posting", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
@@ -1,3 +1,3 @@
1
1
  .row
2
2
  .col-lg-3.mb-3= render_wizard_sidebar(resource)
3
- .col-lg-9= yield
3
+ .col-lg-9.pb-3= yield
@@ -1,30 +1,29 @@
1
- = card('Classified Ad') do
2
- - classified = classified_wizard.classified
1
+ - classified = classified_wizard.classified
3
2
 
4
- %table.table.table-sm
5
- %tbody
6
- %tr
7
- %th.border-0 Classified
8
- %td.border-0
3
+ %table.table.table-sm
4
+ %tbody
5
+ %tr
6
+ %th.border-0 Posting
7
+ %td.border-0
9
8
 
10
- - if classified&.published?
11
- = link_to(classified, effective_classifieds.classified_path(classified), target: '_blank')
12
- - else
13
- = classified.presence || 'Classified was deleted'
9
+ - if classified&.published?
10
+ = link_to(classified, effective_classifieds.classified_path(classified), target: '_blank')
11
+ - else
12
+ = classified.presence || 'Posting was deleted'
14
13
 
15
- - if request.path.start_with?('/admin')
16
- %tr
17
- %th Owner
18
- %td
19
- - url = (polymorphic_admin_path(classified_wizard.owner) rescue "/admin/users/#{classified_wizard.owner.to_param}/edit")
20
- = link_to(classified_wizard.owner, url)
21
- - else
22
- %tr
23
- %th Owner
24
- %td= classified_wizard.owner
14
+ - if request.path.start_with?('/admin')
15
+ %tr
16
+ %th Owner
17
+ %td
18
+ - url = (polymorphic_admin_path(classified_wizard.owner) rescue "/admin/users/#{classified_wizard.owner.to_param}/edit")
19
+ = link_to(classified_wizard.owner, url)
20
+ - else
21
+ %tr
22
+ %th Owner
23
+ %td= classified_wizard.owner
25
24
 
26
- - if classified&.was_submitted?
27
- %tr
28
- %th Status
29
- %td
30
- %span.badge.badge-secondary= classified.status
25
+ - if classified&.was_submitted?
26
+ %tr
27
+ %th Status
28
+ %td
29
+ %span.badge.badge-secondary= classified.status
@@ -10,6 +10,6 @@
10
10
  = f.fields_for(:owner, f.object.owner) do |fo|
11
11
  = effective_address_fields(fo, :billing)
12
12
 
13
- %p.text-muted * Not all classifieds require a fee and we ask for a billing address for future use
13
+ %p.text-muted * Not all postings require a fee and we ask for a billing address for future use.
14
14
 
15
15
  = f.save 'Save and Continue'
@@ -3,13 +3,12 @@
3
3
 
4
4
  .card
5
5
  .card-body
6
- %p
7
- Welcome #{current_user}!
6
+ %p Welcome #{current_user}!
8
7
 
9
8
  %p
10
- You can use this wizard to post a new classified ad.
9
+ You can use this wizard to submit a new #{EffectiveClassifieds.classifieds_label} posting.
11
10
  Your progress will be saved as you move through the wizard.
12
- Once the ad published you will be able to come back and edit/change the details.
11
+ Once your posting is published you are able to come back and edit the details.
13
12
 
14
13
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
15
14
  = f.hidden_field :id
@@ -10,11 +10,11 @@
10
10
  - raise('expected a purchased classified submit_order') unless resource.submit_order&.purchased?
11
11
 
12
12
  .alert.alert-warning.mb-4
13
- This classified was submitted on #{classified.submitted_at.strftime('%F')}.
13
+ This posting was submitted on #{classified.submitted_at.strftime('%F')}.
14
14
 
15
15
  - unless classified.approved?
16
- = card do
17
- %p Your classified must still be approved before it will be displayed.
16
+ .alert.alert-danger.mb-4
17
+ Your posting must still be approved before it will be displayed.
18
18
 
19
19
  = link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary mb-4'
20
20
 
@@ -5,4 +5,4 @@
5
5
 
6
6
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
7
7
  = f.hidden_field :id
8
- = f.submit 'Submit Classified Ad', class: 'btn btn-primary'
8
+ = f.submit "Submit #{EffectiveClassifieds.classifieds_label} Posting", class: 'btn btn-primary'
@@ -1,51 +1,49 @@
1
- .card
2
- .card-body
3
- %table.table.effective-classified-table
4
- %tbody
5
- %tr
6
- %th Category
7
- %td= classified.category
8
-
9
- %tr
10
- %th Title
11
- %td= classified.title
12
-
13
- %tr
14
- %th Available
15
- %td
16
- #{classified.start_on&.strftime('%F')}
17
- to
18
- #{classified.end_on&.strftime('%F')}
19
-
20
- - if classified.location.present?
21
- %tr
22
- %th Location
23
- %td= classified.location
24
-
25
- %tr
26
- %th Description
27
- %td= classified.body.to_s
28
-
29
- - if classified.file.attached?
30
- %tr
31
- %th Attachment
32
- %td= link_to(classified.file.filename, main_app.url_for(classified.file), target: '_blank')
33
-
34
- %tr
35
- %th Company
36
- %td= classified.organization
37
-
38
- - if classified.website.present?
39
- %tr
40
- %th Website
41
- %td= link_to(classified.website, classified.website, target: '_blank')
42
-
43
- - if classified.email.present?
44
- %tr
45
- %th Email
46
- %td= mail_to(classified.email)
47
-
48
- - if classified.phone.present?
49
- %tr
50
- %th Phone
51
- %td= classified.phone
1
+ %table.table.effective-classified-table
2
+ %tbody
3
+ %tr
4
+ %th Category
5
+ %td= classified.category
6
+
7
+ %tr
8
+ %th Title
9
+ %td= classified.title
10
+
11
+ %tr
12
+ %th Available
13
+ %td
14
+ #{classified.start_on&.strftime('%F')}
15
+ to
16
+ #{classified.end_on&.strftime('%F')}
17
+
18
+ - if classified.location.present?
19
+ %tr
20
+ %th Location
21
+ %td= classified.location
22
+
23
+ %tr
24
+ %th Description
25
+ %td= classified.body.to_s
26
+
27
+ - if classified.file.attached?
28
+ %tr
29
+ %th Attachment
30
+ %td= link_to(classified.file.filename, main_app.url_for(classified.file), target: '_blank')
31
+
32
+ %tr
33
+ %th Company
34
+ %td= classified.organization
35
+
36
+ - if classified.website.present?
37
+ %tr
38
+ %th Website
39
+ %td= link_to(classified.website, classified.website, target: '_blank')
40
+
41
+ - if classified.email.present?
42
+ %tr
43
+ %th Email
44
+ %td= mail_to(classified.email)
45
+
46
+ - if classified.phone.present?
47
+ %tr
48
+ %th Phone
49
+ %td= classified.phone
@@ -1,4 +1,4 @@
1
- %h2 Classifieds
1
+ %h2= EffectiveClassifieds.classifieds_label
2
2
 
3
3
  - published = Effective::Classified.classifieds(user: current_user).count
4
4
 
@@ -6,6 +6,6 @@
6
6
  - datatable = EffectiveClassifiedsDatatable.new(self, namespace: :effective)
7
7
  = render_datatable(datatable, simple: true)
8
8
  - else
9
- %p There are no active classified ads. When there are, we'll show them here.
9
+ %p There are no active postings. When there are, we'll show them here.
10
10
 
11
- %p= link_to 'View All Classifieds', effective_classifieds.classifieds_path, class: 'btn btn-primary'
11
+ %p= link_to 'View All', effective_classifieds.classifieds_path, class: 'btn btn-primary'
@@ -1,5 +1,5 @@
1
1
  = f.select :category, EffectiveClassifieds.categories, required: true
2
- = f.text_field :title
2
+ = f.text_field :title, label: "#{EffectiveClassifieds.classifieds_label} Posting Title"
3
3
  = f.text_field :location
4
4
 
5
5
  - if f.object.persisted? || f.object.errors.include?(:slug)
@@ -11,20 +11,20 @@
11
11
  .row
12
12
  .col-lg-6
13
13
  = f.date_field :start_on, label: "Start",
14
- hint: 'The classified ad will be displayed starting after this date.',
14
+ hint: 'The posting will be displayed starting after this date.',
15
15
  input_js: { minDate: minDate.strftime('%F') }
16
16
 
17
17
  .col-lg-6
18
18
  = f.date_field :end_on, label: "Expire",
19
- hint: 'The classified ad will no longer be displayed after this date.'
19
+ hint: 'The posting will no longer be displayed after this date.'
20
20
 
21
21
  - if f.object.persisted? && !f.object.draft?
22
- = f.check_box :archived, label: 'Yes, this classified is archived and will not be displayed'
22
+ = f.check_box :archived, label: 'Yes, this posting is archived. It will not be displayed.'
23
23
 
24
24
  - if defined?(EffectiveArticleEditor)
25
- = f.article_editor :body, label: 'Body content', hint: 'The main body content of your classified ad. Be sure to include all relevant information!'
25
+ = f.article_editor :body, label: 'Description', hint: 'The content of your posting. Be sure to include all relevant information!'
26
26
  - else
27
- = f.rich_text_area :body, label: 'Body content', hint: 'The main body content of your classified ad. Be sure to include all relevant information!'
27
+ = f.rich_text_area :body, label: 'Description', hint: 'The content of your posting. Be sure to include all relevant information!'
28
28
 
29
29
  = f.file_field :file, label: 'Attach PDF'
30
30
 
@@ -0,0 +1,2 @@
1
+ .effective-classifieds
2
+ = yield
@@ -0,0 +1,49 @@
1
+ %table.table.effective-classified-table
2
+ %tbody
3
+ %tr
4
+ %th Category
5
+ %td= classified.category
6
+
7
+ %tr
8
+ %th Title
9
+ %td= classified.title
10
+
11
+ %tr
12
+ %th Available
13
+ %td
14
+ #{classified.start_on&.strftime('%F')}
15
+ to
16
+ #{classified.end_on&.strftime('%F')}
17
+
18
+ - if classified.location.present?
19
+ %tr
20
+ %th Location
21
+ %td= classified.location
22
+
23
+ %tr
24
+ %th Description
25
+ %td= classified.body.to_s
26
+
27
+ - if classified.file.attached?
28
+ %tr
29
+ %th Attachment
30
+ %td= link_to(classified.file.filename, main_app.url_for(classified.file), target: '_blank')
31
+
32
+ %tr
33
+ %th Company
34
+ %td= classified.organization
35
+
36
+ - if classified.website.present?
37
+ %tr
38
+ %th Website
39
+ %td= link_to(classified.website, classified.website, target: '_blank')
40
+
41
+ - if classified.email.present?
42
+ %tr
43
+ %th Email
44
+ %td= mail_to(classified.email)
45
+
46
+ - if classified.phone.present?
47
+ %tr
48
+ %th Phone
49
+ %td= classified.phone
@@ -1,8 +1,9 @@
1
- .resource-buttons
2
- = link_to 'Submit New Classified Ad', effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
1
+ = render 'layout' do
2
+ .resource-buttons
3
+ = link_to "Submit New #{EffectiveClassifieds.classifieds_label} Posting", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
3
4
 
4
- = card do
5
- - if @datatable.present?(self)
6
- = render_datatable(@datatable, simple: true)
7
- - else
8
- %p There are no active classified ads. When there are, we'll show them here.
5
+ = card do
6
+ - if @datatable.present?(self)
7
+ = render_datatable(@datatable, simple: true)
8
+ - else
9
+ %p There are no active postings. When there are, we'll show them here.
@@ -1,8 +1,8 @@
1
1
  .effective-classified
2
2
  - unless @classified.published?
3
- .alert.alert-warning.mb-4 This classified is currently unavailable.
3
+ .alert.alert-warning.mb-4 This posting is currently unavailable.
4
4
 
5
5
  = render 'effective/classifieds/classified', classified: @classified
6
6
 
7
7
  .resource-buttons.text-left
8
- = link_to 'View All Classifieds', effective_classifieds.classifieds_path, class: 'btn btn-primary'
8
+ = link_to 'View All', effective_classifieds.classifieds_path, class: 'btn btn-primary'
@@ -1,9 +1,9 @@
1
1
  %p Hello Admin!
2
2
 
3
3
  - if @classified.published?
4
- %p The following classified ad has been submitted and is published online:
4
+ %p The following posting has been submitted and is published online:
5
5
  - else
6
- %p The following classified ad has been submitted and is awaiting your approval:
6
+ %p The following posting has been submitted and is awaiting your approval:
7
7
 
8
8
  %hr
9
9
 
@@ -13,8 +13,8 @@
13
13
  %hr
14
14
 
15
15
  - unless @classified.approved?
16
- %p= link_to('Approve Classified Ad', effective_classifieds.edit_admin_classified_path(@classified))
16
+ %p= link_to('Approve Posting', effective_classifieds.edit_admin_classified_path(@classified))
17
17
 
18
- %p= link_to('View Classified Ad', effective_classifieds.classified_path(@classified))
18
+ %p= link_to('View Posting', effective_classifieds.classified_path(@classified))
19
19
 
20
20
  %p Have a great day!
@@ -12,6 +12,9 @@ EffectiveClassifieds.setup do |config|
12
12
  # Classified Settings
13
13
  # config.classified_wizard_class_name = 'Effective::ClassifiedWizard'
14
14
 
15
+ # Page title like Classifieds or Job Board
16
+ config.classifieds_label = 'Classifieds'
17
+
15
18
  # Pagination length on the Classified#index page
16
19
  config.per_page = :all
17
20
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
@@ -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, :classifieds_label
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.4.0
4
+ version: 0.4.1
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-10-22 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -227,6 +227,8 @@ files:
227
227
  - app/views/effective/classifieds/_dashboard.html.haml
228
228
  - app/views/effective/classifieds/_fields.html.haml
229
229
  - app/views/effective/classifieds/_form.html.haml
230
+ - app/views/effective/classifieds/_layout.html.haml
231
+ - app/views/effective/classifieds/_summary.html.haml
230
232
  - app/views/effective/classifieds/edit.html.haml
231
233
  - app/views/effective/classifieds/index.html.haml
232
234
  - app/views/effective/classifieds/show.html.haml
@@ -260,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
262
  - !ruby/object:Gem::Version
261
263
  version: '0'
262
264
  requirements: []
263
- rubygems_version: 3.1.2
265
+ rubygems_version: 3.3.7
264
266
  signing_key:
265
267
  specification_version: 4
266
268
  summary: Users submit classified ads for job openings and equipment sales