phcdevworks_real_estate 5.1.1 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +1 -0
  4. data/app/assets/config/phcdevworks_real_estate_manifest.js +2 -3
  5. data/app/controllers/phcdevworks_real_estate/application_controller.rb +13 -13
  6. data/app/controllers/phcdevworks_real_estate/property/features_controller.rb +82 -82
  7. data/app/controllers/phcdevworks_real_estate/property/listings_controller.rb +82 -82
  8. data/app/helpers/phcdevworks_real_estate/application_helper.rb +4 -4
  9. data/app/helpers/phcdevworks_real_estate/property/features_helper.rb +4 -4
  10. data/app/helpers/phcdevworks_real_estate/property/listings_helper.rb +4 -4
  11. data/app/jobs/phcdevworks_real_estate/application_job.rb +4 -4
  12. data/app/mailers/phcdevworks_real_estate/application_mailer.rb +6 -6
  13. data/app/models/phcdevworks_real_estate/application_record.rb +5 -5
  14. data/app/models/phcdevworks_real_estate/property/feature.rb +22 -22
  15. data/app/models/phcdevworks_real_estate/property/listing.rb +35 -35
  16. data/app/models/phcdevworks_real_estate/property.rb +7 -7
  17. data/app/views/layouts/phcdevworks_real_estate/application.html.erb +58 -51
  18. data/app/views/layouts/phcdevworks_real_estate/components/backend/footer/_footer.html.erb +10 -9
  19. data/app/views/layouts/phcdevworks_real_estate/components/backend/navigation/_top_menu.html.erb +26 -25
  20. data/app/views/layouts/phcdevworks_real_estate/components/backend/sidebars/_side_menu.html.erb +491 -349
  21. data/app/views/phcdevworks_real_estate/property/features/_form.html.erb +22 -22
  22. data/app/views/phcdevworks_real_estate/property/features/edit.html.erb +41 -49
  23. data/app/views/phcdevworks_real_estate/property/features/index.html.erb +74 -82
  24. data/app/views/phcdevworks_real_estate/property/features/new.html.erb +41 -49
  25. data/app/views/phcdevworks_real_estate/property/features/show.html.erb +64 -64
  26. data/app/views/phcdevworks_real_estate/property/listings/_form.html.erb +113 -113
  27. data/app/views/phcdevworks_real_estate/property/listings/edit.html.erb +41 -49
  28. data/app/views/phcdevworks_real_estate/property/listings/index.html.erb +82 -90
  29. data/app/views/phcdevworks_real_estate/property/listings/new.html.erb +41 -49
  30. data/app/views/phcdevworks_real_estate/property/listings/show.html.erb +50 -50
  31. data/config/routes.rb +15 -19
  32. data/config/spring.rb +1 -1
  33. data/db/migrate/20190824010811_create_phcdevworks_real_estate_property_listings.rb +36 -36
  34. data/db/migrate/20190824011000_create_phcdevworks_real_estate_property_features.rb +17 -17
  35. data/db/migrate/20191024232111_create_phcdevworks_real_estate_property_features_listings.rb +10 -10
  36. data/lib/phcdevworks_real_estate/engine.rb +45 -45
  37. data/lib/phcdevworks_real_estate/version.rb +3 -3
  38. metadata +36 -82
  39. data/app/assets/stylesheets/phcdevworks_real_estate/application.scss +0 -0
  40. data/app/assets/stylesheets/phcdevworks_real_estate/property/features.scss +0 -0
  41. data/app/assets/stylesheets/phcdevworks_real_estate/property/listings.scss +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfdedd389553afe6cb3b2cb2125bb0cef964cba45fa3d5d2906c54320cd79f00
4
- data.tar.gz: 761ee24428d3f13533c8e3634089c204be8582f70bb4fe2df8682464848b8fda
3
+ metadata.gz: 640add2b3af65379d138ceb37dbb00bc9ff21ba77548bfd9ce9f2f8fe8b2394c
4
+ data.tar.gz: 2166e9c8ddc402aa7f0e5ee0e1f5ff00f62867323dd204644ff8619c6235d467
5
5
  SHA512:
