effective_classifieds 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fc07e4c951edd63780e49029746786add1983892bc513e9c5e74dec61355fae
4
- data.tar.gz: 985b7ff1866e71415cca8f4d46ca9fcca8dde0073ecc21ecd1293d6eb70ca9e1
3
+ metadata.gz: '09276ebf0a343cc31aaf14e9c5ce96c02da8a9f11de345f292abfc10a0df642b'
4
+ data.tar.gz: 47d861d8fedb6c9d69d02bbe7885da7202419696626c1d5fc3f9dd8329a6c5d8
5
5
  SHA512:
6
- metadata.gz: d9e5eea7dd4e285be7a81026fae9ef9e5376db94f18f713f3aa824f1463bbddb0cedcd1ba34176e735976c9542e80b419858a9a673b327e56ff408a2de7ea7d1
7
- data.tar.gz: b90ca02dc0cb7e60c007d111a0e3c135ca17005fa9220c4f8cf786c1de182f009bf2743779585629d42be457b94c3b228f8634ac2d1e5ae4a2455ec2c955a932
6
+ metadata.gz: d9c4ae1fd02205ae2070eedfa0413cb24b4623e88828bf66ce7cd97a2e7bb6c55e00b62a5f40fd1d26d3bb76b23654c20b094bd135087d494e38f6c8c10ddf64
7
+ data.tar.gz: 8451614768b018a315e00ccf08799e950f0e8f9f70e1dc2d7f7d21045c013ebe97371ac85d35616418e69b9fe18d9de66ba2c5829157fe7c8e070c0d1a4afeae
@@ -22,8 +22,8 @@ module Effective
22
22
  if EffectiveResources.authorized?(self, :admin, :effective_classifieds)
23
23
  flash.now[:warning] = [
24
24
  'Hi Admin!',
25
- ('You are viewing a hidden posting.' unless @classified.published?),
26
- ("<a href='#{effective_classifieds.edit_admin_classified_path(@classified)}' class='alert-link'>Click here to edit settings</a>.")
25
+ ("You are viewing a hidden #{view_context.classified_label.downcase}." unless @classified.published?),
26
+ ("<a href='#{effective_classifieds.edit_admin_classified_path(@classified)}' class='alert-link'>Edit this #{view_context.classified_label.downcase}</a>.")
27
27
  ].compact.join(' ')
28
28
  end
29
29
 
@@ -11,6 +11,7 @@ class Admin::EffectiveClassifiedWizardsDatatable < Effective::Datatable
11
11
 
12
12
  col :classified, search: :string
13
13
  col :owner
14
+ col :user, visible: false
14
15
 
15
16
  col :orders
16
17
 
@@ -5,12 +5,12 @@ module EffectiveClassifiedsHelper
5
5
  et('effective_classifieds.name')
6
6
  end
7
7
 
8
- # Job Board Posting or Classified Posting
8
+ # Job or Classified
9
9
  def classified_label
10
10
  et(Effective::Classified)
11
11
  end
12
12
 
13
- # Job Board Postings or Classified Postings
13
+ # Jobs or Classifieds
14
14
  def classifieds_label
15
15
  ets(Effective::Classified)
16
16
  end
@@ -28,7 +28,7 @@ module EffectiveClassifiedsClassifiedWizard
28
28
 
