phcpresspro 69.1.0 → 70.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +8 -1
  4. data/app/assets/javascripts/phcpresspro/application.js +4 -1
  5. data/app/assets/javascripts/phcpresspro/article/categories.js +3 -0
  6. data/app/assets/javascripts/phcpresspro/article/posts.js +2 -0
  7. data/app/assets/javascripts/phcpresspro/custom/custom.js +0 -0
  8. data/app/assets/stylesheets/phcpresspro/application.scss +3 -1
  9. data/app/assets/stylesheets/phcpresspro/article/categories.scss +0 -0
  10. data/app/assets/stylesheets/phcpresspro/article/posts.scss +0 -0
  11. data/app/controllers/phcpresspro/application_controller.rb +1 -1
  12. data/app/controllers/phcpresspro/article/categories_controller.rb +75 -0
  13. data/app/controllers/phcpresspro/article/posts_controller.rb +6 -7
  14. data/app/helpers/phcpresspro/article/categories_helper.rb +4 -0
  15. data/app/helpers/phcpresspro/article/posts_helper.rb +4 -0
  16. data/app/mailers/phcpresspro/application_mailer.rb +1 -1
  17. data/app/models/phcpresspro/{modules → article}/category.rb +2 -3
  18. data/app/models/phcpresspro/article/post.rb +3 -4
  19. data/app/views/layouts/phcpresspro/application.html.erb +2 -11
  20. data/app/views/layouts/phcpresspro/components/backend/footer/_footer.html.erb +1 -1
  21. data/app/views/layouts/phcpresspro/components/backend/sidebars/_side_menu.html.erb +4 -6
  22. data/app/views/phcpresspro/article/categories/_form.html.erb +13 -0
  23. data/app/views/phcpresspro/{modules → article}/categories/edit.html.erb +1 -1
  24. data/app/views/phcpresspro/{modules → article}/categories/index.html.erb +3 -3
  25. data/app/views/phcpresspro/{modules → article}/categories/new.html.erb +2 -2
  26. data/app/views/phcpresspro/article/categories/show.html.erb +9 -0
  27. data/app/views/phcpresspro/article/posts/_form.html.erb +14 -14
  28. data/app/views/phcpresspro/article/posts/index.html.erb +1 -1
  29. data/config/routes.rb +9 -16
  30. data/db/migrate/{20160718204718_create_phcpresspro_article_posts.rb → 20190315010932_create_phcpresspro_article_posts.rb} +2 -3
  31. data/db/migrate/{20160716182936_create_phcpresspro_modules_categories.rb → 20190315040834_create_phcpresspro_article_categories.rb} +2 -3
  32. data/db/migrate/20190315173237_create_phcpresspro_join_table_categories_posts.rb +8 -0
  33. data/lib/phcpresspro/version.rb +1 -1
  34. metadata +20 -43
  35. data/app/controllers/phcpresspro/api/v1/categories_controller.rb +0 -15
  36. data/app/controllers/phcpresspro/api/v1/posts_controller.rb +0 -20
  37. data/app/controllers/phcpresspro/frontend/article_controller.rb +0 -21
  38. data/app/controllers/phcpresspro/modules/categories_controller.rb +0 -75
  39. data/app/controllers/phcpresspro/modules/connections_controller.rb +0 -75
  40. data/app/models/phcpresspro/api/v1/category.rb +0 -4
  41. data/app/models/phcpresspro/api/v1/post.rb +0 -4
  42. data/app/models/phcpresspro/connection_versions.rb +0 -5
  43. data/app/models/phcpresspro/frontend/article.rb +0 -4
  44. data/app/models/phcpresspro/frontend.rb +0 -7
  45. data/app/models/phcpresspro/modules/connection.rb +0 -25
  46. data/app/models/phcpresspro/modules.rb +0 -7
  47. data/app/views/layouts/phcpresspro/components/frontend/footer/_footer.html.erb +0 -14
  48. data/app/views/layouts/phcpresspro/components/frontend/footer/_footer_copyright.html.erb +0 -21
  49. data/app/views/layouts/phcpresspro/components/frontend/header/_slideout.html.erb +0 -24
  50. data/app/views/layouts/phcpresspro/components/frontend/header/_topbar.html.erb +0 -17
  51. data/app/views/layouts/phcpresspro/components/frontend/navigation/_navigation.html.erb +0 -29
  52. data/app/views/layouts/phcpresspro/components/frontend/pages/_titlebars.html.erb +0 -14
  53. data/app/views/layouts/phcpresspro/components/frontend/seo/_seo_main.html.erb +0 -5
  54. data/app/views/layouts/phcpresspro/frontend.html.erb +0 -60
  55. data/app/views/phcpresspro/api/v1/categories/index.json.rabl +0 -2
  56. data/app/views/phcpresspro/api/v1/posts/index.json.rabl +0 -2
  57. data/app/views/phcpresspro/api/v1/posts/show.json.rabl +0 -2
  58. data/app/views/phcpresspro/frontend/article/index.html.erb +0 -69
  59. data/app/views/phcpresspro/frontend/article/show.html.erb +0 -58
  60. data/app/views/phcpresspro/modules/categories/_form.html.erb +0 -17
  61. data/app/views/phcpresspro/modules/categories/show.html.erb +0 -22
  62. data/app/views/phcpresspro/modules/connections/_form.html.erb +0 -21
  63. data/app/views/phcpresspro/modules/connections/edit.html.erb +0 -24
  64. data/app/views/phcpresspro/modules/connections/index.html.erb +0 -42
  65. data/app/views/phcpresspro/modules/connections/new.html.erb +0 -24
  66. data/app/views/phcpresspro/modules/connections/show.html.erb +0 -22
  67. data/db/migrate/20160719221205_create_phcpresspro_modules_connections.rb +0 -17
  68. data/db/migrate/20170517064114_create_phcpresspro_connection_versions.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0138333c244580dc30772861e545b87c60a720b855f644ae3c9d5021cb64056e'