6
- metadata.gz: 3c18634e14f7c93020b69a4533d6e695223532ddd704b382754cc009acab975a0d33de9b73084aebd73a7ec7f83e6c297cf7ff713ee61fd9826dd2c193192cf1
7
- data.tar.gz: 1dd9731623792e7dc54ce85b6c3cc06b0a0825d5aad93ba7798d828c6e89d3f7e6aef06809f049ab72f4fdc6539f267a1652d12fdf5f6bf11f0c3297b8d5dbfe
6
+ metadata.gz: 4dc3006eb76e9368ef82cb9978bb8cd72b970cd653d5ce58ab5662692533f47591392c7660cac220f4e912a4fda2ff855b770fd7bc4610cb798e2f14df3a2c20
7
+ data.tar.gz: 80e2d95b2a3e6731729904772048cd19324cf1f56e8db034406d2f2ccd1248e630f21988846d5b81f4bf450ee716117babdb9a0f362aff9d24891ff4defe2e17
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2020 BradPotts
1
+ Copyright 2022 PHCDevworks
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
data/README.md CHANGED
@@ -0,0 +1 @@
1
+ [![Gem Version](https://badge.fury.io/rb/phcdevworks_real_estate.svg)](https://badge.fury.io/rb/phcdevworks_real_estate)
@@ -1,3 +1,2 @@
1
- //= link_directory ../stylesheets/phcdevworks_real_estate .scss
2
- //= link phcthemes_admin_panel_pack_coloradmin.css
3
- //= link phcthemes_admin_panel_pack_coloradmin.js
1
+ //= link coloradmin/default/phcthemes_admin_panel_pack_coloradmin.css
2
+ //= link coloradmin/phcthemes_admin_panel_pack_coloradmin.js
@@ -1,13 +1,13 @@
1
- module PhcdevworksRealEstate
2
- class ApplicationController < ActionController::Base
3
-
4
- # Security Filters
5
- protect_from_forgery with: :exception
6
-
7
- # Load Requried Helper Files
8
- helper PhcdevworksActiveMenus::Engine.helpers
9
- helper PhcdevworksNotifications::Engine.helpers
10
- helper PhcdevworksTitleseo::Engine.helpers
11
-
12
- end
13
- end
1
+ module PhcdevworksRealEstate
2
+ class ApplicationController < ActionController::Base
3
+
4
+ # Security Filters
5
+ protect_from_forgery with: :exception
6
+
7
+ # Load Requried Helper Files
8
+ helper PhcdevworksActiveMenus::Engine.helpers
9
+ helper PhcdevworksNotifications::Engine.helpers
10
+ helper PhcdevworksTitleseo::Engine.helpers
11
+
12
+ end
13
+ end
@@ -1,82 +1,82 @@
1
- require_dependency "phcdevworks_real_estate/application_controller"
2
-
3
- module PhcdevworksRealEstate
4
- class Property::FeaturesController < ApplicationController
5
-
6
- # Filters & Security
7
- #include PhcdevworksCore::PhcpluginsHelper
8
- before_action :authenticate_user!
9
- before_action :set_paper_trail_whodunnit
10
- before_action :set_property_feature, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /property/features
13
- def index
14
- @property_features = Property::Feature.all
15
- end
16
-
17
- # GET /property/features/1
18
- def show
19
- @property_feature = Property::Feature.friendly.find(params[:id])
20
- end
21
-
22
- # GET /property/features/new
23
- def new
24
- @property_feature = Property::Feature.new
25
- end
26
-
27
- # GET /property/features/1/edit
28
- def edit
29
- end
30
-
31
- # POST /property/features
32
- def create
33
- @property_feature = Property::Feature.new(property_feature_params)
34
- @property_feature.user_id = current_user.id
35
- @property_feature.org_id = current_user.org_id
36
- respond_to do |format|
37
- if @property_feature.save
38
- format.html { redirect_to property_features_path, :flash => { :success => 'Property Feature has been Added.' }}
39
- format.json { render :show, status: :created, location: @property_feature }
40
- else
41
- format.html { render :new }
42
- format.json { render json: @property_feature.errors, status: :unprocessable_entity }
43
- end
44
- end
45
- end
46
-
47
- # PATCH/PUT /property/features/1
48
- def update
49
- respond_to do |format|
50
- if @property_feature.update(property_feature_params)
51
- format.html { redirect_to property_features_path, :flash => { :notice => 'Property Feature has been Updated.' }}
52
- format.json { render :show, status: :ok, location: @property_feature }
53
- else
54
- format.html { render :edit }
55
- format.json { render json: @property_feature.errors, status: :unprocessable_entity }
56
- end
57
- end
58
- end
59
-
60
- # DELETE /property/features/1
61
- def destroy
62
- @property_feature.destroy
63
- respond_to do |format|
64
- format.html { redirect_to property_features_path, :flash => { :error => 'Property Feature has been Removed.' }}
65
- format.json { head :no_content }
66
- end
67
- end
68
-
69
- private
70
-
71
- # Callbacks
72
- def set_property_feature
73
- @property_feature = Property::Feature.friendly.find(params[:id])
74
- end
75
-
76
- # Whitelist
77
- def property_feature_params
78
- params.require(:property_feature).permit(:property_feature_name)
79
- end
80
-
81
- end
82
- end
1
+ require_dependency "phcdevworks_real_estate/application_controller"
2
+
3
+ module PhcdevworksRealEstate
4
+ class Property::FeaturesController < ApplicationController
5
+
6
+ # Filters & Security
7
+ #include PhcdevworksCore::PhcpluginsHelper
8
+ before_action :authenticate_user!
9
+ before_action :set_paper_trail_whodunnit
10
+ before_action :set_property_feature, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /property/features
13
+ def index
14
+ @property_features = Property::Feature.all
15
+ end
16
+
17
+ # GET /property/features/1
18
+ def show
19
+ @property_feature = Property::Feature.friendly.find(params[:id])
20
+ end
21
+
22
+ # GET /property/features/new
23
+ def new
24
+ @property_feature = Property::Feature.new
25
+ end
26
+
27
+ # GET /property/features/1/edit
28
+ def edit
29
+ end
30
+
31
+ # POST /property/features
32
+ def create
33
+ @property_feature = Property::Feature.new(property_feature_params)
34
+ @property_feature.user_id = current_user.id
35
+ @property_feature.org_id = current_user.org_id
36
+ respond_to do |format|
37
+ if @property_feature.save
38
+ format.html { redirect_to property_features_path, :flash => { :success => 'Property Feature has been Added.' }}
39
+ format.json { render :show, status: :created, location: @property_feature }
40
+ else
41
+ format.html { render :new }
42
+ format.json { render json: @property_feature.errors, status: :unprocessable_entity }
43
+ end
44
+ end
45
+ end
46
+
47
+ # PATCH/PUT /property/features/1
48
+ def update
49
+ respond_to do |format|
50
+ if @property_feature.update(property_feature_params)
51
+ format.html { redirect_to property_features_path, :flash => { :notice => 'Property Feature has been Updated.' }}
52
+ format.json { render :show, status: :ok, location: @property_feature }
53
+ else
54
+ format.html { render :edit }
55
+ format.json { render json: @property_feature.errors, status: :unprocessable_entity }
56
+ end
57
+ end
58
+ end
59
+
60
+ # DELETE /property/features/1
61
+ def destroy
62
+ @property_feature.destroy
63
+ respond_to do |format|
64
+ format.html { redirect_to property_features_path, :flash => { :error => 'Property Feature has been Removed.' }}
65
+ format.json { head :no_content }
66
+ end
67
+ end
68
+
69
+ private
70
+
71
+ # Callbacks
72
+ def set_property_feature
73
+ @property_feature = Property::Feature.friendly.find(params[:id])
74
+ end
75
+
76
+ # Whitelist
77
+ def property_feature_params
78
+ params.require(:property_feature).permit(:property_feature_name)
79
+ end
80
+
81
+ end
82
+ end
@@ -1,82 +1,82 @@
1
- require_dependency "phcdevworks_real_estate/application_controller"
2
-
3
- module PhcdevworksRealEstate
4
- class Property::ListingsController < ApplicationController
5
-
6
- # Filters & Security
7
- #include PhcdevworksCore::PhcpluginsHelper
8
- before_action :authenticate_user!
9
- before_action :set_paper_trail_whodunnit
10
- before_action :set_property_listing, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /property/listings
13
- def index
14
- @property_listings = Property::Listing.all
15
- end
16
-
17
- # GET /property/listings/1
18
- def show
19
- @property_listing = Property::Listing.friendly.find(params[:id])
20
- end
21
-
22
- # GET /property/listings/new
23
- def new
24
- @property_listing = Property::Listing.new
25
- end
26
-
27
- # GET /property/listings/1/edit
28
- def edit
29
- end
30
-
31
- # POST /property/listings
32
- def create
33
- @property_listing = Property::Listing.new(property_listing_params)
34
- @property_listing.user_id = current_user.id
35
- @property_listing.org_id = current_user.org_id
36
- respond_to do |format|
37
- if @property_listing.save
38
- format.html { redirect_to property_listings_path, :flash => { :success => 'Property Listing has been Added.' }}
39
- format.json { render :show, status: :created, location: @property_listing }
40
- else
41
- format.html { render :new }
42
- format.json { render json: @property_listing.errors, status: :unprocessable_entity }
43
- end
44
- end
45
- end
46
-
47
- # PATCH/PUT /property/listings/1
48
- def update
49
- respond_to do |format|
50
- if @property_listing.update(property_listing_params)
51
- format.html { redirect_to property_listings_path, :flash => { :notice => 'Property Listing has been Updated.' }}
52
- format.json { render :show, status: :ok, location: @property_listing }
53
- else
54
- format.html { render :edit }
55
- format.json { render json: @property_listing.errors, status: :unprocessable_entity }
56
- end
57
- end
58
- end
59
-
60
- # DELETE /property/listings/1
61
- def destroy
62
- @property_listing.destroy
63
- respond_to do |format|
64
- format.html { redirect_to property_listings_path, :flash => { :error => 'Property Listing has been Removed.' }}
65
- format.json { head :no_content }
66
- end
67
- end
68
-
69
- private
70
-
71
- # Callbacks
72
- def set_property_listing
73
- @property_listing = Property::Listing.friendly.find(params[:id])
74
- end
75
-
76
- # Whitelist
77
- def property_listing_params
78
- params.require(:property_listing).permit(:property_listing_title, :property_listing_description, :property_listing_street_address, :property_listing_price, :property_listing_area, :property_listing_property_area, :property_listing_garage_area, :property_listing_room, :property_listing_bed, :property_listing_bath, :property_listing_garage, :property_listing_type, :property_listing_status, :property_listing_year_built, :property_listing_energy_class, :property_listing_leed_rating, :optimization_id, :slug, :user_id, :org_id, gallery_upload: [], feature_ids: [])
79
- end
80
-
81
- end
82
- end
1
+ require_dependency "phcdevworks_real_estate/application_controller"
2
+
3
+ module PhcdevworksRealEstate
4
+ class Property::ListingsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ #include PhcdevworksCore::PhcpluginsHelper
8
+ before_action :authenticate_user!
9
+ before_action :set_paper_trail_whodunnit
10
+ before_action :set_property_listing, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /property/listings
13
+ def index
14
+ @property_listings = Property::Listing.all
15
+ end
16
+
17
+ # GET /property/listings/1
18
+ def show
19
+ @property_listing = Property::Listing.friendly.find(params[:id])
20
+ end
21
+
22
+ # GET /property/listings/new
23
+ def new
24
+ @property_listing = Property::Listing.new
25
+ end
26
+
27
+ # GET /property/listings/1/edit
28
+ def edit
29
+ end
30
+
31
+ # POST /property/listings
32
+ def create
33
+ @property_listing = Property::Listing.new(property_listing_params)
34
+ @property_listing.user_id = current_user.id
35
+ @property_listing.org_id = current_user.org_id
36
+ respond_to do |format|
37
+ if @property_listing.save
38
+ format.html { redirect_to property_listings_path, :flash => { :success => 'Property Listing has been Added.' }}
39
+ format.json { render :show, status: :created, location: @property_listing }
40
+ else
41
+ format.html { render :new }
42
+ format.json { render json: @property_listing.errors, status: :unprocessable_entity }
43
+ end
44
+ end
45
+ end
46
+
47
+ # PATCH/PUT /property/listings/1
48
+ def update
49
+ respond_to do |format|
50
+ if @property_listing.update(property_listing_params)
51
+ format.html { redirect_to property_listings_path, :flash => { :notice => 'Property Listing has been Updated.' }}
52
+ format.json { render :show, status: :ok, location: @property_listing }
53
+ else
54
+ format.html { render :edit }
55
+ format.json { render json: @property_listing.errors, status: :unprocessable_entity }
56
+ end
57
+ end
58
+ end
59
+
60
+ # DELETE /property/listings/1
61
+ def destroy
62
+ @property_listing.destroy
63
+ respond_to do |format|
64
+ format.html { redirect_to property_listings_path, :flash => { :error => 'Property Listing has been Removed.' }}
65
+ format.json { head :no_content }
66
+ end
67
+ end
68
+
69
+ private
70
+
71
+ # Callbacks
72
+ def set_property_listing
73
+ @property_listing = Property::Listing.friendly.find(params[:id])
74
+ end
75
+
76
+ # Whitelist
77
+ def property_listing_params
78
+ params.require(:property_listing).permit(:property_listing_title, :property_listing_description, :property_listing_street_address, :property_listing_price, :property_listing_area, :property_listing_property_area, :property_listing_garage_area, :property_listing_room, :property_listing_bed, :property_listing_bath, :property_listing_garage, :property_listing_type, :property_listing_status, :property_listing_year_built, :property_listing_energy_class, :property_listing_leed_rating, :optimization_id, :slug, :user_id, :org_id, gallery_upload: [], feature_ids: [])
79
+ end
80
+
81
+ end
82
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksRealEstate
2
- module ApplicationHelper
3
- end
4
- end
1
+ module PhcdevworksRealEstate
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksRealEstate
2
- module Property::FeaturesHelper
3
- end
4
- end
1
+ module PhcdevworksRealEstate
2
+ module Property::FeaturesHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksRealEstate
2
- module Property::ListingsHelper
3
- end
4
- end
1
+ module PhcdevworksRealEstate
2
+ module Property::ListingsHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksRealEstate
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end
1
+ module PhcdevworksRealEstate
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -1,6 +1,6 @@
1
- module PhcdevworksRealEstate
2
- class ApplicationMailer < ActionMailer::Base
3
- default from: 'from@example.com'
4
- layout 'mailer'
5
- end
6
- end
1
+ module PhcdevworksRealEstate
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
- module PhcdevworksRealEstate
2
- class ApplicationRecord < ActiveRecord::Base
3
- self.abstract_class = true
4
- end
5
- end
1
+ module PhcdevworksRealEstate
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -1,22 +1,22 @@
1
- module PhcdevworksRealEstate
2
- class Property::Feature < ApplicationRecord
3
-
4
- # Clean URL Initialize
5
- extend FriendlyId
6
-
7
- # Relationships
8
- has_and_belongs_to_many :listings, class_name: 'Phcreallistingspro::Property::Listing', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
9
-
10
- # Validation for Form Fields
11
- validates :property_feature_name,
12
- presence: true
13
-
14
- # Clean URL Define
15
- friendly_id :property_feature_nice_urls, use: [:slugged, :finders]
16
-
17
- def property_feature_nice_urls
18
- [:property_feature_name]
19
- end
20
-
21
- end
22
- end
1
+ module PhcdevworksRealEstate
2
+ class Property::Feature < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Relationships
8
+ has_and_belongs_to_many :listings, class_name: 'Phcreallistingspro::Property::Listing', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
9
+
10
+ # Validation for Form Fields
11
+ validates :property_feature_name,
12
+ presence: true
13
+
14
+ # Clean URL Define
15
+ friendly_id :property_feature_nice_urls, use: [:slugged, :finders]
16
+
17
+ def property_feature_nice_urls
18
+ [:property_feature_name]
19
+ end
20
+
21
+ end
22
+ end
@@ -1,35 +1,35 @@
1
- module PhcdevworksRealEstate
2
- class Property::Listing < ApplicationRecord
3
-
4
- # Clean URL Initialize
5
- extend FriendlyId
6
-
7
- # Image Uploading
8
- has_one_attached :listing_upload
9
- has_many_attached :gallery_upload
10
-
11
- # Relationships
12
- has_and_belongs_to_many :features, class_name: 'Phcreallistingspro::Property::Feature', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
13
-
14
- # Validation for Form Fields
15
- validates :property_listing_title,
16
- presence: true
17
-
18
- validates :property_listing_description,
19
- presence: true
20
-
21
- validates :property_listing_street_address,
22
- presence: true
23
-
24
- validates :property_listing_price,
25
- presence: true
26
-
27
- # Clean URL Define
28
- friendly_id :property_listing_nice_urls, use: [:slugged, :finders]
29
-
30
- def property_listing_nice_urls
31
- [:property_listing_title]
32
- end
33
-
34
- end
35
- end
1
+ module PhcdevworksRealEstate
2
+ class Property::Listing < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Image Uploading
8
+ has_one_attached :listing_upload
9
+ has_many_attached :gallery_upload
10
+
11
+ # Relationships
12
+ has_and_belongs_to_many :features, class_name: 'Phcreallistingspro::Property::Feature', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
13
+
14
+ # Validation for Form Fields
15
+ validates :property_listing_title,
16
+ presence: true
17
+
18
+ validates :property_listing_description,
19
+ presence: true
20
+
21
+ validates :property_listing_street_address,
22
+ presence: true
23
+
24
+ validates :property_listing_price,
25
+ presence: true
26
+
27
+ # Clean URL Define
28
+ friendly_id :property_listing_nice_urls, use: [:slugged, :finders]
29
+
30
+ def property_listing_nice_urls
31
+ [:property_listing_title]
32
+ end
33
+
34
+ end
35
+ end
@@ -1,7 +1,7 @@
1
- module PhcdevworksRealEstate
2
- module Property
3
- def self.table_name_prefix
4
- 'phcdevworks_real_estate_property_'
5
- end
6
- end
7
- end
1
+ module PhcdevworksRealEstate
2
+ module Property
3
+ def self.table_name_prefix
4
+ 'phcdevworks_real_estate_property_'
5
+ end
6
+ end
7
+ end