29
29
  acts_as_wizard(
30
30
  start: 'Start',
31
- classified: 'Posting',
31
+ classified: I18n.t('activerecord.models.effective/classified') + ' Details',
32
32
  summary: 'Review',
33
33
  billing: 'Billing Address',
34
34
  checkout: 'Checkout',
@@ -3,16 +3,21 @@
3
3
  = render 'admin/classifieds/form_classified', classified: classified
4
4
 
5
5
  - if classified.persisted?
6
+ - if classified.classified_wizard.present?
7
+ = tab(et(EffectiveClassifieds.ClassifiedWizard)) do
8
+ = card('Wizard') do
9
+ = render('effective/classified_wizards/summary', classified_wizard: classified.classified_wizard)
6
10
 
7
- = tab 'Access' do
8
- = render '/admin/classifieds/form_access', classified: classified
11
+ = render('effective/classified_wizards/classified_wizard', classified_wizard: classified.classified_wizard)
9
12
 
10
- - if classified.classified_wizard.present?
11
13
  = tab 'Orders' do
12
14
  %h2 Orders
13
15
  - datatable = Admin::EffectiveOrdersDatatable.new(parent: classified.classified_wizard, owner: classified.owner, user: classified.owner, total: false)
14
16
  = render_datatable(datatable, simple: true)
15
17
 
18
+ = tab 'Access' do
19
+ = render '/admin/classifieds/form_access', classified: classified
20
+
16
21
  - if classified.class.respond_to?(:acts_as_trackable?)
17
22
  = tab 'Tracks' do
18
23
  - datatable = Admin::EffectiveTracksDatatable.new(owner: classified)
@@ -26,4 +26,4 @@
26
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 #{classified_label}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
29
+ %p= link_to "Post a #{classified_label}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
@@ -9,7 +9,7 @@
9
9
  - if classified&.published?
10
10
  = link_to(classified, effective_classifieds.classified_path(classified), target: '_blank')
11
11
  - else
12
- = classified.presence || 'Posting was deleted'
12
+ = classified.presence || "#{classified_label} was deleted"
13
13
 
14
14
  - if request.path.start_with?('/admin')
15
15
  %tr
@@ -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 postings require a fee and we ask for a billing address for future use.
13
+ %p.text-muted * Not all #{classified_label} require a fee. We ask for your billing address for future use.
14
14
 
15
15
  = f.save 'Save and Continue'
@@ -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_label}", class: 'btn btn-primary'
8
+ = f.submit "Save and Continue", class: 'btn btn-primary'
@@ -1,8 +1,9 @@
1
1
  %tr
2
- %td.col-date= classified.start_on&.strftime("%b %d, %Y")
3
- %td.col-date.d-none.d-md-table-cell= classified.end_on&.strftime("%b %d, %Y")
2
+ %td.col-date.text-right= classified.start_on&.strftime("%b %e, %Y")
4
3
  %td
5
4
  %strong= link_to classified.title, effective_classifieds.classified_path(classified)
6
5
  .text-muted= classified.organization
6
+ .d-block.d-md-none= classified.location
7
7
 
8
8
  %td.d-none.d-md-table-cell= classified.location
9
+ -# %td.col-date.d-none.d-md-table-cell.text-right= classified.end_on&.strftime("%b %e, %Y")
@@ -1,7 +1,7 @@
1
1
  = f.select :category, EffectiveClassifieds.categories, required: true, include_blank: false
2
- = f.text_field :title
3
- = f.text_field :organization, hint: 'Organization or company name'
4
- = f.text_field :location
2
+ = f.text_field :title, label: "#{classified_label} title"
3
+ = f.text_field :location, label: "#{classified_label} location"
4
+ = f.text_field :organization
5
5
 
6
6
  - if f.object.persisted? || f.object.errors.include?(:slug)
7
7
  - current_url = (effective_classifieds.classified_url(f.object) rescue nil)
@@ -12,26 +12,25 @@
12
12
  .row
13
13
  .col-lg-6
14
14
  - if f.object.new_record?
15
- = f.date_field :start_on, label: "Start", hint: "The posting will be displayed starting after this date.", input_js: { minDate: minDate.strftime('%F') }
15
+ = f.date_field :start_on, label: "Start date", hint: "If approved, this #{classified_label.downcase} will be displayed on the #{classifieds_name_label.downcase} after this date.", input_js: { minDate: minDate.strftime('%F') }
16
16
  - else
17
- = f.date_field :start_on, label: "Start", hint: 'The posting will be displayed starting after this date.'
17
+ = f.date_field :start_on, label: "Start date", hint: "The #{classified_label.downcase} will be displayed starting after this date."
18
18
 
