effective_classifieds 0.4.12 → 0.5.0

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: c3a688220a935a6980554c621e35be675cc20e766ed739757817462e782d542d
4
- data.tar.gz: b1cf7e9621ff79365d006f27102045466ad086362a925f45ea9772ebe9699690
3
+ metadata.gz: 0e0ef9d80b727dd2010987510e92ba800401209d898f2797d82ab2bd16054aa2
4
+ data.tar.gz: c19d09c1d221d9c48869b25cbb643bf4d5f59cc7ee7de3b04c3a4e51d6019ca9
5
5
  SHA512:
6
- metadata.gz: ffbf9be19f33ccc8065cdbe50d0f3d06e85f545195501f623e3e90e44322f0901f989e0433654721a85ba0fe0104566cc4d6b04f8cfdbef38201d72424dd0e00
7
- data.tar.gz: e71a5b0407e3a35599cbc42f618bf7111ae372139f7a942b349c2577b5120984b0b97c496e8e96e402bd5e21c19f0e77a75cf4c62f36a315d8faa15ff995166b
6
+ metadata.gz: d151d6779e798212ad62143da7ece3d75da8ebcdfcf8ad48a1946f841847028bd88e4e57d5486426aecbcb8a81606bd7c75d1063a53db13cafd2d81e87d3b986
7
+ data.tar.gz: 4b2fe777a078b329dc464dea6fa556887568d2a1db578499510fe6653e8176552c0198b5581949a2a052bb6ecfbff39364cd3e2e94a822d6f04d0fb801c513d5
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2022 Code and Effect Inc.
1
+ Copyright 2023 Code and Effect Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -5,9 +5,6 @@ module Admin
5
5
 
6
6
  include Effective::CrudController
7
7
 
8
- page_title(only: :index) { EffectiveClassifieds.classifieds_label }
9
- page_title(only: :new) { "New #{EffectiveClassifieds.classifieds_label} Posting" }
10
-
11
8
  submit :save, 'Save'
12
9
  submit :save, 'Save and View', redirect: -> { effective_classifieds.classified_path(resource) }
13
10
  submit :approve, 'Approve'
@@ -2,7 +2,7 @@ module Effective
2
2
  class ClassifiedsController < ApplicationController
3
3
  include Effective::CrudController
4
4
 
5
- page_title(only: :index) { EffectiveClassifieds.classifieds_label }
5
+ page_title(only: :index) { view_context.classifieds_name_label }
6
6
 
7
7
  def show
8
8
  @classified = resource_scope.find(params[:id])
@@ -49,7 +49,7 @@ module Admin
49
49
  col :purchased_order, visible: false
50
50
 
51
51
  actions_col do |classified|
52
- dropdown_link_to('View Classified', effective_classifieds.classified_path(classified), target: '_blank')
52
+ dropdown_link_to("View #{classified_label}", effective_classifieds.classified_path(classified), target: '_blank')
53
53
  end
54
54
  end
55
55
 
@@ -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
 
@@ -1,2 +1,17 @@
1
1
  module EffectiveClassifiedsHelper
2
+
3
+ # Job Board or Classifieds
4
+ def classifieds_name_label
5
+ et('effective_classifieds.name')
6
+ end
7
+
8
+ # Job Board Posting or Classified Posting
9
+ def classified_label
10
+ et(Effective::Classified)
11
+ end
12
+
13
+ # Job Board Postings or Classified Postings
14
+ def classifieds_label
15
+ ets(Effective::Classified)
16
+ end
2
17
  end
@@ -107,7 +107,7 @@ module EffectiveClassifiedsClassifiedWizard
107
107
 
108
108
  # Instance Methods
109
109
  def to_s
110
- 'posting submission'
110
+ model_name.human
111
111
  end
112
112
 
113
113
  def in_progress?
@@ -147,7 +147,7 @@ module Effective
147
147
  end
148
148
 
149
149
  def to_s
150
- title.presence || 'New Classified'
150
+ title.presence || model_name.human
151
151
  end
152
152
 
153
153
  def purchasable_name
@@ -1,5 +1,5 @@
1
1
  = tabs do
2
- = tab 'Posting' do
2
+ = tab(et(classified)) do
3
3
  = render 'admin/classifieds/form_classified', classified: classified
4
4
 
5
5
  - if classified.persisted?
