phcdevworks_real_estate 5.1.0 → 6.0.0

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 -287
  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 -20
  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 -46
  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: 7edda2a02f070f791cc5e8afb2612f08ac9d9c4f352dd193720ea04cd115cb57
4
- data.tar.gz: 259c5fbfb48c1016e00ff148c3c91213221f0e772517eb494d03cc76628d6256
3
+ metadata.gz: 67b2c8eca1e165ab4e92c88ed45c47b589f79aa77bee532875cf9d8eec0670ab
4
+ data.tar.gz: 6924b4f8cf74083f3f12e0499feb3c8ee2e6307794776d874b27cedc1e749a81
5
5
  SHA512:
6
- metadata.gz: c9f1c1abf0ffd6080c6f9856d12f716f8e5d9556847e2482779a9a23a2f5d04cc28e1b843065fe81160bb9462e34f3cfbc51ac48f53a01f789737405bb2ffa98
7
- data.tar.gz: fe0ee0109d93a93102415137f43e6328114d2c06902c6a2effcbc953595be15e4a59535c203399a3662c5ccb8ec4d6a6d94a1882756d2768e5a27c4678f41150
6
+ metadata.gz: 9ca445b840beba427c8cc0fa0f2a11cb89a1fdd91b6e919980162f020b7c156150af08a5e78c1ce29e26d6ed7b12d9429fd1a64f84293aa97821698d1f89f95c
7
+ data.tar.gz: b838499ec29b5f49993fe82f9b3c2d28ddb76a463a0efc1f680dcdbcb5fc29642af84058d0f42a85b1ad4ebec2114124d5259fd7062688dfbb308a2a40804265
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