phcdevworks_core_modules 0.3.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) 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/marketing.rb +7 -0
  12. data/app/models/phcdevworks_core_modules/marketing/optimization.rb +54 -0
  13. data/app/models/phcdevworks_core_modules/marketing_optimization_versions.rb +5 -0
  14. data/app/models/phcdevworks_core_modules/post.rb +7 -0
  15. data/app/models/phcdevworks_core_modules/post/category.rb +43 -0
  16. data/app/models/phcdevworks_core_modules/post_category_versions.rb +5 -0
  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 +75 -80
  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 +10 -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_post_category_versions.rb +17 -0
  31. data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +26 -0
  32. data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb +17 -0
  33. data/db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb +17 -0
  34. data/lib/phcdevworks_core_modules/engine.rb +1 -1
  35. data/lib/phcdevworks_core_modules/version.rb +1 -1
  36. metadata +34 -16
  37. data/app/controllers/phcdevworks_core_modules/modules/categories_controller.rb +0 -81
  38. data/app/models/phcdevworks_core_modules/core_category_versions.rb +0 -5
  39. data/app/models/phcdevworks_core_modules/modules/category.rb +0 -27
  40. data/app/views/phcdevworks_core_modules/modules/categories/show.html.erb +0 -9
  41. data/db/migrate/20170517064427_create_phcdevworks_core_category_versions.rb +0 -17
  42. data/db/migrate/20200629113153_create_phcdevworks_core_modules_modules_categories.rb +0 -15
@@ -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 -->
@@ -10,6 +10,11 @@
10
10
  <%= form.label :category_name, "Category Name" %>
11
11
  <%= form.text_field :category_name, class: "form-control" %>
12
12
  </div>
13
+
14
+ <div class="form-group">
15
+ <label>Attach SEO Data</label>
16
+ <%= collection_select(:post_category, :optimization_id, PhcdevworksCoreModules::Marketing::Optimization.order("seo_title"), :id, :seo_title, {}, {class: "form-control"}) %>
17
+ </div>
13
18
  <!-- Form Input Fields -->
14
19
 
15
20
  <!-- Form Submition Button -->
@@ -19,4 +24,4 @@
19
24
  <!-- For Submition Button -->
20
25
 
21
26
  <% end %>
22
- <!-- Form - Command - Post -->
27
+ <!-- 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