@@ -5,25 +5,25 @@
5
5
  - datatable = EffectiveResources.best('EffectiveClassifiedWizardsDatatable').new(self, namespace: :effective)
6
6
 
7
7
  - if submission.present?
8
- %h2 In-progress Postings
8
+ %h2 In-progress #{classifieds_label}
9
9
 
10
- %p Your posting submission is incomplete:
10
+ %p Your submission is incomplete:
11
11
 
12
12
  %p
13
13
  Please
14
- = link_to("Continue submission for #{submission.classified.presence || 'a classified'}", effective_classifieds.classified_wizard_build_path(submission, submission.next_step), 'data-turbolinks' => false, class: 'btn btn-primary')
14
+ = link_to("Continue submission", effective_classifieds.classified_wizard_build_path(submission, submission.next_step), 'data-turbolinks' => false, class: 'btn btn-primary')
15
15
  or you can
16
16
  = link_to('Abandon submission', effective_classifieds.classified_wizard_path(submission), 'data-confirm': "Really delete #{submission}?", 'data-method': :delete, class: 'btn btn-danger')
17
17
  to submit another.
18
18
 
19
19
  %hr
20
20
 
21
- %h2= EffectiveClassifieds.classifieds_label
21
+ %h2= classifieds_label
22
22
 
23
23
  - if datatable.present?
24
24
  = render_simple_datatable(datatable)
25
25
  - else
26
- %p You don't have any postings. When you do, we'll show them here.
26
+ %p You don't have any #{classifieds_label.downcase}. When you do, we'll show them here.
27
27
 
28
28
  - if submission.blank?
29
- %p= link_to "Submit New #{EffectiveClassifieds.classifieds_label} Posting", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
29
+ %p= link_to "Submit New #{classified_label}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
@@ -3,7 +3,7 @@
3
3
  %table.table.table-sm
4
4
  %tbody
5
5
  %tr
6
- %th.border-0 Posting
6
+ %th.border-0= classified_label
7
7
  %td.border-0
8
8
 
9
9
  - if classified&.published?
@@ -13,13 +13,13 @@
13
13
 
14
14
  - if request.path.start_with?('/admin')
15
15
  %tr
16
- %th Owner
16
+ %th Submitted by
17
17
  %td
18
18
  - url = (polymorphic_admin_path(classified_wizard.owner) rescue "/admin/users/#{classified_wizard.owner.to_param}/edit")
19
19
  = link_to(classified_wizard.owner, url)
20
20
  - else
21
21
  %tr
22
- %th Owner
22
+ %th Submitted by
23
23
  %td= classified_wizard.owner
24
24
 
25
25
  - if classified&.was_submitted?
@@ -6,7 +6,7 @@
6
6
  %p Welcome #{current_user}!
7
7
 
8
8
  %p
9
- You can use this wizard to submit a new #{EffectiveClassifieds.classifieds_label} posting.
9
+ You can use this wizard to submit a new #{classified_label.downcase} for display on the #{classifieds_name_label}.
10
10
  Your progress will be saved as you move through the wizard.
11
11
  Once your posting is published you are able to come back and edit the details.
12
12
 
@@ -10,15 +10,17 @@
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 posting was submitted on #{classified.submitted_at.strftime('%F')}.
13
+ This #{classified_label.downcase} was submitted on #{classified.submitted_at.strftime('%F')}.
14
14
 
15
15
  - unless classified.approved?
16
16
  .alert.alert-danger.mb-4
17
- Your posting must still be approved before it will be displayed.
17
+ Your #{classified_label.downcase} must still be approved before it will be displayed.
18
18
 
19
- = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
19
+ .mb-4= link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
20
+
21
+ = card do
22
+ = render 'effective/classified_wizards/summary', classified_wizard: resource
20
23
 
21
- = render 'effective/classified_wizards/summary', classified_wizard: resource
22
24
  = render 'effective/classified_wizards/classified_wizard', classified_wizard: resource
23
25
 
24
26
  - if resource.orders.present?
@@ -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 #{EffectiveClassifieds.classifieds_label} Posting", class: 'btn btn-primary'
8
+ = f.submit "Submit #{classified_label}", class: 'btn btn-primary'
@@ -1,4 +1,4 @@
1
- %h2= EffectiveClassifieds.classifieds_label
1
+ %h2= classifieds_name_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 postings. When there are, we'll show them here.
9
+ %p There are no active #{classifieds_label.downcase}. When there are, we'll show them here.
10
10
 
