effective_classifieds 0.6.0 → 0.6.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 +4 -4
- data/app/controllers/effective/classifieds_controller.rb +13 -1
- data/app/datatables/admin/effective_classifieds_datatable.rb +4 -3
- data/app/models/effective/classified.rb +1 -0
- data/app/views/effective/classifieds/_classified.html.haml +8 -51
- data/app/views/effective/classifieds/_fields.html.haml +7 -6
- data/app/views/effective/classifieds/index.html.haml +17 -5
- data/app/views/effective/classifieds/show.html.haml +41 -45
- data/config/effective_classifieds.rb +1 -1
- data/db/migrate/101_create_effective_classifieds.rb +1 -0
- data/lib/effective_classifieds/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7064c7d9f3e797ce52d20ca502bbb0d790339c0fb52f74364c0d93eaa8927a4e
|
|
4
|
+
data.tar.gz: 057bae1906a935f14f76b8edd7f5624fb4720c660656c40a79262ff2cb284902
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cda01569456e9e3fe538526ea2503750b2d4c9372c7cd608164dcb077a7290ad94a5a4178f25a4200df0213544a8786aaa6add3714b4307bbdb5d050ef3d17d9
|
|
7
|
+
data.tar.gz: 49c51e24af0654dac4af2c7b81b87b728aa7addf4bc80cadb6f11a6feb1b66835d0125e26472d0dfaffe0656a782fb8866d2460bd85d1ff3fc354c7ab7a78b66
|
|
@@ -2,7 +2,13 @@ module Effective
|
|
|
2
2
|
class ClassifiedsController < ApplicationController
|
|
3
3
|
include Effective::CrudController
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
def index
|
|
6
|
+
EffectiveResources.authorize!(self, :index, ::Effective::Classified)
|
|
7
|
+
|
|
8
|
+
@page_title ||= view_context.classifieds_name_label
|
|
9
|
+
|
|
10
|
+
@classifieds = ::Effective::Classified.classifieds(user: current_user).sorted
|
|
11
|
+
end
|
|
6
12
|
|
|
7
13
|
def show
|
|
8
14
|
@classified = resource_scope.find(params[:id])
|
|
@@ -22,6 +28,12 @@ module Effective
|
|
|
22
28
|
end
|
|
23
29
|
|
|
24
30
|
@page_title ||= @classified.to_s
|
|
31
|
+
|
|
32
|
+
respond_to do |format|
|
|
33
|
+
format.html { }
|
|
34
|
+
format.js { render('show', formats: :js) }
|
|
35
|
+
end
|
|
36
|
+
|
|
25
37
|
end
|
|
26
38
|
|
|
27
39
|
private
|
|
@@ -37,9 +37,10 @@ module Admin
|
|
|
37
37
|
col :organization
|
|
38
38
|
col :location
|
|
39
39
|
|
|
40
|
-
col :website
|
|
41
|
-
col :
|
|
42
|
-
col :
|
|
40
|
+
col :website, visible: false
|
|
41
|
+
col :contact_name, visible: false
|
|
42
|
+
col :email, visible: false
|
|
43
|
+
col :phone, visible: false
|
|
43
44
|
|
|
44
45
|
col :status
|
|
45
46
|
col :archived
|
|
@@ -125,6 +125,7 @@ module Effective
|
|
|
125
125
|
validates :organization, presence: true
|
|
126
126
|
validates :email, presence: true
|
|
127
127
|
validates :phone, presence: true
|
|
128
|
+
validates :contact_name, presence: true
|
|
128
129
|
end
|
|
129
130
|
|
|
130
131
|
validate(if: -> { start_on.present? && end_on.present? && !importing }) do
|
|
@@ -1,51 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
%
|
|
4
|
-
%
|
|
5
|
-
%
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
%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")
|
|
4
|
+
%td
|
|
5
|
+
%strong= link_to classified.title, effective_classifieds.classified_path(classified)
|
|
6
|
+
.text-muted= classified.organization
|
|
7
|
+
|
|
8
|
+
%td.d-none.d-md-table-cell= classified.location
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
= f.select :category, EffectiveClassifieds.categories, required: true
|
|
1
|
+
= f.select :category, EffectiveClassifieds.categories, required: true, include_blank: false
|
|
2
2
|
= f.text_field :title
|
|
3
|
+
= f.text_field :organization, hint: 'Organization or company name'
|
|
3
4
|
= f.text_field :location
|
|
4
5
|
|
|
5
6
|
- if f.object.persisted? || f.object.errors.include?(:slug)
|
|
@@ -22,17 +23,17 @@
|
|
|
22
23
|
= f.check_box :archived, label: 'Yes, this posting is archived. It will not be displayed.'
|
|
23
24
|
|
|
24
25
|
- if defined?(EffectiveArticleEditor)
|
|
25
|
-
= 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 content of your posting. Be sure to include all relevant information.'
|
|
26
27
|
- else
|
|
27
|
-
= 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 content of your posting. Be sure to include all relevant information.'
|
|
28
29
|
|
|
29
|
-
= f.file_field :file, hint: '
|
|
30
|
+
= f.file_field :file, hint: 'Optionally attach a PDF for this posting'
|
|
30
31
|
|
|
31
32
|
%h2.mt-5.mb-0 Contact Information
|
|
32
33
|
%p
|
|
33
|
-
%small.text-muted
|
|
34
|
+
%small.text-muted The following contact information is not displayed to the public and is only used by staff to provide support.
|
|
34
35
|
|
|
35
|
-
= f.text_field :
|
|
36
|
+
= f.text_field :contact_name
|
|
36
37
|
= f.url_field :website
|
|
37
38
|
= f.email_field :email
|
|
38
39
|
= f.tel_field :phone
|
|
@@ -2,8 +2,20 @@
|
|
|
2
2
|
.resource-buttons
|
|
3
3
|
= link_to "Submit New #{et(Effective::Classified)}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
- if @classifieds.present?
|
|
6
|
+
.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
|
|
15
|
+
|
|
16
|
+
.resource-buttons
|
|
17
|
+
= link_to "Submit New #{et(Effective::Classified)}", effective_classifieds.new_classified_wizard_path, class: 'btn btn-primary'
|
|
18
|
+
|
|
19
|
+
- 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.
|
|
@@ -3,48 +3,44 @@
|
|
|
3
3
|
- unless @classified.published?
|
|
4
4
|
.alert.alert-warning.mb-4 This #{etd(@classified)} is not published.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
%
|
|
15
|
-
%
|
|
16
|
-
= @classified.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
= @classified.phone
|
|
48
|
-
|
|
49
|
-
.col-md-8
|
|
50
|
-
= @classified.body.to_s
|
|
6
|
+
|
|
7
|
+
.resource-buttons
|
|
8
|
+
= link_to "Return to #{classifieds_name_label}", effective_classifieds.classifieds_path, class: 'btn btn-secondary'
|
|
9
|
+
|
|
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
|
|
17
|
+
|
|
18
|
+
%tr
|
|
19
|
+
%th Company
|
|
20
|
+
%td= @classified.organization
|
|
21
|
+
|
|
22
|
+
- if @classified.location.present?
|
|
23
|
+
%tr
|
|
24
|
+
%th Location
|
|
25
|
+
%td= @classified.location
|
|
26
|
+
|
|
27
|
+
.col-md
|
|
28
|
+
%table.table.table-striped.table-hover.effective-table-summary
|
|
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')
|
|
41
|
+
|
|
42
|
+
.body.mt-4
|
|
43
|
+
= @classified.body.to_s
|
|
44
|
+
|
|
45
|
+
.resource-buttons.mt-5.mb-4
|
|
46
|
+
= link_to "Return to #{classifieds_name_label}", effective_classifieds.classifieds_path, class: 'btn btn-secondary'
|
|
@@ -10,7 +10,7 @@ EffectiveClassifieds.setup do |config|
|
|
|
10
10
|
# config.classified_wizard_class_name = 'Effective::ClassifiedWizard'
|
|
11
11
|
|
|
12
12
|
# Pagination length on the Classified#index page
|
|
13
|
-
config.per_page =
|
|
13
|
+
config.per_page = 12
|
|
14
14
|
|
|
15
15
|
# Classified can be restricted by role
|
|
16
16
|
config.use_effective_roles = true
|
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.6.
|
|
4
|
+
version: 0.6.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: 2023-
|
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|