19
19
  .col-lg-6
20
- = f.date_field :end_on, label: "Expire", hint: "The posting will no longer be displayed after this date. Please enter a date within #{f.object.end_on_distance} of start date"
20
+ = f.date_field :end_on, label: "Close date", hint: "The #{classified_label.downcase} will no longer be displayed on the #{classifieds_name_label.downcase} after this date. Please enter a date within #{f.object.end_on_distance} of the start date."
21
21
 
22
- - if f.object.persisted? && !f.object.draft?
23
- = f.check_box :archived, label: 'Yes, this posting is archived. It will not be displayed.'
22
+ -# - if f.object.persisted? && !f.object.draft?
23
+ -# = f.check_box :archived, label: 'Yes, this posting is archived. It will not be displayed.'
24
24
 
25
25
  - if defined?(EffectiveArticleEditor)
26
- = f.article_editor :body, label: 'Description', hint: 'The content of your posting. Be sure to include all relevant information.'
26
+ = f.article_editor :body, label: 'Description', hint: "The #{classified_label.downcase} description - be sure to include all relevant information!"
27
27
  - else
28
- = f.rich_text_area :body, label: 'Description', hint: 'The content of your posting. Be sure to include all relevant information.'
28
+ = f.rich_text_area :body, label: 'Description', hint: "The #{classified_label.downcase} description. Be sure to include all relevant information."
29
29
 
30
- = f.file_field :file, hint: 'Optionally attach a PDF for this posting'
30
+ = f.file_field :file, label: "Attach a PDF for download. Optional."
31
31
 
32
- %h2.mt-5.mb-0 Contact Information
33
- %p
34
- %small.text-muted The following contact information is not displayed to the public and is only used by staff to provide support.
32
+ %h3.mt-5 Contact Information
33
+ %p.text-muted These details <strong>are not</strong> displayed on the #{classifieds_name_label}. They may be used by staff for administration and support. Please ensure the above #{classified_label.downcase} description includes relavent contact information.
35
34
 
36
35
  = f.text_field :contact_name
37
36
  = f.url_field :website
@@ -1,2 +1,2 @@
1
- .effective-classifieds
1
+ .effective-classifieds.mb-3
2
2
  = yield
@@ -1,21 +1,24 @@
1
1
  = render 'layout' do
2
- .resource-buttons
3
- = link_to "Submit New #{et(Effective::Classified)}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
2
+ .row
3
+ .col
4
+ %h1.effective-title.mb-4= @page_title
5
+
6
+ .col-auto.text-right
7
+ = link_to "Post a #{classified_label}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
4
8
 
5
9
  - if @classifieds.present?
6
10
  .table-responsive
7
- %table.table.table-striped.table-hover
8
- %tr
9
- %th.col-date Published
10
- %th.col-date.d-none.d-md-table-cell Closing
11
- %th Title
12
- %th.d-none.d-md-table-cell Location
13
-
14
- = render @classifieds
11
+ %table.table.table-striped
12
+ %thead
13
+ %tr
14
+ %th.col-date.text-right Posted
15
+ %th Title
16
+ %th.d-none.d-md-table-cell Location
17
+ -# %th.col-date.d-none.d-md-table-cell.text-right Closing
15
18
 
16
- .resource-buttons
17
- = link_to "Submit New #{et(Effective::Classified)}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
19
+ %tbody
20
+ = render @classifieds
18
21
 
19
22
  - else
20
- = card class: 'mt-5' do
21
- %p.text-center There are no active #{etsd(Effective::Classified)}. When there are, we'll show them here.
23
+ .alert.alert-warning.mb-3
24
+ There are no active #{classifieds_label.downcase}.
@@ -1,46 +1,36 @@
1
1
  = render 'layout' do
2
2
  .effective-classified
3
3
  - unless @classified.published?
4
- .alert.alert-warning.mb-4 This #{etd(@classified)} is not published.
4
+ .alert.alert-warning.mb-4 This #{classified_label} is not published.
5
5
 
