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.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +3 -0
- data/app/assets/config/phcdevworks_core_modules_manifest.js +2 -3
- data/app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb +81 -81
- data/app/controllers/phcdevworks_core_modules/application_controller.rb +13 -13
- data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +81 -81
- data/app/controllers/phcdevworks_core_modules/post/categories_controller.rb +81 -81
- data/app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb +4 -4
- data/app/helpers/phcdevworks_core_modules/application_helper.rb +4 -4
- data/app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb +4 -4
- data/app/helpers/phcdevworks_core_modules/post/categories_helper.rb +4 -4
- data/app/jobs/phcdevworks_core_modules/application_job.rb +4 -4
- data/app/mailers/phcdevworks_core_modules/application_mailer.rb +6 -6
- data/app/models/phcdevworks_core_modules/affiliate/link.rb +35 -35
- data/app/models/phcdevworks_core_modules/affiliate.rb +7 -7
- data/app/models/phcdevworks_core_modules/application_record.rb +5 -5
- data/app/models/phcdevworks_core_modules/marketing/optimization.rb +54 -54
- data/app/models/phcdevworks_core_modules/marketing.rb +7 -7
- data/app/models/phcdevworks_core_modules/modules.rb +7 -7
- data/app/models/phcdevworks_core_modules/post/category.rb +43 -43
- data/app/models/phcdevworks_core_modules/post.rb +7 -7
- data/app/views/layouts/phcdevworks_core_modules/application.html.erb +34 -92
- data/app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb +10 -9
- data/app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb +26 -25
- data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +491 -349
- data/app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb +37 -27
- data/app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb +39 -47
- data/app/views/phcdevworks_core_modules/affiliate/links/index.html.erb +78 -86
- data/app/views/phcdevworks_core_modules/affiliate/links/new.html.erb +39 -47
- data/app/views/phcdevworks_core_modules/affiliate/links/show.html.erb +24 -24
- data/app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb +87 -89
- data/app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb +39 -47
- data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +80 -88
- data/app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb +39 -47
- data/app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb +54 -54
- data/app/views/phcdevworks_core_modules/post/categories/_form.html.erb +22 -22
- data/app/views/phcdevworks_core_modules/post/categories/edit.html.erb +39 -47
- data/app/views/phcdevworks_core_modules/post/categories/index.html.erb +72 -80
- data/app/views/phcdevworks_core_modules/post/categories/new.html.erb +39 -47
- data/app/views/phcdevworks_core_modules/post/categories/show.html.erb +9 -9
- data/config/routes.rb +18 -20
- data/db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb +1 -1
- data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +26 -26
- data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb +18 -18
- data/db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb +17 -17
- data/db/migrate/20201012225709_remove_phcdevworks_core_modules_post_categories.rb +7 -7
- data/db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb +18 -18
- data/db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb +18 -18
- data/lib/phcdevworks_core_modules/engine.rb +3 -45
- data/lib/phcdevworks_core_modules/version.rb +1 -1
- metadata +32 -82
- data/app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee +0 -3
- data/app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_core_modules/application.scss +0 -0
- data/app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss +0 -3
- data/app/assets/stylesheets/scaffolds.scss +0 -65
- data/config/spring.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1abaaf09364c9b970891167db12e37a45332f761d33ea4da4eb100edc049f7f8
|
4
|
+
data.tar.gz: 1b9d89ca525bc92352f5133ebca90f9ec0c92428e04709fb14b24ce177d15528
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a5a28a88f62b36084063492c8b4f05b82f747c61edb509afdeebc2ba38a9011024bb4a77d2f4cf4839f1af3c05c8cf6d2cf5309eb9d48d94b08c65ac7d9fa73
|
7
|
+
data.tar.gz: 121d1a5f187101b72a288eb8c07abdf5c6e0bd7206f7daa19dbc8aba9df2416290b4348584f3f4055381eed7918004220534ef08a6b64e00fad1f30930e34b6c
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -0,0 +1,3 @@
|
|
1
|
+
### Status
|
2
|
+
|
3
|
+
[](https://badge.fury.io/rb/phcdevworks_core_modules) [](https://github.com/phcdevworks/phcdevworks_core_modules/actions/workflows/publish_gem_github_com.yml) [](https://github.com/phcdevworks/phcdevworks_core_modules/actions/workflows/publish_gem_rubygems_org.yml)
|
@@ -1,3 +1,2 @@
|
|
1
|
-
//=
|
2
|
-
//= link phcthemes_admin_panel_pack_coloradmin.
|
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
|