phcdevworks_core_modules 7.2.2 → 7.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +0 -0
  4. data/Rakefile +8 -8
  5. data/app/assets/config/phcdevworks_core_modules_manifest.js +3 -3
  6. data/app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee +3 -3
  7. data/app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss +3 -3
  8. data/app/assets/stylesheets/phcdevworks_core_modules/application.scss +0 -0
  9. data/app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss +3 -3
  10. data/app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss +3 -3
  11. data/app/assets/stylesheets/scaffolds.scss +65 -65
  12. data/app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb +81 -81
  13. data/app/controllers/phcdevworks_core_modules/application_controller.rb +13 -13
  14. data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +81 -81
  15. data/app/controllers/phcdevworks_core_modules/post/categories_controller.rb +81 -81
  16. data/app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb +4 -4
  17. data/app/helpers/phcdevworks_core_modules/application_helper.rb +4 -4
  18. data/app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb +4 -4
  19. data/app/helpers/phcdevworks_core_modules/post/categories_helper.rb +4 -4
  20. data/app/jobs/phcdevworks_core_modules/application_job.rb +4 -4
  21. data/app/mailers/phcdevworks_core_modules/application_mailer.rb +6 -6
  22. data/app/models/phcdevworks_core_modules/affiliate/link.rb +35 -35
  23. data/app/models/phcdevworks_core_modules/affiliate.rb +7 -7
  24. data/app/models/phcdevworks_core_modules/affiliate_link_versions.rb +0 -0
  25. data/app/models/phcdevworks_core_modules/application_record.rb +5 -5
  26. data/app/models/phcdevworks_core_modules/marketing/optimization.rb +54 -54
  27. data/app/models/phcdevworks_core_modules/marketing.rb +7 -7
  28. data/app/models/phcdevworks_core_modules/marketing_optimization_versions.rb +0 -0
  29. data/app/models/phcdevworks_core_modules/modules.rb +7 -7
  30. data/app/models/phcdevworks_core_modules/post/category.rb +43 -43
  31. data/app/models/phcdevworks_core_modules/post.rb +7 -7
  32. data/app/models/phcdevworks_core_modules/post_category_versions.rb +0 -0
  33. data/app/views/layouts/phcdevworks_core_modules/application.html.erb +131 -131
  34. data/app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb +0 -0
  35. data/app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb +0 -0
  36. data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +0 -0
  37. data/app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb +27 -27
  38. data/app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb +47 -47
  39. data/app/views/phcdevworks_core_modules/affiliate/links/index.html.erb +86 -86
  40. data/app/views/phcdevworks_core_modules/affiliate/links/new.html.erb +47 -47
  41. data/app/views/phcdevworks_core_modules/affiliate/links/show.html.erb +24 -24
  42. data/app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb +89 -89
  43. data/app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb +47 -47
  44. data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +88 -88
  45. data/app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb +47 -47
  46. data/app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb +54 -54
  47. data/app/views/phcdevworks_core_modules/post/categories/_form.html.erb +22 -22
  48. data/app/views/phcdevworks_core_modules/post/categories/edit.html.erb +47 -47
  49. data/app/views/phcdevworks_core_modules/post/categories/index.html.erb +80 -80
  50. data/app/views/phcdevworks_core_modules/post/categories/new.html.erb +47 -47
  51. data/app/views/phcdevworks_core_modules/post/categories/show.html.erb +9 -9
  52. data/config/routes.rb +24 -24
  53. data/config/spring.rb +1 -1
  54. data/db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb +0 -0
  55. data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +26 -26
  56. data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb +18 -18
  57. data/db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb +17 -17
  58. data/db/migrate/20201012225709_remove_phcdevworks_core_modules_post_categories.rb +7 -7
  59. data/db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb +18 -18
  60. data/db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb +18 -18
  61. data/lib/phcdevworks_core_modules/engine.rb +47 -47
  62. data/lib/phcdevworks_core_modules/version.rb +3 -3
  63. data/lib/phcdevworks_core_modules.rb +6 -6
  64. data/lib/tasks/phcdevworks_core_modules_tasks.rake +4 -4
  65. metadata +31 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 148e44765e07212756d16ce2175b68f78aec86e513604150a37a61ea499646d5
4
- data.tar.gz: 0b10c376077480fa1ac9422778e4248cd3d8715b090208809adf5b3e7ee51f64
3
+ metadata.gz: 2fab22f124a2646684433df0eb111f83eaec82978ad1c151248b747900c776c3
4
+ data.tar.gz: 02f6f0ad2425491cea6e86834360b926ab1ab3b2d9fef93b3a16785c12d50bfb
5
5
  SHA512:
6
- metadata.gz: 8d85bae66581695229b55f514ca58b23fa4fbf24a346912aa5fe53ed4feea1c237eac3079e79d9a4fbe167fd522c7f87f78d6187d244884bd76dcc4a13a5b2b1
7
- data.tar.gz: e74b66b2f3bc8c52634df5edc0300270216872391150cf6e46e74ec52e7b5d9883cb591fd8ed88a57cc6171cca624f196fbb525e0fe9add03ff2815766b5c40b
6
+ metadata.gz: 121dddf38b1636a06cc23da2b08891594498d7d048438aa1a55ab72d135c078a2e76c0db9be45e367dfe9c35678df7a4941b3c6e47b25c345b6389ee74c3ce33
7
+ data.tar.gz: b603fcc68ae8bb0a0d887b8a3420af92a0ad0142f0d1ff12782ada14c272610cae33ec9a1cf823a060ce9b0a0786246c5c57bd30b2bb4befa695d420f8ac6250
data/MIT-LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright 2020 BradPotts
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright 2020 BradPotts
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
- require "bundler/setup"
2
-
3
- APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
4
- load "rails/tasks/engine.rake"
5
-
6
- load "rails/tasks/statistics.rake"
7
-
8
- require "bundler/gem_tasks"
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -1,3 +1,3 @@
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_directory ../stylesheets/phcdevworks_core_modules .scss
2
+ //= link phcthemes_admin_panel_pack_coloradmin.css
3
+ //= link phcthemes_admin_panel_pack_coloradmin.js
@@ -1,3 +1,3 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,3 +1,3 @@
1
- // Place all the styles related to the Affiliate::Links controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: https://sass-lang.com/
1
+ // Place all the styles related to the Affiliate::Links controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -1,3 +1,3 @@
1
- // Place all the styles related to the marketing::optimizations controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: https://sass-lang.com/
1
+ // Place all the styles related to the marketing::optimizations controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -1,3 +1,3 @@
1
- // Place all the styles related to the post::categories controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: https://sass-lang.com/
1
+ // Place all the styles related to the post::categories controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -1,65 +1,65 @@
1
- body {
2
- background-color: #fff;
3
- color: #333;
4
- margin: 33px; }
5
-
6
- body, p, ol, ul, td {
7
- font-family: verdana, arial, helvetica, sans-serif;
8
- font-size: 13px;
9
- line-height: 18px; }
10
-
11
- pre {
12
- background-color: #eee;
13
- padding: 10px;
14
- font-size: 11px; }
15
-
16
- a {
17
- color: #000; }
18
-
19
- a:visited {
20
- color: #666; }
21
-
22
- a:hover {
23
- color: #fff;
24
- background-color: #000; }
25
-
26
- th {
27
- padding-bottom: 5px; }
28
-
29
- td {
30
- padding: 0 5px 7px; }
31
-
32
- div.field,
33
- div.actions {
34
- margin-bottom: 10px; }
35
-
36
- #notice {
37
- color: green; }
38
-
39
- .field_with_errors {
40
- padding: 2px;
41
- background-color: red;
42
- display: table; }
43
-
44
- #error_explanation {
45
- width: 450px;
46
- border: 2px solid red;
47
- padding: 7px 7px 0;
48
- margin-bottom: 20px;
49
- background-color: #f0f0f0; }
50
-
51
- #error_explanation h2 {
52
- text-align: left;
53
- font-weight: bold;
54
- padding: 5px 5px 5px 15px;
55
- font-size: 12px;
56
- margin: -7px -7px 0;
57
- background-color: #c00;
58
- color: #fff; }
59
-
60
- #error_explanation ul li {
61
- font-size: 12px;
62
- list-style: square; }
63
-
64
- label {
65
- display: block; }
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ margin: 33px; }
5
+
6
+ body, p, ol, ul, td {
7
+ font-family: verdana, arial, helvetica, sans-serif;
8
+ font-size: 13px;
9
+ line-height: 18px; }
10
+
11
+ pre {
12
+ background-color: #eee;
13
+ padding: 10px;
14
+ font-size: 11px; }
15
+
16
+ a {
17
+ color: #000; }
18
+
19
+ a:visited {
20
+ color: #666; }
21
+
22
+ a:hover {
23
+ color: #fff;
24
+ background-color: #000; }
25
+
26
+ th {
27
+ padding-bottom: 5px; }
28
+
29
+ td {
30
+ padding: 0 5px 7px; }
31
+
32
+ div.field,
33
+ div.actions {
34
+ margin-bottom: 10px; }
35
+
36
+ #notice {
37
+ color: green; }
38
+
39
+ .field_with_errors {
40
+ padding: 2px;
41
+ background-color: red;
42
+ display: table; }
43
+
44
+ #error_explanation {
45
+ width: 450px;
46
+ border: 2px solid red;
47
+ padding: 7px 7px 0;
48
+ margin-bottom: 20px;
49
+ background-color: #f0f0f0; }
50
+
51
+ #error_explanation h2 {
52
+ text-align: left;
53
+ font-weight: bold;
54
+ padding: 5px 5px 5px 15px;
55
+ font-size: 12px;
56
+ margin: -7px -7px 0;
57
+ background-color: #c00;
58
+ color: #fff; }
59
+
60
+ #error_explanation ul li {
61
+ font-size: 12px;
62
+ list-style: square; }
63
+
64
+ label {
65
+ display: block; }
@@ -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