6
+ %h1.effective-title.mb-4= @page_title
6
7
 
7
- .resource-buttons
8
- = link_to "Return to #{classifieds_name_label}", effective_classifieds.classifieds_path, class: 'btn btn-secondary'
8
+ .row
9
+ .col-md
10
+ %table.table.table-striped.effective-table-summary
11
+ %tr
12
+ %th Company
13
+ %td= @classified.organization
9
14
 
10
- = card do
11
- .row
12
- .col-md
13
- %table.table.table-striped.table-hover.effective-table-summary
14
- %tr
15
- %th Position
16
- %td= @classified.title
15
+ - if @classified.location.present?
16
+ %tr
17
+ %th Location
18
+ %td= @classified.location
17
19
 
18
- %tr
19
- %th Company
20
- %td= @classified.organization
20
+ %tr
21
+ %th Posted
22
+ %td #{@classified.start_on&.strftime("%b %d, %Y")}
21
23
 
22
- - if @classified.location.present?
23
- %tr
24
- %th Location
25
- %td= @classified.location
24
+ %tr
25
+ %th Closing
26
+ %td #{@classified.end_on&.strftime("%b %d, %Y")}
26
27
 
27
- .col-md
28
- %table.table.table-striped.table-hover.effective-table-summary
28
+ - if @classified.file.attached?
29
29
  %tr
30
- %th Published
31
- %td #{@classified.start_on&.strftime("%b %d, %Y")}
32
-
33
- %tr
34
- %th Closing
35
- %td #{@classified.end_on&.strftime("%b %d, %Y")}
36
-
37
- - if @classified.file.attached?
38
- %tr
39
- %th Attachment
40
- %td= link_to(@classified.file.filename, main_app.url_for(@classified.file), target: '_blank')
30
+ %th Attachment
31
+ %td= link_to(@classified.file.filename, main_app.url_for(@classified.file), target: '_blank')
41
32
 
42
33
  .body.mt-4
43
34
  = @classified.body.to_s
44
35
 
45
- .resource-buttons.mt-5.mb-4
46
- = link_to "Return to #{classifieds_name_label}", effective_classifieds.classifieds_path, class: 'btn btn-secondary'
36
+ = link_to "&larr; #{classifieds_name_label}".html_safe, effective_classifieds.classifieds_path, class: 'btn btn-secondary my-4'
@@ -1,20 +1,20 @@
1
1
  %p Hello Admin!
2
2
 
3
3
  - if @classified.published?
4
- %p The following posting has been submitted and is published online:
4
+ %p The following has been submitted and is published online:
5
5
  - else
6
- %p The following posting has been submitted and is awaiting your approval:
6
+ %p The following has been submitted and is awaiting your approval:
7
7
 
8
8
  %hr
9
9
 
10
10
  = render('effective/classifieds/classified', classified: @classified) do
11
- %p= @classified.body
11
+ %div= @classified.body
12
12
 
13
13
  %hr
14
14
 
15
15
  - unless @classified.approved?
16
- %p= link_to('Approve Posting', effective_classifieds.edit_admin_classified_path(@classified))
16
+ %p= link_to("Approve", effective_classifieds.edit_admin_classified_path(@classified))
17
17
 
18
- %p= link_to('View Posting', effective_classifieds.classified_path(@classified))
18
+ %p= link_to("View", effective_classifieds.classified_path(@classified))
19
19
 
20
20
  %p Have a great day!
@@ -5,5 +5,5 @@ en:
5
5
  activerecord:
6
6
  models:
7
7
  # These ones might be app level
8
- app/classified_wizard: 'Classified Posting Submission'
9
- effective/classified: 'Classified Posting'
8
+ app/classified_wizard: 'Classified Submission'
9
+ effective/classified: 'Classified'
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.8.2'.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.8.0
4
+ version: 0.8.2
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: 2024-07-17 00:00:00.000000000 Z
11
+ date: 2024-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails