phcdevworks_core_modules 7.2.1 → 8.0.0

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +3 -0
  4. data/app/assets/config/phcdevworks_core_modules_manifest.js +2 -3
  5. data/app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb +81 -81
  6. data/app/controllers/phcdevworks_core_modules/application_controller.rb +13 -13
  7. data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +81 -81
  8. data/app/controllers/phcdevworks_core_modules/post/categories_controller.rb +81 -81
  9. data/app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb +4 -4
  10. data/app/helpers/phcdevworks_core_modules/application_helper.rb +4 -4
  11. data/app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb +4 -4
  12. data/app/helpers/phcdevworks_core_modules/post/categories_helper.rb +4 -4
  13. data/app/jobs/phcdevworks_core_modules/application_job.rb +4 -4
  14. data/app/mailers/phcdevworks_core_modules/application_mailer.rb +6 -6
  15. data/app/models/phcdevworks_core_modules/affiliate/link.rb +35 -35
  16. data/app/models/phcdevworks_core_modules/affiliate.rb +7 -7
  17. data/app/models/phcdevworks_core_modules/application_record.rb +5 -5
  18. data/app/models/phcdevworks_core_modules/marketing/optimization.rb +54 -54
  19. data/app/models/phcdevworks_core_modules/marketing.rb +7 -7
  20. data/app/models/phcdevworks_core_modules/modules.rb +7 -7
  21. data/app/models/phcdevworks_core_modules/post/category.rb +43 -43
  22. data/app/models/phcdevworks_core_modules/post.rb +7 -7
  23. data/app/views/layouts/phcdevworks_core_modules/application.html.erb +34 -92
  24. data/app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb +10 -9
  25. data/app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb +26 -25
  26. data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +491 -349
  27. data/app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb +37 -27
  28. data/app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb +39 -47
  29. data/app/views/phcdevworks_core_modules/affiliate/links/index.html.erb +78 -86
  30. data/app/views/phcdevworks_core_modules/affiliate/links/new.html.erb +39 -47
  31. data/app/views/phcdevworks_core_modules/affiliate/links/show.html.erb +24 -24
  32. data/app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb +87 -89
  33. data/app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb +39 -47
  34. data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +80 -88
  35. data/app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb +39 -47
  36. data/app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb +54 -54
  37. data/app/views/phcdevworks_core_modules/post/categories/_form.html.erb +22 -22
  38. data/app/views/phcdevworks_core_modules/post/categories/edit.html.erb +39 -47
  39. data/app/views/phcdevworks_core_modules/post/categories/index.html.erb +72 -80
  40. data/app/views/phcdevworks_core_modules/post/categories/new.html.erb +39 -47
  41. data/app/views/phcdevworks_core_modules/post/categories/show.html.erb +9 -9
  42. data/config/routes.rb +18 -20
  43. data/db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb +1 -1
  44. data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +26 -26
  45. data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb +18 -18
  46. data/db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb +17 -17
  47. data/db/migrate/20201012225709_remove_phcdevworks_core_modules_post_categories.rb +7 -7
  48. data/db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb +18 -18
  49. data/db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb +18 -18
  50. data/lib/phcdevworks_core_modules/engine.rb +3 -45
  51. data/lib/phcdevworks_core_modules/version.rb +1 -1
  52. metadata +32 -82
  53. data/app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee +0 -3
  54. data/app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss +0 -3
  55. data/app/assets/stylesheets/phcdevworks_core_modules/application.scss +0 -0
  56. data/app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss +0 -3
  57. data/app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss +0 -3
  58. data/app/assets/stylesheets/scaffolds.scss +0 -65
  59. data/config/spring.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79308c277f2cf2443d802ab4d7a0575ccd6d31ea7d2151d935c3b07733c80d5f
4
- data.tar.gz: 30485fb3521ad77fb56f8afef31dd4319b2dc2d56e5738e54bdf059e00624be9
3
+ metadata.gz: 1abaaf09364c9b970891167db12e37a45332f761d33ea4da4eb100edc049f7f8
4
+ data.tar.gz: 1b9d89ca525bc92352f5133ebca90f9ec0c92428e04709fb14b24ce177d15528
5
5
  SHA512:
6
- metadata.gz: 9fd9ae0ec8b1542c8b3397d6da6c461688217f7484a75d0572d37ffc86578048751d714b8bc7956bb2388ec4f7b78990800597c9a5d56944680a37c72f6fa4f1
7
- data.tar.gz: 84b19a40af48981459e1c1b51e00ba01dd052b904e9c205a2372e29cc3975cc40001df2ab414a7cd4f5d3990f986efe22fb3ef626610fc2918ce2da105a52517
6
+ metadata.gz: 1a5a28a88f62b36084063492c8b4f05b82f747c61edb509afdeebc2ba38a9011024bb4a77d2f4cf4839f1af3c05c8cf6d2cf5309eb9d48d94b08c65ac7d9fa73
7
+ data.tar.gz: 121d1a5f187101b72a288eb8c07abdf5c6e0bd7206f7daa19dbc8aba9df2416290b4348584f3f4055381eed7918004220534ef08a6b64e00fad1f30930e34b6c
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,3 @@
1
+ ### Status
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/phcdevworks_core_modules.svg)](https://badge.fury.io/rb/phcdevworks_core_modules) [![Publish to Github.com](https://github.com/phcdevworks/phcdevworks_core_modules/actions/workflows/publish_gem_github_com.yml/badge.svg)](https://github.com/phcdevworks/phcdevworks_core_modules/actions/workflows/publish_gem_github_com.yml) [![Publish to Rubygems.org](https://github.com/phcdevworks/phcdevworks_core_modules/actions/workflows/publish_gem_rubygems_org.yml/badge.svg)](https://github.com/phcdevworks/phcdevworks_core_modules/actions/workflows/publish_gem_rubygems_org.yml)
@@ -1,3 +1,2 @@
1
- //= link_directory ../stylesheets/phcdevworks_core_modules .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,81 +1,81 @@
1
- require_dependency "phcdevworks_core_modules/application_controller"
2
-
3
- module PhcdevworksCoreModules
4
- class Affiliate::LinksController < 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_affiliate_link, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /affiliate/links
13
- def index
14
- @affiliate_links = Affiliate::Link.order('affiliate_link_name ASC')
15
- end
16
-
17
- # GET /affiliate/links/1
18
- def show
19
- end
20
-
21
- # GET /affiliate/links/new
22
- def new
23
- @affiliate_link = Affiliate::Link.new
24
- end
25
-
26
- # GET /affiliate/links/1/edit
27
- def edit
28
- end
29
-
30
- # POST /affiliate/links
31
- def create
32
- @affiliate_link = Affiliate::Link.new(affiliate_link_params)
33
- @affiliate_link.user_id = current_user.id
34
- @affiliate_link.org_id = current_user.org_id
35
- respond_to do |format|
36
- if @affiliate_link.save
37
- format.html { redirect_to affiliate_links_path, :flash => { :success => 'Affilate Link has been Added.' }}
38
- format.json { render :show, status: :created, location: @affiliate_link }
39
- else
40
- format.html { render :new }
41
- format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }
42
- end
43
- end
44
- end
45
-
46
- # PATCH/PUT /affiliate/links/1
47
- def update
48
- respond_to do |format|
49
- if @affiliate_link.update(affiliate_link_params)
50
- format.html { redirect_to affiliate_links_path, :flash => { :notice => 'Affiliate Link has been Updated.' }}
51
- format.json { render :show, status: :ok, location: @affiliate_link }
52
- else
53
- format.html { render :edit }
54
- format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # DELETE /affiliate/links/1
60
- def destroy
61
- @affiliate_link.destroy
62
- respond_to do |format|
63
- format.html { redirect_to affiliate_links_path, :flash => { :error => 'Affiliate Link and Post Connections have all been Removed.' }}
64
- format.json { head :no_content }
65
- end
66
- end
67
-
68
- private
69
-
70
- # Common Callbacks
71
- def set_affiliate_link
72
- @affiliate_link = Affiliate::Link.find(params[:id])
73
- end
74
-
75
- # Whitelist
76
- def affiliate_link_params
77
- params.require(:affiliate_link).permit(:affiliate_link_name, :affiliate_link_button_text, :affiliate_link_url, :affiliate_link_original_url, :slug, :user_id, :org_id)
78
- end
79
-
80
- end
81
- end
1
+ require_dependency "phcdevworks_core_modules/application_controller"
2
+
3
+ module PhcdevworksCoreModules
4
+ class Affiliate::LinksController < 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_affiliate_link, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /affiliate/links
13
+ def index
14
+ @affiliate_links = Affiliate::Link.order('affiliate_link_name ASC')
15
+ end
16
+
17
+ # GET /affiliate/links/1
18
+ def show
19
+ end
20
+
21
+ # GET /affiliate/links/new
22
+ def new
23
+ @affiliate_link = Affiliate::Link.new
24
+ end
25
+
26
+ # GET /affiliate/links/1/edit
27
+ def edit
28
+ end
29
+
30
+ # POST /affiliate/links
31
+ def create
32
+ @affiliate_link = Affiliate::Link.new(affiliate_link_params)
33
+ @affiliate_link.user_id = current_user.id
34
+ @affiliate_link.org_id = current_user.org_id
35
+ respond_to do |format|
36
+ if @affiliate_link.save
37
+ format.html { redirect_to affiliate_links_path, :flash => { :success => 'Affilate Link has been Added.' }}
38
+ format.json { render :show, status: :created, location: @affiliate_link }
39
+ else
40
+ format.html { render :new }
41
+ format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }
42
+ end
43
+ end
44
+ end
45
+
46
+ # PATCH/PUT /affiliate/links/1
47
+ def update
48
+ respond_to do |format|
49
+ if @affiliate_link.update(affiliate_link_params)
50
+ format.html { redirect_to affiliate_links_path, :flash => { :notice => 'Affiliate Link has been Updated.' }}
51
+ format.json { render :show, status: :ok, location: @affiliate_link }
52
+ else
53
+ format.html { render :edit }
54
+ format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }
55
+ end
56
+ end
57
+ end
58
+
59
+ # DELETE /affiliate/links/1
60
+ def destroy
61
+ @affiliate_link.destroy
62
+ respond_to do |format|
63
+ format.html { redirect_to affiliate_links_path, :flash => { :error => 'Affiliate Link and Post Connections have all been Removed.' }}
64
+ format.json { head :no_content }
65
+ end
66
+ end
67
+
68
+ private
69
+
70
+ # Common Callbacks
71
+ def set_affiliate_link
72
+ @affiliate_link = Affiliate::Link.find(params[:id])
73
+ end
74
+
75
+ # Whitelist
76
+ def affiliate_link_params
77
+ params.require(:affiliate_link).permit(:affiliate_link_name, :affiliate_link_button_text, :affiliate_link_url, :affiliate_link_original_url, :slug, :user_id, :org_id)
78
+ end
79
+
80
+ end
81
+ end
@@ -1,13 +1,13 @@
1
- module PhcdevworksCoreModules
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 PhcdevworksCoreModules
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,81 +1,81 @@
1
- require_dependency "phcdevworks_core_modules/application_controller"
2
-
3
- module PhcdevworksCoreModules
4
- class Marketing::OptimizationsController < 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_marketing_optimization, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /marketing/optimizations
13
- def index
14
- @marketing_optimizations = Marketing::Optimization.order('marketing_optimization_page_title ASC')
15
- end
16
-
17
- # GET /marketing/optimizations/1
18
- def show
19
- end
20
-
21
- # GET /marketing/optimizations/new
22
- def new
23
- @marketing_optimization = Marketing::Optimization.new
24
- end
25
-
26
- # GET /marketing/optimizations/1/edit
27
- def edit
28
- end
29
-
30
- # POST /marketing/optimizations
31
- def create
32
- @marketing_optimization = Marketing::Optimization.new(marketing_optimization_params)
33
- @marketing_optimization.user_id = current_user.id
34
- @marketing_optimization.org_id = current_user.org_id
35
- respond_to do |format|
36
- if @marketing_optimization.save
37
- format.html { redirect_to marketing_optimizations_path, :flash => { :success => 'SEO Attributes has been Added.' }}
38
- format.json { render :show, status: :created, location: @marketing_optimization }
39
- else
40
- format.html { render :new }
41
- format.json { render json: @marketing_optimization.errors, status: :unprocessable_entity }
42
- end
43
- end
44
- end
45
-
46
- # PATCH/PUT /marketing/optimizations/1
47
- def update
48
- respond_to do |format|
49
- if @marketing_optimization.update(marketing_optimization_params)
50
- format.html { redirect_to marketing_optimizations_path, :flash => { :notice => 'SEO Attributes has been Updated.' }}
51
- format.json { render :show, status: :ok, location: @marketing_optimization }
52
- else
53
- format.html { render :edit }
54
- format.json { render json: @marketing_optimization.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # DELETE /marketing/optimizations/1
60
- def destroy
61
- @marketing_optimization.destroy
62
- respond_to do |format|
63
- format.html { redirect_to marketing_optimizations_path, :flash => { :error => 'SEO Attributes and Post Connections have all been Removed.' }}
64
- format.json { head :no_content }
65
- end
66
- end
67
-
68
- private
69
-
70
- # Common Callbacks
71
- def set_marketing_optimization
72
- @marketing_optimization = Marketing::Optimization.find(params[:id])
73
- end
74
-
75
- # Whitelist
76
- def marketing_optimization_params
77
- params.require(:marketing_optimization).permit(:marketing_optimization_page_title, :marketing_optimization_page_description, :marketing_optimization_og_title, :marketing_optimization_og_description, :marketing_optimization_og_type, :marketing_optimization_og_url, :marketing_optimization_twitter_title, :marketing_optimization_twitter_description, :marketing_optimization_twitter_type, :marketing_optimization_twitter_url, :marketing_optimization_twitter_image, :marketing_optimization_og_image, :slug, :user_id, :org_id)
78
- end
79
-
80
- end
81
- end
1
+ require_dependency "phcdevworks_core_modules/application_controller"
2
+
3
+ module PhcdevworksCoreModules
4
+ class Marketing::OptimizationsController < 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_marketing_optimization, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /marketing/optimizations
13
+ def index
14
+ @marketing_optimizations = Marketing::Optimization.order('marketing_optimization_page_title ASC')
15
+ end
16
+
17
+ # GET /marketing/optimizations/1
18
+ def show
19
+ end
20
+
21
+ # GET /marketing/optimizations/new
22
+ def new
23
+ @marketing_optimization = Marketing::Optimization.new
24
+ end
25
+
26
+ # GET /marketing/optimizations/1/edit
27
+ def edit
28
+ end
29
+
30
+ # POST /marketing/optimizations
31
+ def create
32
+ @marketing_optimization = Marketing::Optimization.new(marketing_optimization_params)
33
+ @marketing_optimization.user_id = current_user.id
34
+ @marketing_optimization.org_id = current_user.org_id
35
+ respond_to do |format|
36
+ if @marketing_optimization.save
37
+ format.html { redirect_to marketing_optimizations_path, :flash => { :success => 'SEO Attributes has been Added.' }}
38
+ format.json { render :show, status: :created, location: @marketing_optimization }
39
+ else
40
+ format.html { render :new }
41
+ format.json { render json: @marketing_optimization.errors, status: :unprocessable_entity }
42
+ end
43
+ end
44
+ end
45
+
46
+ # PATCH/PUT /marketing/optimizations/1
47
+ def update
48
+ respond_to do |format|
49
+ if @marketing_optimization.update(marketing_optimization_params)
50
+ format.html { redirect_to marketing_optimizations_path, :flash => { :notice => 'SEO Attributes has been Updated.' }}
51
+ format.json { render :show, status: :ok, location: @marketing_optimization }
52
+ else
53
+ format.html { render :edit }
54
+ format.json { render json: @marketing_optimization.errors, status: :unprocessable_entity }
55
+ end
56
+ end
57
+ end
58
+
59
+ # DELETE /marketing/optimizations/1
60
+ def destroy
61
+ @marketing_optimization.destroy
62
+ respond_to do |format|
63
+ format.html { redirect_to marketing_optimizations_path, :flash => { :error => 'SEO Attributes and Post Connections have all been Removed.' }}
64
+ format.json { head :no_content }
65
+ end
66
+ end
67
+
68
+ private
69
+
70
+ # Common Callbacks
71
+ def set_marketing_optimization
72
+ @marketing_optimization = Marketing::Optimization.find(params[:id])
73
+ end
74
+
75
+ # Whitelist
76
+ def marketing_optimization_params
77
+ params.require(:marketing_optimization).permit(:marketing_optimization_page_title, :marketing_optimization_page_description, :marketing_optimization_og_title, :marketing_optimization_og_description, :marketing_optimization_og_type, :marketing_optimization_og_url, :marketing_optimization_twitter_title, :marketing_optimization_twitter_description, :marketing_optimization_twitter_type, :marketing_optimization_twitter_url, :marketing_optimization_twitter_image, :marketing_optimization_og_image, :slug, :user_id, :org_id)
78
+ end
79
+
80
+ end
81
+ end
@@ -1,81 +1,81 @@
1
- require_dependency "phcdevworks_core_modules/application_controller"
2
-
3
- module PhcdevworksCoreModules
4
- class Post::CategoriesController < 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_post_category, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /post/categories
13
- def index
14
- @post_categories = Post::Category.order('post_category_name ASC')
15
- end
16
-
17
- # GET /post/categories/1
18
- def show
19
- end
20
-
21
- # GET /post/categories/new
22
- def new
23
- @post_category = Post::Category.new
24
- end
25
-
26
- # GET /post/categories/1/edit
27
- def edit
28
- end
29
-
30
- # POST /post/categories
31
- def create
32
- @post_category = Post::Category.new(post_category_params)
33
- @post_category.user_id = current_user.id
34
- @post_category.org_id = current_user.org_id
35
- respond_to do |format|
36
- if @post_category.save
37
- format.html { redirect_to post_categories_path, :flash => { :success => 'Category has been Added.' }}
38
- format.json { render :show, status: :created, location: @post_category }
39
- else
40
- format.html { render :new }
41
- format.json { render json: @post_category.errors, status: :unprocessable_entity }
42
- end
43
- end
44
- end
45
-
46
- # PATCH/PUT /post/categories/1
47
- def update
48
- respond_to do |format|
49
- if @post_category.update(post_category_params)
50
- format.html { redirect_to post_categories_path, :flash => { :notice => 'Category has been Updated.' }}
51
- format.json { render :show, status: :ok, location: @post_category }
52
- else
53
- format.html { render :edit }
54
- format.json { render json: @post_category.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # DELETE /post/categories/1
60
- def destroy
61
- @post_category.destroy
62
- respond_to do |format|
63
- format.html { redirect_to post_categories_path, :flash => { :error => 'Categories and Category Connections have all been Removed.' }}
64
- format.json { head :no_content }
65
- end
66
- end
67
-
68
- private
69
-
70
- # Common Callbacks
71
- def set_post_category
72
- @post_category = Post::Category.find(params[:id])
73
- end
74
-
75
- # Whitelist
76
- def post_category_params
77
- params.require(:post_category).permit(:post_category_name, :slug, :user_id, :org_id)
78
- end
79
-
80
- end
81
- end
1
+ require_dependency "phcdevworks_core_modules/application_controller"
2
+
3
+ module PhcdevworksCoreModules
4
+ class Post::CategoriesController < 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_post_category, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /post/categories
13
+ def index
14
+ @post_categories = Post::Category.order('post_category_name ASC')
15
+ end
16
+
17
+ # GET /post/categories/1
18
+ def show
19
+ end
20
+
21
+ # GET /post/categories/new
22
+ def new
23
+ @post_category = Post::Category.new
24
+ end
25
+
26
+ # GET /post/categories/1/edit
27
+ def edit
28
+ end
29
+
30
+ # POST /post/categories
31
+ def create
32
+ @post_category = Post::Category.new(post_category_params)
33
+ @post_category.user_id = current_user.id
34
+ @post_category.org_id = current_user.org_id
35
+ respond_to do |format|
36
+ if @post_category.save
37
+ format.html { redirect_to post_categories_path, :flash => { :success => 'Category has been Added.' }}
38
+ format.json { render :show, status: :created, location: @post_category }
39
+ else
40
+ format.html { render :new }
41
+ format.json { render json: @post_category.errors, status: :unprocessable_entity }
42
+ end
43
+ end
44
+ end
45
+
46
+ # PATCH/PUT /post/categories/1
47
+ def update
48
+ respond_to do |format|
49
+ if @post_category.update(post_category_params)
50
+ format.html { redirect_to post_categories_path, :flash => { :notice => 'Category has been Updated.' }}
51
+ format.json { render :show, status: :ok, location: @post_category }
52
+ else
53
+ format.html { render :edit }
54
+ format.json { render json: @post_category.errors, status: :unprocessable_entity }
55
+ end
56
+ end
57
+ end
58
+
59
+ # DELETE /post/categories/1
60
+ def destroy
61
+ @post_category.destroy
62
+ respond_to do |format|
63
+ format.html { redirect_to post_categories_path, :flash => { :error => 'Categories and Category Connections have all been Removed.' }}
64
+ format.json { head :no_content }
65
+ end
66
+ end
67
+
68
+ private
69
+
70
+ # Common Callbacks
71
+ def set_post_category
72
+ @post_category = Post::Category.find(params[:id])
73
+ end
74
+
75
+ # Whitelist
76
+ def post_category_params
77
+ params.require(:post_category).permit(:post_category_name, :slug, :user_id, :org_id)
78
+ end
79
+
80
+ end
81
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module Affiliate::LinksHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module Affiliate::LinksHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module ApplicationHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module Marketing::OptimizationsHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module Marketing::OptimizationsHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module Post::CategoriesHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module Post::CategoriesHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -1,6 +1,6 @@
1
- module PhcdevworksCoreModules
2
- class ApplicationMailer < ActionMailer::Base
3
- default from: 'from@example.com'
4
- layout 'mailer'
5
- end
6
- end
1
+ module PhcdevworksCoreModules
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end