phcdevworks_core_modules 1.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/phcdevworks_core_modules/marketing/optimizations.coffee +3 -0
  3. data/app/assets/javascripts/phcdevworks_core_modules/post/categories.coffee +3 -0
  4. data/app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss +3 -0
  5. data/app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss +3 -0
  6. data/app/assets/stylesheets/scaffolds.scss +65 -0
  7. data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +81 -0
  8. data/app/controllers/phcdevworks_core_modules/post/categories_controller.rb +81 -0
  9. data/app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb +4 -0
  10. data/app/helpers/phcdevworks_core_modules/{modules → post}/categories_helper.rb +1 -1
  11. data/app/models/phcdevworks_core_modules/core_category_versions.rb +1 -1
  12. data/app/models/phcdevworks_core_modules/core_optimization_versions.rb +5 -0
  13. data/app/models/phcdevworks_core_modules/marketing.rb +7 -0
  14. data/app/models/phcdevworks_core_modules/marketing/optimization.rb +39 -0
  15. data/app/models/phcdevworks_core_modules/post.rb +7 -0
  16. data/app/models/phcdevworks_core_modules/{modules → post}/category.rb +11 -5
  17. data/app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb +1 -1
  18. data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +15 -4
  19. data/app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb +87 -0
  20. data/app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb +47 -0
  21. data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +88 -0
  22. data/app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb +47 -0
  23. data/app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb +49 -0
  24. data/app/views/phcdevworks_core_modules/{modules → post}/categories/_form.html.erb +5 -5
  25. data/app/views/phcdevworks_core_modules/{modules → post}/categories/edit.html.erb +2 -2
  26. data/app/views/phcdevworks_core_modules/{modules → post}/categories/index.html.erb +7 -7
  27. data/app/views/phcdevworks_core_modules/{modules → post}/categories/new.html.erb +2 -2
  28. data/app/views/phcdevworks_core_modules/post/categories/show.html.erb +9 -0
  29. data/config/routes.rb +11 -6
  30. data/db/migrate/20170517064427_create_phcdevworks_core_modules_category_versions.rb +17 -0
  31. data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +25 -0
  32. data/db/migrate/{20170517064427_create_phcdevworks_core_category_versions.rb → 20200705225433_create_phcdevworks_core_modules_optimization_versions.rb} +17 -17
  33. data/db/migrate/20200706091346_create_phcdevworks_core_modules_categories_optimizations.rb +10 -0
  34. data/db/migrate/{20200629113153_create_phcdevworks_core_modules_modules_categories.rb → 20200706094820_create_phcdevworks_core_modules_post_categories.rb} +2 -2
  35. data/lib/phcdevworks_core_modules/version.rb +1 -1
  36. metadata +33 -14
  37. data/app/controllers/phcdevworks_core_modules/modules/categories_controller.rb +0 -81
  38. data/app/views/phcdevworks_core_modules/modules/categories/show.html.erb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39b266891b0c3bd54ea9d8d583bdec1adc6ef4b15af7504e40724e9deea5c915
4
- data.tar.gz: 4eadef7e0d80e2890ef2ed0dbd1b7db5f0daa32f0fa81a1a6038714c5e8e688c
3
+ metadata.gz: 908084ab1bac324f935acc7efeef54a089a3d9075ea4cc89ff11efb18631f4f8
4
+ data.tar.gz: 03c8009534ec11c3902b4b050b8de1658a70790a1d8123f83b46e17728da8b2c
5
5
  SHA512:
6
- metadata.gz: d5c7da75fe6ac47f613a58b4d63bfe6f3910dadb5183bd80ed01f49fcea48229bd9cb9932f2d1d566ffd887c8e8555987ced9790234df158368edc593d4cefbd
7
- data.tar.gz: 3f96bc4a1ca19299e940f2025c3ca4ec309b808a362bca01ee5a1438dd31399496d5d3d00d8b7aa54a539d2da88c5da039f8f617ab50e6c3bd936afe80960d90
6
+ metadata.gz: 379ef906193a9e52ed336055bf172cceee8d891cafb050c84e59df13033d07c2a4787a2c895389d1cfcfb9e6c5962475cc0e052a3f3cb9c2cc53c9d0834fe6fd
7
+ data.tar.gz: 24ca974763484f3df0db89d8687aa1fcf65f65947c9bb0b32064287ff9a36690ff3df8caeb083078591e96ac4fe4dd350116ee30bb3f7df085701bd9f9a68531
@@ -0,0 +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/
@@ -0,0 +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/
@@ -0,0 +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/
@@ -0,0 +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/
@@ -0,0 +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; }
@@ -0,0 +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('seo_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 => 'Tutorial 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(:seo_title, :seo_description, :seo_open_graph_post_type, :seo_open_graph_url, :seo_open_graph_title, :seo_open_graph_description, :seo_open_graph_image, :seo_twitter_post_type, :seo_twitter_url, :seo_twitter_title, :seo_twitter_description, :seo_twitter_image, :slug, :user_id, :org_id)
78
+ end
79
+
80
+ end
81
+ end
@@ -0,0 +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('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(:category_name, :slug, :user_id, :org_id)
78
+ end
79
+
80
+ end
81
+ end
@@ -0,0 +1,4 @@
1
+ module PhcdevworksCoreModules
2
+ module Marketing::OptimizationsHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
1
  module PhcdevworksCoreModules
2
- module Modules::CategoriesHelper
2
+ module Post::CategoriesHelper
3
3
  end
4
4
  end
@@ -1,5 +1,5 @@
1
1
  module PhcdevworksCoreModules
2
2
  class CoreCategoryVersions < PaperTrail::Version
3
- self.table_name = :phcdevworks_core_category_versions
3
+ self.table_name = :phcdevworks_core_modules_category_versions
4
4
  end
5
5
  end
@@ -0,0 +1,5 @@
1
+ module PhcdevworksCoreModules
2
+ class CoreOptimizationVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_core_modules_optimization_versions
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module PhcdevworksCoreModules
2
+ module Marketing
3
+ def self.table_name_prefix
4
+ 'phcdevworks_core_modules_marketing_'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,39 @@
1
+ module PhcdevworksCoreModules
2
+ class Marketing::Optimization < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Image Upload
8
+ has_one_attached :seo_twitter_image
9
+ has_one_attached :seo_open_graph_image
10
+
11
+ # Paper Trail Initialize
12
+ has_paper_trail :class_name => "PhcdevworksCoreModules::CoreOptimizationVersions"
13
+
14
+ # Relationships
15
+ belongs_to :user, class_name: "PhcdevworksAccounts::User"
16
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
17
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
18
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
19
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_categories_commands", :dependent => :destroy
20
+
21
+ # Form Fields Validation
22
+ validates :seo_title,
23
+ presence: true
24
+
25
+ validates :seo_open_graph_title,
26
+ presence: true
27
+
28
+ validates :seo_twitter_title,
29
+ presence: true
30
+
31
+ # Clean URL Define
32
+ friendly_id :phcdev_core_optimization_nice_urls, use: [:slugged, :finders]
33
+
34
+ def phcdev_core_optimization_nice_urls
35
+ [:seo_title].join("-")
36
+ end
37
+
38
+ end
39
+ end
@@ -0,0 +1,7 @@
1
+ module PhcdevworksCoreModules
2
+ module Post
3
+ def self.table_name_prefix
4
+ 'phcdevworks_core_modules_post_'
5
+ end
6
+ end
7
+ end
@@ -1,9 +1,13 @@
1
1
  module PhcdevworksCoreModules
2
- class Modules::Category < ApplicationRecord
2
+ class Post::Category < ApplicationRecord
3
3
 
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
7
+ # Image Upload
8
+ has_one_attached :seo_twitter_image
9
+ has_one_attached :seo_open_graph_image
10
+
7
11
  # Paper Trail Initialize
8
12
  has_paper_trail :class_name => "PhcdevworksCoreModules::CoreCategoryVersions"
9
13
 
@@ -13,18 +17,20 @@ module PhcdevworksCoreModules
13
17
  has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
14
18
  has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
15
19
  has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_categories_commands", :dependent => :destroy
20
+ has_and_belongs_to_many :optimizations, class_name: 'PhcdevworksCoreModules::Core::Optimization', :join_table => "phcdevworks_core_modules_categories_optimizations", :dependent => :destroy
16
21
 
17
22
  # Form Fields Validation
18
23
  validates :category_name,
19
24
  presence: true,
20
25
  uniqueness: true
21
-
26
+
22
27
  # Clean URL Define
23
28
  friendly_id :phcdev_core_category_nice_urls, use: [:slugged, :finders]
24
-
29
+
25
30
  def phcdev_core_category_nice_urls
26
- [:category_name]
31
+ [:category_name]
27
32
  end
28
-
33
+
34
+
29
35
  end
30
36
  end
@@ -1,7 +1,7 @@
1
1
  <!-- -PHC- Topbar - Navigation Header -->
2
2
  <div class="navbar-header">
3
3
 
4
- <%= link_to phcdevworks_core_modules.modules_categories_path, class: "navbar-brand" do %>
4
+ <%= link_to phcdevworks_core_modules.post_categories_path, class: "navbar-brand" do %>
5
5
  <strong>PHCDevworks</strong>Press
6
6
  <% end %>
7
7
 
@@ -113,7 +113,7 @@
113
113
  <% end %>
114
114
 
115
115
  <% if defined?phcdevworks_core_modules %>
116
- <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Press -->
116
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
117
117
  <li class="nav-header">Core Modules</li>
118
118
  <li class="has-sub">
119
119
  <a href="javascript:;">
@@ -122,11 +122,22 @@
122
122
  <span>Categories</span>
123
123
  </a>
124
124
  <ul class="sub-menu">
125
- <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/modules/categories") %>"><%= link_to("Category Index", phcdevworks_core_modules.modules_categories_path) %></li>
126
- <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/modules/categories#new") %>"><%= link_to("New Category", phcdevworks_core_modules.new_modules_category_path) %></li>
125
+ <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/post/categories") %>"><%= link_to("Category Index", phcdevworks_core_modules.post_categories_path) %></li>
126
+ <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/post/categories#new") %>"><%= link_to("New Category", phcdevworks_core_modules.new_post_category_path) %></li>
127
127
  </ul>
128
128
  </li>
129
- <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Press -->
129
+ <li class="has-sub">
130
+ <a href="javascript:;">
131
+ <b class="caret"></b>
132
+ <i class="fad fa-analytics"></i>
133
+ <span>Marketing</span>
134
+ </a>
135
+ <ul class="sub-menu">
136
+ <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/marketing/optimizations") %>"><%= link_to("SEO Data Index", phcdevworks_core_modules.marketing_optimizations_path) %></li>
137
+ <li class="<%= phc_menu_active_controller("phcdevworks_core_modules/marketing/optimizations#new") %>"><%= link_to("Add SEO Data", phcdevworks_core_modules.new_marketing_optimization_path) %></li>
138
+ </ul>
139
+ </li>
140
+ <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
130
141
  <% end %>
131
142
 
132
143
  <% if defined?phcdevworks_members %>
@@ -0,0 +1,87 @@
1
+ <!-- Form - Optimization - Post -->
2
+ <%= form_with(model: marketing_optimization, local: true) do |form| %>
3
+
4
+ <!-- PHCNotifi Render Validation -->
5
+ <%= render "phcdevworks_notifications/bootstrap/validations", :object => @marketing_optimization %>
6
+ <!-- PHCNotifi Render Validation -->
7
+
8
+ <!-- Form Input Fields -->
9
+ <div class="form-group">
10
+ <%= form.label :seo_title, "SEO Title" %>
11
+ <%= form.text_field :seo_title, class: "form-control" %>
12
+ </div>
13
+
14
+ <div class="form-group">
15
+ <%= form.label :seo_description, "SEO Description" %>
16
+ <%= form.text_area :seo_description, class: "form-control" %>
17
+ </div>
18
+
19
+ <div class="form-group">
20
+ <%= form.label :seo_open_graph_title, "SEO OG Title" %>
21
+ <%= form.text_field :seo_open_graph_title, class: "form-control" %>
22
+ </div>
23
+
24
+ <div class="form-group">
25
+ <%= form.label :seo_open_graph_description, "SEO OG Description" %>
26
+ <%= form.text_field :seo_open_graph_description, class: "form-control" %>
27
+ </div>
28
+
29
+ <div class="form-group">
30
+ <%= form.label :seo_open_graph_post_type, "SEO OG Type" %>
31
+ <%= form.text_field :seo_open_graph_post_type, class: "form-control" %>
32
+ </div>
33
+
34
+ <div class="form-group field_with_errors">
35
+ <%= form.label :seo_open_graph_image, "Featured Image" %>
36
+ <%= form.file_field :seo_open_graph_image, class: "form-control" %>
37
+ <% if form.object.seo_open_graph_image.attached? %>
38
+ <%= image_tag main_app.url_for(form.object.seo_open_graph_image), class: "img-responsive img-thumbnail" %>
39
+ <%= form.label :remove_seo_open_graph_image %>
40
+ <%= form.check_box :remove_seo_open_graph_image %>
41
+ <% end %>
42
+ </div>
43
+
44
+ <div class="form-group">
45
+ <%= form.label :seo_open_graph_url, "SEO OG URL" %>
46
+ <%= form.text_field :seo_open_graph_url, class: "form-control" %>
47
+ </div>
48
+
49
+ <div class="form-group">
50
+ <%= form.label :seo_twitter_title, "SEO Twitter Title" %>
51
+ <%= form.text_field :seo_twitter_title, class: "form-control" %>
52
+ </div>
53
+
54
+ <div class="form-group">
55
+ <%= form.label :seo_twitter_description, "SEO Twitter Description" %>
56
+ <%= form.text_area :seo_twitter_description, class: "form-control" %>
57
+ </div>
58
+
59
+ <div class="form-group">
60
+ <%= form.label :seo_twitter_post_type, "SEO Twitter Type" %>
61
+ <%= form.text_field :seo_twitter_post_type, class: "form-control" %>
62
+ </div>
63
+
64
+ <div class="form-group field_with_errors">
65
+ <%= form.label :seo_twitter_image, "Featured Image" %>
66
+ <%= form.file_field :seo_twitter_image, class: "form-control" %>
67
+ <% if form.object.seo_twitter_image.attached? %>
68
+ <%= image_tag main_app.url_for(form.object.seo_twitter_image), class: "img-responsive img-thumbnail" %>
69
+ <%= form.label :remove_seo_twitter_image %>
70
+ <%= form.check_box :remove_seo_twitter_image %>
71
+ <% end %>
72
+ </div>
73
+
74
+ <div class="form-group">
75
+ <%= form.label :seo_twitter_url, "SEO Twitter URL" %>
76
+ <%= form.text_field :seo_twitter_url, class: "form-control" %>
77
+ </div>
78
+ <!-- Form Input Fields -->
79
+
80
+ <!-- Form Submition Button -->
81
+ <div class="actions">
82
+ <%= form.submit class: "btn btn-primary" %>
83
+ </div>
84
+ <!-- For Submition Button -->
85
+
86
+ <% end %>
87
+ <!-- Form - Optimization - Post -->
@@ -0,0 +1,47 @@
1
+ <!-- PHCTitleSEO Title Variables -->
2
+ <% phc_title "Marketing Manager" %>
3
+ <% phc_title_tagline "Update SEO Data" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "SEO Data Index", phcdevworks_core_modules.marketing_optimizations_path %>
6
+ <!-- PHCTitleSEO Title Variables -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h2 class="page-header"><%= yield(:phc_title) %></h2>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page Content -->
20
+ <div class="row">
21
+ <div class="col-lg-12">
22
+
23
+ <!-- Panel -->
24
+ <div class="panel panel-inverse">
25
+
26
+ <!-- Panel - Heading -->
27
+ <div class="panel-heading">
28
+ <h4 class="panel-title"><%= yield(:phc_title) %></h4>
29
+ </div>
30
+ <!-- Panel - Heading -->
31
+
32
+ <!-- Panel - Body -->
33
+ <div class="panel-body">
34
+
35
+ <!-- Edit Form -->
36
+ <%= render 'form', marketing_optimization: @marketing_optimization %>
37
+ <!-- Edit Form -->
38
+
39
+ </div>
40
+ <!-- Panel - Body -->
41
+
42
+ </div>
43
+ <!-- Panel -->
44
+
45
+ </div>
46
+ </div>
47
+ <!-- Page Content -->
@@ -0,0 +1,88 @@
1
+ <!-- PHCTitleSEO Title Variables -->
2
+ <% phc_title "Marketing Manager" %>
3
+ <% phc_title_tagline "SEO Data Index" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "SEO Data Index", phcdevworks_core_modules.marketing_optimizations_path %>
6
+ <!-- PHCTitleSEO Title Variables -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h2 class="page-header"><%= yield(:phc_title) %></h2>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page Content -->
20
+ <div class="row">
21
+ <div class="col-lg-12">
22
+
23
+ <!-- Panel -->
24
+ <div class="panel panel-inverse">
25
+
26
+ <!-- Panel - Heading -->
27
+ <div class="panel-heading">
28
+ <h4 class="panel-title"><%= yield(:phc_title) %></h4>
29
+ </div>
30
+ <!-- Panel - Heading -->
31
+
32
+ <!-- Panel - Body -->
33
+ <div class="panel-body">
34
+
35
+ <!-- Index - Table -->
36
+ <div class="table-responsive">
37
+ <table class="table table-striped table-bordered">
38
+
39
+ <thead>
40
+ <tr>
41
+ <th>SEO Title</th>
42
+ <th>SEO OG Title</th>
43
+ <th>SEO OG Type</th>
44
+ <th>SEO Twitter Title</th>
45
+ <th>SEO Twitter Type</th>
46
+ <th></th>
47
+ </tr>
48
+ </thead>
49
+
50
+ <tbody>
51
+ <% @marketing_optimizations.each do |marketing_optimization| %>
52
+ <tr>
53
+ <td><%= marketing_optimization.seo_title %></td>
54
+ <td><%= marketing_optimization.seo_open_graph_title %></td>
55
+ <td><%= marketing_optimization.seo_open_graph_post_type %></td>
56
+ <td><%= marketing_optimization.seo_twitter_title %></td>
57
+ <td><%= marketing_optimization.seo_twitter_post_type %></td>
58
+ <td>
59
+ <div class="btn-group d-flex" role="group">
60
+ <%= link_to "SEO Details", marketing_optimization, class: "btn btn-purple btn-xs" %>
61
+ <%= link_to "Update Information", edit_marketing_optimization_path(marketing_optimization), class: "btn btn-primary btn-xs" %>
62
+ <%= link_to "Remove", marketing_optimization, method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
63
+ </div>
64
+ </td>
65
+ </tr>
66
+ <% end %>
67
+ </tbody>
68
+
69
+ </table>
70
+ </div>
71
+ <!-- Index - Table -->
72
+
73
+ <!-- New Button -->
74
+ <%= link_to phcdevworks_core_modules.new_marketing_optimization_path, class: "btn btn-primary btn-sm" do %>
75
+ <i class="fad fa-plus-circle"></i>
76
+ Add a SEO Data for a Post
77
+ <% end %>
78
+ <!-- New Button -->
79
+
80
+ </div>
81
+ <!-- Panel - Body -->
82
+
83
+ </div>
84
+ <!-- Panel -->
85
+
86
+ </div>
87
+ </div>
88
+ <!-- Page Content -->
@@ -0,0 +1,47 @@
1
+ <!-- PHCTitleSEO Title Variables -->
2
+ <% phc_title "Marketing Manager" %>
3
+ <% phc_title_tagline "Add New SEO Data" %>
4
+ <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
+ <% phc_breadcrumb_two link_to "SEO Data Index", phcdevworks_core_modules.marketing_optimizations_path %>
6
+ <!-- PHCTitleSEO Title Variables -->
7
+
8
+ <!-- Page Bradcrumbs -->
9
+ <ol class="breadcrumb pull-right">
10
+ <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
11
+ <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
12
+ </ol>
13
+ <!-- Page Bradcrumbs -->
14
+
15
+ <!-- Page Header -->
16
+ <h2 class="page-header"><%= yield(:phc_title) %></h2>
17
+ <!-- Page Header -->
18
+
19
+ <!-- Page Content -->
20
+ <div class="row">
21
+ <div class="col-lg-12">
22
+
23
+ <!-- Panel -->
24
+ <div class="panel panel-inverse">
25
+
26
+ <!-- Panel - Heading -->
27
+ <div class="panel-heading">
28
+ <h4 class="panel-title"><%= yield(:phc_title) %></h4>
29
+ </div>
30
+ <!-- Panel - Heading -->
31
+
32
+ <!-- Panel - Body -->
33
+ <div class="panel-body">
34
+
35
+ <!-- New Form -->
36
+ <%= render 'form', marketing_optimization: @marketing_optimization %>
37
+ <!-- Edit Form -->
38
+
39
+ </div>
40
+ <!-- Panel - Body -->
41
+
42
+ </div>
43
+ <!-- Panel -->
44
+
45
+ </div>
46
+ </div>
47
+ <!-- Page Content -->
@@ -0,0 +1,49 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Seo title:</strong>
5
+ <%= @marketing_optimization.seo_title %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Seo description:</strong>
10
+ <%= @marketing_optimization.seo_description %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Seo open graph type:</strong>
15
+ <%= @marketing_optimization.seo_open_graph_type %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Seo open graph url:</strong>
20
+ <%= @marketing_optimization.seo_open_graph_url %>
21
+ </p>
22
+
23
+ <p>
24
+ <strong>Seo open graph title:</strong>
25
+ <%= @marketing_optimization.seo_open_graph_title %>
26
+ </p>
27
+
28
+ <p>
29
+ <strong>Seo open graph description:</strong>
30
+ <%= @marketing_optimization.seo_open_graph_description %>
31
+ </p>
32
+
33
+ <p>
34
+ <strong>Seo twitter url:</strong>
35
+ <%= @marketing_optimization.seo_twitter_url %>
36
+ </p>
37
+
38
+ <p>
39
+ <strong>Seo twitter title:</strong>
40
+ <%= @marketing_optimization.seo_twitter_title %>
41
+ </p>
42
+
43
+ <p>
44
+ <strong>Seo twitter description:</strong>
45
+ <%= @marketing_optimization.seo_twitter_description %>
46
+ </p>
47
+
48
+ <%= link_to 'Edit', edit_marketing_optimization_path(@marketing_optimization) %> |
49
+ <%= link_to 'Back', marketing_optimizations_path %>
@@ -1,8 +1,8 @@
1
- <!-- Form - Command - Post -->
2
- <%= form_with(model: modules_category, local: true) do |form| %>
1
+ <!-- Form - Category -->
2
+ <%= form_with(model: post_category, local: true) do |form| %>
3
3
 
4
- <!-- PHCNotifi Render Validation -->
5
- <%= render "phcdevworks_notifications/bootstrap/validations", :object => @modules_category %>
4
+ <!-- PHCNotifi Render Validation -->
5
+ <%= render "phcdevworks_notifications/bootstrap/validations", :object => @post_category %>
6
6
  <!-- PHCNotifi Render Validation -->
7
7
 
8
8
  <!-- Form Input Fields -->
@@ -19,4 +19,4 @@
19
19
  <!-- For Submition Button -->
20
20
 
21
21
  <% end %>
22
- <!-- Form - Command - Post -->
22
+ <!-- Form - Category -->
@@ -2,7 +2,7 @@
2
2
  <% phc_title "Category Manager" %>
3
3
  <% phc_title_tagline "Update Category" %>
4
4
  <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
- <% phc_breadcrumb_two link_to "Category Index", phcdevworks_core_modules.modules_categories_path %>
5
+ <% phc_breadcrumb_two link_to "Category Index", phcdevworks_core_modules.post_categories_path %>
6
6
  <!-- PHCTitleSEO Title Variables -->
7
7
 
8
8
  <!-- Page Bradcrumbs -->
@@ -33,7 +33,7 @@
33
33
  <div class="panel-body">
34
34
 
35
35
  <!-- Edit Form -->
36
- <%= render 'form', modules_category: @modules_category %>
36
+ <%= render 'form', post_category: @post_category %>
37
37
  <!-- Edit Form -->
38
38
 
39
39
  </div>
@@ -2,7 +2,7 @@
2
2
  <% phc_title "Category Manager" %>
3
3
  <% phc_title_tagline "Category Index" %>
4
4
  <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
- <% phc_breadcrumb_two link_to "Category Index", phcdevworks_core_modules.modules_categories_path %>
5
+ <% phc_breadcrumb_two link_to "Category Index", phcdevworks_core_modules.post_categories_path %>
6
6
  <!-- PHCTitleSEO Title Variables -->
7
7
 
8
8
  <!-- Page Bradcrumbs -->
@@ -44,14 +44,14 @@
44
44
  </thead>
45
45
 
46
46
  <tbody>
47
- <% @modules_categories.each do |modules_category| %>
47
+ <% @post_categories.each do |post_category| %>
48
48
  <tr>
49
- <td><%= modules_category.category_name %></td>
49
+ <td><%= post_category.category_name %></td>
50
50
  <td>
51
51
  <div class="btn-group d-flex" role="group">
52
- <%= link_to "Category Details", modules_category, class: "btn btn-purple btn-xs" %>
53
- <%= link_to "Update Category", edit_modules_category_path(modules_category), class: "btn btn-primary btn-xs" %>
54
- <%= link_to "Remove Category", modules_category, method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
52
+ <%= link_to "Category Details", post_category, class: "btn btn-purple btn-xs" %>
53
+ <%= link_to "Update Category", edit_post_category_path(post_category), class: "btn btn-primary btn-xs" %>
54
+ <%= link_to "Remove Category", post_category, method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
55
55
  </div>
56
56
  </td>
57
57
  </tr>
@@ -63,7 +63,7 @@
63
63
  <!-- Index - Table -->
64
64
 
65
65
  <!-- New Button -->
66
- <%= link_to phcdevworks_core_modules.new_modules_category_path, class: "btn btn-primary btn-sm" do %>
66
+ <%= link_to phcdevworks_core_modules.new_post_category_path, class: "btn btn-primary btn-sm" do %>
67
67
  <i class="fad fa-plus-circle"></i>
68
68
  Add a New Category
69
69
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <% phc_title "Category Manager" %>
3
3
  <% phc_title_tagline "Add a New Category" %>
4
4
  <% phc_breadcrumb_one yield(:phc_title_tagline) %>
5
- <% phc_breadcrumb_two link_to "Category Index", phcdevworks_core_modules.modules_categories_path %>
5
+ <% phc_breadcrumb_two link_to "Category Index", phcdevworks_core_modules.post_categories_path %>
6
6
  <!-- PHCTitleSEO Title Variables -->
7
7
 
8
8
  <!-- Page Bradcrumbs -->
@@ -33,7 +33,7 @@
33
33
  <div class="panel-body">
34
34
 
35
35
  <!-- New Form -->
36
- <%= render 'form', modules_category: @modules_category %>
36
+ <%= render 'form', post_category: @post_category %>
37
37
  <!-- Edit Form -->
38
38
 
39
39
  </div>
@@ -0,0 +1,9 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Post cat:</strong>
5
+ <%= @post_category.post_cat %>
6
+ </p>
7
+
8
+ <%= link_to 'Edit', edit_post_category_path(@post_category) %> |
9
+ <%= link_to 'Back', post_categories_path %>
@@ -1,11 +1,16 @@
1
1
  PhcdevworksCoreModules::Engine.routes.draw do
2
2
 
3
- # Core Module Routes
4
- namespace :modules do
5
- resources :categories, class_name: 'Core::Category'
6
- end
3
+ # Routes for Posts
4
+ namespace :post do
5
+ resources :categories, class_name: 'Post::Category'
6
+ end
7
7
 
8
- # Mount Routes
9
- mount PhcdevworksAccounts::Engine, :at => '/'
8
+ # Routes for Marketing
9
+ namespace :marketing do
10
+ resources :optimizations, class_name: 'Marketing::Optimization'
11
+ end
12
+
13
+ # Mount Routes
14
+ mount PhcdevworksAccounts::Engine, :at => '/'
10
15
 
11
16
  end
@@ -0,0 +1,17 @@
1
+ class CreatePhcdevworksCoreModulesCategoryVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_core_modules_category_versions do |t|
6
+ t.string :item_type, {:null=>false}
7
+ t.integer :item_id, null: false
8
+ t.string :event, null: false
9
+ t.string :whodunnit
10
+ t.text :object, limit: TEXT_BYTES
11
+ t.datetime :created_at
12
+ end
13
+
14
+ add_index :phcdevworks_core_modules_category_versions, %i(item_type item_id), :name => 'core_category_versions'
15
+
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ class CreatePhcdevworksCoreModulesMarketingOptimizations < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :phcdevworks_core_modules_marketing_optimizations do |t|
4
+
5
+ t.string :seo_title
6
+ t.text :seo_description
7
+
8
+ t.string :seo_open_graph_post_type
9
+ t.string :seo_open_graph_url
10
+ t.string :seo_open_graph_title
11
+ t.text :seo_open_graph_description
12
+
13
+ t.string :seo_twitter_post_type
14
+ t.string :seo_twitter_url
15
+ t.string :seo_twitter_title
16
+ t.text :seo_twitter_description
17
+
18
+ t.string :slug
19
+ t.string :user_id
20
+ t.string :org_id
21
+ t.timestamps
22
+
23
+ end
24
+ end
25
+ end
@@ -1,17 +1,17 @@
1
- class CreatePhcdevworksCoreCategoryVersions < ActiveRecord::Migration[6.0]
2
- TEXT_BYTES = 1_073_741_823
3
- def change
4
-
5
- create_table :phcdevworks_core_category_versions do |t|
6
- t.string :item_type, {:null=>false}
7
- t.integer :item_id, null: false
8
- t.string :event, null: false
9
- t.string :whodunnit
10
- t.text :object, limit: TEXT_BYTES
11
- t.datetime :created_at
12
- end
13
-
14
- add_index :phcdevworks_core_category_versions, %i(item_type item_id), :name => 'core_category_versions'
15
-
16
- end
17
- end
1
+ class CreatePhcdevworksCoreModulesOptimizationVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_core_modules_optimization_versions do |t|
6
+ t.string :item_type, {:null=>false}
7
+ t.integer :item_id, null: false
8
+ t.string :event, null: false
9
+ t.string :whodunnit
10
+ t.text :object, limit: TEXT_BYTES
11
+ t.datetime :created_at
12
+ end
13
+
14
+ add_index :phcdevworks_core_modules_optimization_versions, %i(item_type item_id), :name => 'core_optimize_versions'
15
+
16
+ end
17
+ end
@@ -0,0 +1,10 @@
1
+ class CreatePhcdevworksCoreModulesCategoriesOptimizations < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :phcdevworks_core_modules_categories_optimizations do |t|
4
+
5
+ t.integer :category_id
6
+ t.integer :optimization_id
7
+
8
+ end
9
+ end
10
+ end
@@ -1,6 +1,6 @@
1
- class CreatePhcdevworksCoreModulesModulesCategories < ActiveRecord::Migration[6.0]
1
+ class CreatePhcdevworksCoreModulesPostCategories < ActiveRecord::Migration[6.0]
2
2
  def change
3
- create_table :phcdevworks_core_modules_modules_categories do |t|
3
+ create_table :phcdevworks_core_modules_post_categories do |t|
4
4
 
5
5
  t.string :category_name
6
6
 
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksCoreModules
2
- VERSION = '1.0.0'
2
+ VERSION = '2.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcdevworks_core_modules
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2020-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -232,14 +232,14 @@ dependencies:
232
232
  requirements:
233
233
  - - "~>"
234
234
  - !ruby/object:Gem::Version
235
- version: '1.12'
235
+ version: '1.13'
236
236
  type: :runtime
237
237
  prerelease: false
238
238
  version_requirements: !ruby/object:Gem::Requirement
239
239
  requirements:
240
240
  - - "~>"
241
241
  - !ruby/object:Gem::Version
242
- version: '1.12'
242
+ version: '1.13'
243
243
  - !ruby/object:Gem::Dependency
244
244
  name: sqlite3
245
245
  requirement: !ruby/object:Gem::Requirement
@@ -266,29 +266,48 @@ files:
266
266
  - Rakefile
267
267
  - app/assets/config/phcdevworks_core_modules_manifest.js
268
268
  - app/assets/javascripts/phcdevworks_core_modules/application.js
269
+ - app/assets/javascripts/phcdevworks_core_modules/marketing/optimizations.coffee
270
+ - app/assets/javascripts/phcdevworks_core_modules/post/categories.coffee
269
271
  - app/assets/stylesheets/phcdevworks_core_modules/application.scss
272
+ - app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss
273
+ - app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss
274
+ - app/assets/stylesheets/scaffolds.scss
270
275
  - app/controllers/phcdevworks_core_modules/application_controller.rb
271
- - app/controllers/phcdevworks_core_modules/modules/categories_controller.rb
276
+ - app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb
277
+ - app/controllers/phcdevworks_core_modules/post/categories_controller.rb
272
278
  - app/helpers/phcdevworks_core_modules/application_helper.rb
273
- - app/helpers/phcdevworks_core_modules/modules/categories_helper.rb
279
+ - app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb
280
+ - app/helpers/phcdevworks_core_modules/post/categories_helper.rb
274
281
  - app/jobs/phcdevworks_core_modules/application_job.rb
275
282
  - app/mailers/phcdevworks_core_modules/application_mailer.rb
276
283
  - app/models/phcdevworks_core_modules/application_record.rb
277
284
  - app/models/phcdevworks_core_modules/core_category_versions.rb
285
+ - app/models/phcdevworks_core_modules/core_optimization_versions.rb
286
+ - app/models/phcdevworks_core_modules/marketing.rb
287
+ - app/models/phcdevworks_core_modules/marketing/optimization.rb
278
288
  - app/models/phcdevworks_core_modules/modules.rb
279
- - app/models/phcdevworks_core_modules/modules/category.rb
289
+ - app/models/phcdevworks_core_modules/post.rb
290
+ - app/models/phcdevworks_core_modules/post/category.rb
280
291
  - app/views/layouts/phcdevworks_core_modules/application.html.erb
281
292
  - app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb
282
293
  - app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb
283
294
  - app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb
284
- - app/views/phcdevworks_core_modules/modules/categories/_form.html.erb
285
- - app/views/phcdevworks_core_modules/modules/categories/edit.html.erb
286
- - app/views/phcdevworks_core_modules/modules/categories/index.html.erb
287
- - app/views/phcdevworks_core_modules/modules/categories/new.html.erb
288
- - app/views/phcdevworks_core_modules/modules/categories/show.html.erb
295
+ - app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb
296
+ - app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb
297
+ - app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb
298
+ - app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb
299
+ - app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb
300
+ - app/views/phcdevworks_core_modules/post/categories/_form.html.erb
301
+ - app/views/phcdevworks_core_modules/post/categories/edit.html.erb
302
+ - app/views/phcdevworks_core_modules/post/categories/index.html.erb
303
+ - app/views/phcdevworks_core_modules/post/categories/new.html.erb
304
+ - app/views/phcdevworks_core_modules/post/categories/show.html.erb
289
305
  - config/routes.rb
290
- - db/migrate/20170517064427_create_phcdevworks_core_category_versions.rb
291
- - db/migrate/20200629113153_create_phcdevworks_core_modules_modules_categories.rb
306
+ - db/migrate/20170517064427_create_phcdevworks_core_modules_category_versions.rb
307
+ - db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb
308
+ - db/migrate/20200705225433_create_phcdevworks_core_modules_optimization_versions.rb
309
+ - db/migrate/20200706091346_create_phcdevworks_core_modules_categories_optimizations.rb
310
+ - db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb
292
311
  - lib/phcdevworks_core_modules.rb
293
312
  - lib/phcdevworks_core_modules/engine.rb
294
313
  - lib/phcdevworks_core_modules/version.rb
@@ -1,81 +0,0 @@
1
- require_dependency "phcdevworks_core_modules/application_controller"
2
-
3
- module PhcdevworksCoreModules
4
- class Modules::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_modules_category, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /modules/categories
13
- def index
14
- @modules_categories = Modules::Category.all
15
- end
16
-
17
- # GET /modules/categories/1
18
- def show
19
- end
20
-
21
- # GET /modules/categories/new
22
- def new
23
- @modules_category = Modules::Category.new
24
- end
25
-
26
- # GET /modules/categories/1/edit
27
- def edit
28
- end
29
-
30
- # POST /modules/categories
31
- def create
32
- @modules_category = Modules::Category.new(modules_category_params)
33
- @modules_category.user_id = current_user.id
34
- @modules_category.org_id = current_user.org_id
35
- respond_to do |format|
36
- if @modules_category.save
37
- format.html { redirect_to modules_categories_path, :flash => { :success => 'Category has been Added.' }}
38
- format.json { render :show, status: :created, location: @modules_category }
39
- else
40
- format.html { render :new }
41
- format.json { render json: @modules_category.errors, status: :unprocessable_entity }
42
- end
43
- end
44
- end
45
-
46
- # PATCH/PUT /modules/categories/1
47
- def update
48
- respond_to do |format|
49
- if @modules_category.update(modules_category_params)
50
- format.html { redirect_to modules_categories_path, :flash => { :notice => 'Tutorial has been Updated.' }}
51
- format.json { render :show, status: :ok, location: @modules_category }
52
- else
53
- format.html { render :edit }
54
- format.json { render json: @modules_category.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # DELETE /modules/categories/1
60
- def destroy
61
- @modules_category.destroy
62
- respond_to do |format|
63
- format.html { redirect_to modules_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_modules_category
72
- @modules_category = Modules::Category.find(params[:id])
73
- end
74
-
75
- # Whitelist
76
- def modules_category_params
77
- params.require(:modules_category).permit(:category_name)
78
- end
79
-
80
- end
81
- end
@@ -1,9 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <strong>Category name:</strong>
5
- <%= @modules_category.category_name %>
6
- </p>
7
-
8
- <%= link_to 'Edit', edit_modules_category_path(@modules_category) %> |
9
- <%= link_to 'Back', modules_categories_path %>