4
- data.tar.gz: 39de8c705388577f132a97acb20ebd50138d3c3e127f4acd4ed24c1d85972102
3
+ metadata.gz: 568a5f49b83362679e43aaadabc34f79fa54a165743cf464d7080f0ca5894d69
4
+ data.tar.gz: 82c886ab0c714a0bc1a9890e8860c447587b0ea24f602a42d9b77ee67429b0c6
5
5
  SHA512:
6
- metadata.gz: 1a6a5e236bb6018dd4316e40f6a58525fa6e985ee558f152c03f6e7f1a043f447d64a6f960e9811c722d3de4604faf067a0ad852fc78ff62781a140c480c7593
7
- data.tar.gz: bef38fda5cc2535d9da09945ac99149e34a5a76e016884161f29fc6f72ce36680b0ecf701ef060951cf5c6bb77a6e5ce58ff3053cf9f8d9422f5958d98196498
6
+ metadata.gz: c87e78eb8cfe8d8291be7fe4d8eac05fd32531f02d56f11085cdb02547061a9c38e7f6152118c324a32e850f9654f578526fd81c1f1fa46f7962b6fd7568d12d
7
+ data.tar.gz: 68a7ec8af071cbaaa9e861f4edfbc9a0f0ad9077818e4a38eed93343c163c101d48026c424dae5570d0f2fa363a7a1ad2c1682f17dcd4ad6b9a7ad268e7be0ee
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2018 BradPotts
1
+ Copyright 2015-2019 PHCNetco PHCDevworks BradPotts
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ [![Gem Version](https://badge.fury.io/rb/phcpresspro.svg)](https://badge.fury.io/rb/phcpresspro)
2
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/bradpotts/phc-press-pro/blob/master/MIT-LICENSEru)
3
+
1
4
  ### PHCPress(PRO) (News/Blog Engine) Documentation
2
5
  PHCPress(PRO) rails CMS engine to manage your website's articles, categories and media.
3
6
 
@@ -7,7 +10,7 @@ PHCPress(PRO) rails CMS engine to manage your website's articles, categories and
7
10
 
8
11
  #### Step 1 - Add PHCPress to your gemfile and run command
9
12
 
10
- gem 'phcpresspro', '~> 63.0'
13
+ gem 'phcpresspro', '~> 59.0'
11
14
  bundle install
12
15
 
13
16
  #### Step 2 - Copy PHCPress Database Tables
@@ -31,3 +34,7 @@ To properly function re-compile your application's assets to copy over requried
31
34
  All PHCPress views and layouts can be overwritten by copying files to your application.
32
35
 
33
36
  rails generate phcpresspro:views
37
+
38
+ - [How to Override PHCPress Uploader](https://github.com/PHCNetworks/phc-press/wiki/Image-Uploader---Override)
39
+ - [How to Override Cloudinary Uploader](https://github.com/PHCNetworks/phc-press/wiki/Image-Uploader-(Cloudinary))
40
+ - [Critical Security Updates](https://github.com/PHCNetworks/phc-press/wiki/Critical-Security-Updates)
@@ -1,2 +1,5 @@
1
1
  // Load Admin Theme
2
- //= require phc_admin_theme_scripts_four
2
+ //= require phc_admin_theme_scripts_four
3
+ //= require phcpresspro/custom/custom
4
+ //= require phcpresspro/article/posts
5
+ //= requrie phcpresspro/article/categories
@@ -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,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -1,2 +1,4 @@
1
1
  // Load Admin Theme
2
- @import "phc_admin_theme_styles_four";
2
+ @import "phc_admin_theme_styles_four";
3
+ @import "article/posts";
4
+ @import "article/categories";
@@ -8,7 +8,7 @@ module Phcpresspro
8
8
  helper Phctitleseo::Engine.helpers
9
9
  helper Phcnotifi::Engine.helpers
10
10
  helper Phcaccountspro::Engine.helpers
11
-
11
+
12
12
  # Papertrail Whodunnit Username
13
13
  def user_for_paper_trail
14
14
  current_user ? current_user.username : 'Public user'
@@ -0,0 +1,75 @@
1
+ require_dependency "phcpresspro/application_controller"
2
+
3
+ module Phcpresspro
4
+ class Article::CategoriesController < ApplicationController
5
+
6
+ # Security & Action Filters
7
+ before_action :authenticate_user!
8
+ before_action :set_paper_trail_whodunnit
9
+ before_action :set_article_category, only: [:show, :edit, :update, :destroy]
10
+
11
+ # Categories Index
12
+ def index
13
+ @article_categories = Article::Category.where(org_id: current_user.org_id)
14
+ end
15
+
16
+ # Categories Show
17
+ def show
18
+ @article_category = Article::Category.friendly.find(params[:id])
19
+ @versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcpresspro::Article::Category')
20
+ end
21
+
22
+ # Categories New
23
+ def new
24
+ @article_category = Article::Category.new
25
+ @article_category.user_id = current_user.id
26
+ @article_category.org_id = current_user.org_id
27
+ end
28
+
29
+ # Categories Edit
30
+ def edit
31
+ end
32
+
33
+ # POST
34
+ def create
35
+ @article_category = Article::Category.new(article_category_params)
36
+ @article_category.user_id = current_user.id
37
+ @article_category.org_id = current_user.org_id
38
+ if @article_category.save
39
+ redirect_to article_categories_url, notice: 'Category was successfully created.'
40
+ else
41
+ render :new
42
+ end
43
+ end
44
+
45
+ # PATCH/PUT
46
+ def update
47
+ @article_category.user_id = current_user.id
48
+ @article_category.org_id = current_user.org_id
49
+ if @article_category.update(article_category_params)
50
+ redirect_to article_categories_url, notice: 'Category was successfully updated.'
51
+ else
52
+ render :edit
53
+ end
54
+ end
55
+
56
+ # DELETE
57
+ def destroy
58
+ @article_category.destroy
59
+ redirect_to article_categories_url, notice: 'Category was successfully destroyed.'
60
+ end
61
+
62
+ private
63
+
64
+ # Use callbacks to share common setup or constraints between actions.
65
+ def set_article_category
66
+ @article_category = Article::Category.find(params[:id])
67
+ end
68
+
69
+ # Only allow a trusted parameter "white list" through.
70
+ def article_category_params
71
+ params.require(:article_category).permit(:catname, :slug, :user_id, :org_id)
72
+ end
73
+
74
+ end
75
+ end
@@ -7,7 +7,6 @@ module Phcpresspro
7
7
  before_action :authenticate_user!
8
8
  before_action :set_paper_trail_whodunnit
9
9
  before_action :set_article_post, only: [:show, :edit, :update, :destroy]
10
- layout "phcpresspro/application"
11
10
 
12
11
  # Article Index
13
12
  def index
@@ -51,8 +50,8 @@ module Phcpresspro
51
50
  if @article_post.update(article_post_params)
52
51
  @article_post.connections.build
53
52
  redirect_to article_posts_url, notice: 'Post was successfully updated.'
54
- else
55
- render :edit
53
+ else
54
+ render :edit
56
55
  end
57
56
  end
58
57
 
@@ -64,14 +63,14 @@ module Phcpresspro
64
63
 
65
64
  private
66
65
 
67
- # Common Callbacks
66
+ # Use callbacks to share common setup or constraints between actions.
68
67
  def set_article_post
69
- @article_post = Article::Post.friendly.find(params[:id])
68
+ @article_post = Article::Post.find(params[:id])
70
69
  end
71
70
 
72
- # Params Whitelist
71
+ # Only allow a trusted parameter "white list" through.
73
72
  def article_post_params
74
- params.require(:article_post).permit(:psttitle, :psttext, :pststatus, :pstimage, :remove_pstimage, :slug, :user_id, :org_id, category_ids: [])
73
+ params.require(:article_post).permit(:psttittle, :psttext, :pststatus, :pstimage, :remove_pstimage, :slug, :user_id, :org_id, category_ids: [])
75
74
  end
76
75
 
77
76
  end
@@ -0,0 +1,4 @@
1
+ module Phcpresspro
2
+ module Article::CategoriesHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Phcpresspro
2
+ module Article::PostsHelper
3
+ end
4
+ end
@@ -1,6 +1,6 @@
1
1
  module Phcpresspro
2
2
  class ApplicationMailer < ActionMailer::Base
3
- default from: 'no-reply@phcnetworks.net'
3
+ default from: 'from@example.com'
4
4
  layout 'mailer'
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  module Phcpresspro
2
- class Modules::Category < ApplicationRecord
2
+ class Article::Category < ApplicationRecord
3
3
 
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
@@ -8,8 +8,7 @@ module Phcpresspro
8
8
  has_paper_trail :class_name => 'Phcpresspro::CategoryVersions'
9
9
 
10
10
  # Relationships
11
- has_many :connections, class_name: 'Phcpresspro::Modules::Connection', dependent: :destroy
12
- has_many :posts, class_name: 'Phcpresspro::Modules::Category', :through => :connections
11
+ has_many :posts, class_name: 'Phcpresspro::Article::Post'
13
12
 
14
13
  # Validation for Form Fields
15
14
  validates :catname,
@@ -11,11 +11,10 @@ module Phcpresspro
11
11
  has_one_attached :pstimage
12
12
 
13
13
  # Model Relationships
14
- has_many :connections, class_name: 'Phcpresspro::Modules::Connection', dependent: :destroy
15
- has_many :categories, class_name: 'Phcpresspro::Modules::Category', :through => :connections
14
+ has_many :categories, class_name: 'Phcpresspro::Article::Category'
16
15
 
17
16
  # Validation for Form Fields
18
- validates :psttitle,
17
+ validates :psttittle,
19
18
  presence: true,
20
19
  length: { minimum: 3 }
21
20
 
@@ -32,7 +31,7 @@ module Phcpresspro
32
31
  # Define for Multiple Records
33
32
  def phcpresspro_post_slug
34
33
  [
35
- [:psttitle]
34
+ [:psttittle]
36
35
  ]
37
36
  end
38
37
 
@@ -16,7 +16,7 @@
16
16
  <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400%7CRaleway:300,400,500,600,700%7CLato:300,400,400italic,600,700"/>
17
17
 
18
18
  <!-- Requried Style Sheets -->
19
- <%= stylesheet_link_tag "backend", media: "all", 'data-turbolinks-track': 'reload' %>
19
+ <%= stylesheet_link_tag "phcpresspro/application", media: "all", 'data-turbolinks-track': 'reload' %>
20
20
 
21
21
  <!-- Security -->
22
22
  <%= csrf_meta_tags %>
@@ -61,17 +61,8 @@
61
61
  <!-- Page Container -->
62
62
 
63
63
  <!-- Requried JavaScripts -->
64
- <%= javascript_include_tag "backend", 'data-turbolinks-track': 'reload' %>
64
+ <%= javascript_include_tag "phcpresspro/application", 'data-turbolinks-track': 'reload' %>
65
65
  <script src="https://cdn.ckeditor.com/4.10.0/full/ckeditor.js"></script>
66
-
67
- <!-- WTF Slowing Down my Site. Nothing Nice to Say. Keep Bad Comments to Myself -->
68
- <!--[if lt IE 9]>
69
- <script src="https://frmwrks.phcnetworks.net/coloradmin/version-latest/admin/template/assets/crossbrowserjs/html5shiv.js"></script>
70
- <script src="https://frmwrks.phcnetworks.net/coloradmin/version-latest/admin/template/assets/crossbrowserjs/respond.min.js"></script>
71
- <script src="https://frmwrks.phcnetworks.net/coloradmin/version-latest/admin/template/assets/crossbrowserjs/excanvas.min.js"></script>
72
- <![endif]-->
73
- <!-- WTF Slowing Down my Site. Nothing Nice to Say. Keep Bad Comments to Myself -->
74
-
75
66
  <script>
76
67
  $(document).ready(function() {
77
68
  App.init();
@@ -1 +1 @@
1
- <span class="float-left">&copy; 2012-<%= Time.now.year %> - <strong>PHC</strong>Press(Pro) Engine v<%= Gem.loaded_specs["phcpresspro"].version.to_s %></span> <span class="float-right">Developed with <i class="fas fa-heart hanna_hearts"></i> by <strong>PHC</strong>Networks</span>
1
+ <span class="float-left">&copy; 2012-<%= Time.now.year %> - <strong>PHC</strong>Press(Pro) Engine v<%= Gem.loaded_specs["phcpresspro"].version.to_s %></span> <span class="float-right">Developed with <i class="fas fa-heart hanna_hearts"></i> by <strong>PHC</strong>Devworks</span>
@@ -44,8 +44,8 @@
44
44
  <span>Article Posts</span>
45
45
  </a>
46
46
  <ul class="sub-menu">
47
- <li><%= link_to('Article Index', phcpresspro.article_posts_path) %></li>
48
- <li><%= link_to('New Aritcle', phcpresspro.new_article_post_path) %></li>
47
+ <li class="<%= is_active_controller('phcpresspro/article/posts') %>"><%= link_to('Article Index', phcpresspro.article_posts_path) %></li>
48
+ <li class="<%= is_active_controller('phcpresspro/article/posts#new') %>"><%= link_to('New Aritcle', phcpresspro.new_article_post_path) %></li>
49
49
  </ul>
50
50
  </li>
51
51
  <li class="has-sub">
@@ -55,10 +55,8 @@
55
55
  <span>Article Categories</span>
56
56
  </a>
57
57
  <ul class="sub-menu">
58
- <li><%= link_to('Category Index', phcpresspro.modules_categories_path) %></li>
59
- <li><%= link_to('New Category', phcpresspro.new_modules_category_path) %></li>
60
- <li><%= link_to('Category Manager', phcpresspro.modules_connections_path) %></li>
61
- <li><%= link_to('Connect Article', phcpresspro.new_modules_connection_path) %></li>
58
+ <li class="<%= is_active_controller('phcpresspro/article/categories') %>"><%= link_to('Category Index', phcpresspro.article_categories_path) %></li>
59
+ <li class="<%= is_active_controller('phcpresspro/article/categories#new') %>"><%= link_to('New Category', phcpresspro.new_article_category_path) %></li>
62
60
  </ul>
63
61
  </li>
64
62
  <!-- Sidebar - Sidebar Navigation - PHCPressPro -->
@@ -0,0 +1,13 @@
1
+ <%= form_with(model: article_category, local: true) do |form| %>
2
+
3
+ <!-- PHCPressPro - Category Form -->
4
+ <div class="form-group">
5
+ <%= form.label :catname, "Category Name" %>
6
+ <%= form.text_field :catname, class: "form-control" %>
7
+ </div>
8
+ <div class="actions">
9
+ <%= form.submit class: "btn btn-primary" %>
10
+ </div>
11
+ <!-- PHCPressPro - Category Form -->
12
+
13
+ <% end %>
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
  <div class="panel-body">
19
19
  <!-- Table - Category Edit Form -->
20
- <%= render 'form', modules_category: @modules_category %>
20
+ <%= render 'form', article_category: @article_category %>
21
21
  <!-- Table - Category Edit Form -->
22
22
  </div>
23
23
  </div>
@@ -25,10 +25,10 @@
25
25
  </tr>
26
26
  </thead>
27
27
  <tbody>
28
- <% @modules_categories.each do |modules_category| %>
28
+ <% @article_categories.each do |article_category| %>
29
29
  <tr>
30
- <td><%= link_to modules_category.catname, phcpresspro.edit_modules_category_path(modules_category) %></td>
31
- <td><%= link_to 'Trash', modules_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %></td>
30
+ <td><%= link_to article_category.catname, phcpresspro.edit_article_category_path(article_category) %></td>
31
+ <td><%= link_to 'Trash', article_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %></td>
32
32
  </tr>
33
33
  <% end %>
34
34
  </tbody>
@@ -1,7 +1,7 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Plugin: Article Category Manager" %>
3
3
  <% phc_title_tagline "Create a New Category" %>
4
- <% phc_breadcrumb_one link_to "Category Index", phcpresspro.modules_categories_path %>
4
+ <% phc_breadcrumb_one link_to "Category Index", phcpresspro.article_categories_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
  <div class="panel-body">
19
19
  <!-- Table - Category New Form -->
20
- <%= render 'form', modules_category: @modules_category %>
20
+ <%= render 'form', article_category: @article_category %>
21
21
  <!-- Table - Category New Form -->
22
22
  </div>
23
23
  </div>
@@ -0,0 +1,9 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Catname:</strong>
5
+ <%= @article_category.catname %>
6
+ </p>
7
+
8
+ <%= link_to 'Edit', edit_article_category_path(@article_category) %> |
9
+ <%= link_to 'Back', article_categories_path %>
@@ -1,4 +1,4 @@
1
- <%= form_for(@article_post, :html => {:multipart => true}) do |f| %>
1
+ <%= form_with(model: article_post, local: true) do |form| %>
2
2
  <div class="row">
3
3
  <div class="col-md-3">
4
4
 
@@ -8,11 +8,11 @@
8
8
  </div>
9
9
  <div class="panel-body">
10
10
  <div class="form-group">
11
- <%= f.label :pststatus, "Post Status" %>
12
- <%= f.select( :pststatus, [['Draft','draft'],['Published','published'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
11
+ <%= form.label :pststatus, "Post Status" %>
12
+ <%= form.select( :pststatus, [['Draft','draft'],['Published','published'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
13
13
  </div>
14
14
  <div class="actions">
15
- <%= f.submit class: "btn btn-primary waves-effect" %>
15
+ <%= form.submit class: "btn btn-primary waves-effect" %>
16
16
  </div>
17
17
  </div>
18
18
  </div>
@@ -23,13 +23,13 @@
23
23
  </div>
24
24
  <div class="panel-body">
25
25
  <div class="form-group">
26
- <%= f.label :pstimage, "Featured Image" %>
27
- <%= f.file_field :pstimage, class: "form-control" %>
26
+ <%= form.label :pstimage, "Featured Image" %>
27
+ <%= form.file_field :pstimage, class: "form-control" %>
28
28
  </div>
29
- <% if f.object.pstimage? %>
30
- <%= image_tag f.object.pstimage_url, class: "img-responsive img-thumbnail" %>
31
- <%= f.label :remove_pstimage %>
32
- <%= f.check_box :remove_pstimage %>
29
+ <% if form.object.pstimage? %>
30
+ <%= image_tag form.object.pstimage_url, class: "img-responsive img-thumbnail" %>
31
+ <%= form.label :remove_pstimage %>
32
+ <%= form.check_box :remove_pstimage %>
33
33
  <% end %>
34
34
  </div>
35
35
  </div>
@@ -39,7 +39,7 @@
39
39
  <h4 class="panel-title">Post Categories</h4>
40
40
  </div>
41
41
  <div class="panel-body">
42
- <%= f.collection_check_boxes :category_ids, Phcpresspro::Modules::Category.all, :id, :catname do |post_category| %>
42
+ <%= form.collection_check_boxes :category_ids, Phcpresspro::Article::Category.all, :id, :catname do |post_category| %>
43
43
  <%= post_category.check_box %>
44
44
  <%= post_category.label %></br>
45
45
  <% end %>
@@ -54,8 +54,8 @@
54
54
  <!-- PHCNotifi Render Validation -->
55
55
 
56
56
  <div class="form-group">
57
- <%= f.label :psttitle, "Article Title" %>
58
- <%= f.text_field :psttitle, class: "form-control" %>
57
+ <%= form.label :psttittle, "Article Title" %>
58
+ <%= form.text_field :psttittle, class: "form-control" %>
59
59
  </div>
60
60
 
61
61
  <div class="panel panel-inverse">
@@ -69,7 +69,7 @@
69
69
  </div>
70
70
  <div class="panel-body panel-form">
71
71
  <div class="form-group">
72
- <%= f.text_area :psttext, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
72
+ <%= form.text_area :psttext, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
73
73
  </div>
74
74
  </div>
75
75
  </div>
@@ -30,7 +30,7 @@
30
30
  <tbody>
31
31
  <% @article_posts.each do |article_post| %>
32
32
  <tr>
33
- <td><%= article_post.psttitle %></td>
33
+ <td><%= article_post.psttittle %></td>
34
34
  <td><%= truncate(article_post.psttext, :length => 80, :escape => false) %></td>
35
35
  <td><%= article_post.pststatus.capitalize %></td>
36
36
  <td><div class="btn-group" role="group" aria-label="Blog Articles">
data/config/routes.rb CHANGED
@@ -1,11 +1,15 @@
1
1
  Phcpresspro::Engine.routes.draw do
2
2
 
3
- # Frontend
4
- namespace :frontend do
5
- resources :articles
3
+ # Add Accounts and Logins
4
+ mount Phcaccountspro::Engine => "/"
5
+
6
+ # Application Routes
7
+ namespace :article do
8
+ resources :categories, class_name: 'Phcpresspro::Articles::Category'
9
+ resources :posts, class_name: 'Phcpresspro::Articles::Post'
6
10
  end
7
-
8
- # API
11
+
12
+ # Application API
9
13
  namespace :api do
10
14
  namespace :v1 do
11
15
  resources :posts, defaults: {format: 'json'}
@@ -13,15 +17,4 @@ Phcpresspro::Engine.routes.draw do
13
17
  end
14
18
  end
15
19
 
16
- # Article Routes
17
- namespace :article do
18
- resources :posts, class_name: 'Phcpresspro::Articles::Post'
19
- end
20
-
21
- # Module Routes
22
- namespace :modules do
23
- resources :connections, class_name: 'Phcpresspro::Modules::Connection'
24
- resources :categories, class_name: 'Phcpresspro::Modules::Category'
25
- end
26
-
27
20
  end
@@ -2,13 +2,12 @@ class CreatePhcpressproArticlePosts < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :phcpresspro_article_posts do |t|
4
4
 
5
- t.string :psttitle
6
- t.text :psttext
5
+ t.string :psttittle
6
+ t.string :psttext
7
7
  t.string :pststatus
8
8
  t.string :pstimage
9
9
 
10
10
  t.string :slug
11
-
12
11
  t.string :user_id
13
12
  t.string :org_id
14
13
 
@@ -1,11 +1,10 @@
1
- class CreatePhcpressproModulesCategories < ActiveRecord::Migration[5.2]
1
+ class CreatePhcpressproArticleCategories < ActiveRecord::Migration[5.2]
2
2
  def change
3
- create_table :phcpresspro_modules_categories do |t|
3
+ create_table :phcpresspro_article_categories do |t|
4
4
 
5
5
  t.string :catname
6
6
 
7
7
  t.string :slug
8
-
9
8
  t.string :user_id
10
9
  t.string :org_id
11
10
 
@@ -0,0 +1,8 @@
1
+ class CreatePhcpressproJoinTableCategoriesPosts < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_join_table :categories, :posts do |t|
4
+ # t.index [:category_id, :post_id]
5
+ # t.index [:post_id, :category_id]
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module Phcpresspro
2
- VERSION = "69.1.0"
2
+ VERSION = "70.0.0"
3
3
  end