11
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, label: "#{EffectiveClassifieds.classifieds_label} Posting Title"
2
+ = f.text_field :title
3
3
  = f.text_field :location
4
4
 
5
5
  - if f.object.persisted? || f.object.errors.include?(:slug)
@@ -11,7 +11,7 @@
11
11
  .row
12
12
  .col-lg-6
13
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') }
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
15
  - else
16
16
  = f.date_field :start_on, label: "Start", hint: 'The posting will be displayed starting after this date.'
17
17
 
@@ -26,13 +26,13 @@
26
26
  - else
27
27
  = f.rich_text_area :body, label: 'Description', hint: 'The content of your posting. Be sure to include all relevant information!'
28
28
 
29
- = f.file_field :file, label: 'Attach PDF'
29
+ = f.file_field :file, hint: 'Please attach a PDF'
30
30
 
31
31
  %h2.mt-5.mb-0 Contact Information
32
32
  %p
33
- %small.text-muted Contact information will be displayed on the classified ad.
33
+ %small.text-muted Contact information will be displayed on the #{classifieds_name_label} ad.
34
34
 
35
- = f.text_field :organization, label: 'Company or Organization'
35
+ = f.text_field :organization, hint: 'Organization or company name'
36
36
  = f.url_field :website
37
37
  = f.email_field :email
38
38
  = f.tel_field :phone
@@ -1,49 +1,2 @@
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
+ = effective_table_with(classified, except: :slug) do |f|
2
+ = render('effective/classifieds/fields', f: f)
@@ -1,9 +1,9 @@
1
1
  = render 'layout' do
2
2
  .resource-buttons
3
- = link_to "Submit New #{EffectiveClassifieds.classifieds_label} Posting", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
3
+ = link_to "Submit New #{et(Effective::Classified)}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
4
4
 
5
5
  = card do
6
6
  - if @datatable.present?(self)
7
7
  = render_datatable(@datatable, simple: true)
8
8
  - else
9
- %p There are no active postings. When there are, we'll show them here.
9
+ %p There are no active #{etsd(Effective::Classified)}. When there are, we'll show them here.
@@ -1,7 +1,7 @@
1
1
  = render 'layout' do
2
2
  .effective-classified
3
3
  - unless @classified.published?
4
- .alert.alert-warning.mb-4 This posting is not published.
4
+ .alert.alert-warning.mb-4 This #{etd(@classified)} is not published.
5
5
 
6
6
  .row
7
7
  .col-md-4
@@ -12,9 +12,6 @@ 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
-
18
15
  # Pagination length on the Classified#index page
19
16
  config.per_page = :all
20
17
 
@@ -1,10 +1,9 @@
1
1
  en:
2
2
  effective_classifieds:
3
- name: 'Effective Classifieds'
4
- acronym: 'Classifieds'
3
+ name: 'Classifieds'
5
4
 
6
5
  activerecord:
7
6
  models:
8
7
  # These ones might be app level
9
- app/classified_wizard: 'Classified Wizard'
10
- effective/classified: 'Classified'
8
+ app/classified_wizard: 'Classified Posting Submission'
9
+ effective/classified: 'Classified Posting'
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.4.12'.freeze
2
+ VERSION = '0.5.0'.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, :classifieds_label
13
+ :classified_wizard_class_name
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.12
4
+ version: 0.5.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: 2023-04-06 00:00:00.000000000 Z
11
+ date: 2023-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: haml-rails
126
+ name: haml
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: psych
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "<"
186
+ - !ruby/object:Gem::Version
187
+ version: '4'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "<"
193
+ - !ruby/object:Gem::Version
194
+ version: '4'
181
195
  description: Users submit classified ads for job openings and equipment sales
182
196
  email:
183
197
  - info@codeandeffect.com
@@ -263,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
277
  - !ruby/object:Gem::Version
264
278
  version: '0'
265
279
  requirements: []
266
- rubygems_version: 3.1.2
280
+ rubygems_version: 3.3.7
267
281
  signing_key:
268
282
  specification_version: 4
269
283
  summary: Users submit classified ads for job openings and equipment sales