phcpresspro 82.0.0 → 83.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/app/assets/javascripts/phcpresspro/application.js +0 -3
  4. data/app/assets/stylesheets/phcpresspro/application.scss +0 -2
  5. data/app/controllers/phcpresspro/api/v1/post_index.json.rabl +2 -2
  6. data/app/controllers/phcpresspro/api/v1/post_single.json.rabl +2 -2
  7. data/app/controllers/phcpresspro/application_controller.rb +19 -19
  8. data/app/controllers/phcpresspro/article/categories_controller.rb +15 -16
  9. data/app/controllers/phcpresspro/article/posts_controller.rb +17 -18
  10. data/app/controllers/phcpresspro/blog/articles_controller.rb +5 -5
  11. data/app/models/phcpresspro/article/category.rb +7 -11
  12. data/app/models/phcpresspro/article/post.rb +8 -16
  13. data/app/views/layouts/phcpresspro/application.html.erb +8 -12
  14. data/app/views/layouts/phcpresspro/components/backend/footer/_footer.html.erb +5 -5
  15. data/app/views/layouts/phcpresspro/components/backend/navigation/_top_menu.html.erb +0 -41
  16. data/app/views/layouts/phcpresspro/components/backend/sidebars/_side_menu.html.erb +68 -61
  17. data/app/views/phcpresspro/article/categories/_form.html.erb +12 -3
  18. data/app/views/phcpresspro/article/categories/edit.html.erb +15 -3
  19. data/app/views/phcpresspro/article/categories/index.html.erb +23 -15
  20. data/app/views/phcpresspro/article/categories/new.html.erb +15 -3
  21. data/app/views/phcpresspro/article/posts/_form.html.erb +22 -14
  22. data/app/views/phcpresspro/article/posts/edit.html.erb +3 -3
  23. data/app/views/phcpresspro/article/posts/index.html.erb +25 -20
  24. data/app/views/phcpresspro/article/posts/new.html.erb +3 -3
  25. data/app/views/phcpresspro/blog/articles/index.html.erb +57 -57
  26. data/config/routes.rb +13 -13
  27. data/db/migrate/20190315010932_create_phcpresspro_article_posts.rb +1 -1
  28. data/lib/phcpresspro/engine.rb +67 -66
  29. data/lib/phcpresspro/version.rb +1 -1
  30. data/lib/phcpresspro.rb +0 -1
  31. metadata +62 -72
  32. data/app/assets/javascripts/phcpresspro/article/categories.js +0 -3
  33. data/app/assets/javascripts/phcpresspro/article/posts.js +0 -2
  34. data/app/assets/javascripts/phcpresspro/blog/articles.js +0 -0
  35. data/app/assets/javascripts/phcpresspro/custom/custom.js +0 -0
  36. data/app/assets/stylesheets/phcpresspro/article/categories.scss +0 -0
  37. data/app/assets/stylesheets/phcpresspro/article/posts.scss +0 -0
  38. data/app/assets/stylesheets/phcpresspro/blog/articles.scss +0 -3
  39. data/app/helpers/phcpresspro/blog/articles_helper.rb +0 -4
  40. data/app/views/phcpresspro/article/categories/show.html.erb +0 -9
  41. data/app/views/phcpresspro/article/posts/show.html.erb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a052a0cd5fcd5cbfa1e325ed796d713c668a3bf49c7b8072d7acf8a2bdde16ca
4
- data.tar.gz: 3d14bdb7a22bbbee6d1a80d6a2c70160c3df3feeb02d40b0a92a55d9e9212df4
3
+ metadata.gz: 3bb90277a5d7d57ce20b5ae8ff24ec31a5c1be8a25c9c9000e63e2f62c96f095
4
+ data.tar.gz: 1c1654ca8a48ec5e83bb7d8171462f14bb51fc9b4615f417a59aee812b451f89
5
5
  SHA512:
6
- metadata.gz: 128f540b6349892e4f7ae8f7d9b085893c5b1ab3f0a7e42c1b02d2a79c23dd98831fe168c7e9b87e4bf4406d16b339da48f040bf4a669c16105d1f8827f469cc
7
- data.tar.gz: 35cd0b118152320577f36550a7c2839c8f1cc9def7ee433123ff345d0ada2e510df12401ce725a638b8dffca63f3960624bf7c65200186348ca75aa00be8ab4c
6
+ metadata.gz: 5d858e20043c7099ac9c365596434b8ae2b54fcac4deb870f445494e12f09c9b67cbcc2f1b361b6adbca46e09afdabcb51c6acd36c608072cf225be72b0c4845
7
+ data.tar.gz: b80357105d349f61e091717350e311890d2679062bd91d3cd677a66079c4e82e0f3ea83a36835fe16fd20d42ccfdab854e95fb145700187e4d043a1cfedc55fb
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2012-2019 BradPotts - PHCNetco/PHCDevworks/PHCNetworks
1
+ Copyright 2012-2019 BradPotts - PHCNetCo/PHCDevworks/PHCNetworks
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
@@ -1,5 +1,2 @@
1
1
  // Load Admin Theme
2
2
  //= require phc_admin_theme_scripts_four
3
- //= require phcpresspro/custom/custom
4
- //= require phcpresspro/article/posts
5
- //= requrie phcpresspro/article/categories
@@ -1,4 +1,2 @@
1
1
  // Load Admin Theme
2
2
  @import "phc_admin_theme_styles_four";
3
- @import "article/posts";
4
- @import "article/categories";
@@ -1,2 +1,2 @@
1
- object @phcpresspro_posts_index
2
- attributes :id, :psttittle, :psttext, :pststatus, :pstimage
1
+ object @phcpress_posts_index
2
+ attributes :id, :post_title, :post_text, :post_status
@@ -1,2 +1,2 @@
1
- object @phcpresspro_posts_single
2
- attributes :id, :psttittle, :psttext, :pststatus, :pstimage
1
+ object @phcpress_posts_single
2
+ attributes :id, :post_title, :post_text, :post_status
@@ -1,22 +1,22 @@
1
1
  module Phcpresspro
2
- class ApplicationController < ActionController::Base
3
-
4
- # Security Filters
5
- protect_from_forgery with: :exception
6
-
7
- # Load Requried Helper Files
8
- helper Phccorehelpers::Engine.helpers
9
- helper Phcmenus::Engine.helpers
10
- helper Phctitleseo::Engine.helpers
11
- helper Phcnotifi::Engine.helpers
12
- helper Phcaccountspro::Engine.helpers
13
-
14
- # Papertrail Whodunnit Username
15
- def user_for_paper_trail
16
- current_user ? current_user.username : 'Public user'
17
- end
18
-
19
- private
20
-
2
+ class ApplicationController < ActionController::Base
3
+
4
+ # Security Filters
5
+ protect_from_forgery with: :exception
6
+
7
+ # Load Requried Helper Files
8
+ helper Phcaccountspro::Engine.helpers
9
+ helper Phccorehelpers::Engine.helpers
10
+ helper Phcmenus::Engine.helpers
11
+ helper Phctitleseo::Engine.helpers
12
+ helper Phcnotifi::Engine.helpers
13
+
14
+ # Papertrail Whodunnit Username
15
+ def user_for_paper_trail
16
+ current_user ? current_user.username : 'Public user'
21
17
  end
18
+
19
+ private
20
+
21
+ end
22
22
  end
@@ -7,44 +7,43 @@ module Phcpresspro
7
7
  include Phccorehelpers::PhcpluginsproHelper
8
8
  before_action :authenticate_user!
9
9
  before_action :set_paper_trail_whodunnit
10
- before_action :set_article_category, only: [:show, :edit, :update, :destroy]
10
+ before_action :set_article_category, only: [:edit, :update, :destroy]
11
11
 
12
- # Categories Index
12
+ # INDEX
13
13
  def index
14
- @article_categories = Phcpresspro::Article::Category.where(org_id: current_user.org_id)
14
+ @article_categories = Phcpresspro::Article::Category.all
15
15
  end
16
16
 
17
- # Categories Show
17
+ # SHOW
18
18
  def show
19
19
  @article_category = Phcpresspro::Article::Category.friendly.find(params[:id])
20
20
  @versions = Phcpresspro::CategoryVersions.where(item_id: params[:id], item_type: 'Phcpresspro::Article::Category')
21
21
  end
22
22
 
23
- # Categories New
23
+ # NEW
24
24
  def new
25
25
  @article_category = Phcpresspro::Article::Category.new
26
26
  end
27
27
 
28
- # Categories Edit
28
+ # EDIT
29
29
  def edit
30
30
  end
31
31
 
32
- # POST
32
+ # CREATE
33
33
  def create
34
34
  @article_category = Phcpresspro::Article::Category.new(article_category_params)
35
35
  @article_category.user_id = current_user.id
36
- @article_category.org_id = current_user.org_id
37
36
  if @article_category.save
38
- redirect_to article_categories_url, notice: 'Category was successfully created.'
37
+ redirect_to article_categories_url, :flash => { :success => 'Category was successfully created.' }
39
38
  else
40
- render :new
39
+ render :new
41
40
  end
42
41
  end
43
42
 
44
- # PATCH/PUT
43
+ # UPDATE
45
44
  def update
46
45
  if @article_category.update(article_category_params)
47
- redirect_to article_categories_url, notice: 'Category was successfully updated.'
46
+ redirect_to article_categories_url, :flash => { :success => 'Category was successfully updated.' }
48
47
  else
49
48
  render :edit
50
49
  end
@@ -53,19 +52,19 @@ module Phcpresspro
53
52
  # DELETE
54
53
  def destroy
55
54
  @article_category.destroy
56
- redirect_to article_categories_url, notice: 'Category was successfully destroyed.'
55
+ redirect_to article_categories_url, :flash => { :success => 'Category was successfully destroyed.' }
57
56
  end
58
57
 
59
58
  private
60
59
 
61
- # Use callbacks to share common setup or constraints between actions.
60
+ # Common Callbacks
62
61
  def set_article_category
63
62
  @article_category = Phcpresspro::Article::Category.find(params[:id])
64
63
  end
65
64
 
66
- # Only allow a trusted parameter "white list" through.
65
+ # Whitelist
67
66
  def article_category_params
68
- params.require(:article_category).permit(:category_name, :slug, :user_id, :org_id)
67
+ params.require(:article_category).permit(:category_name, :slug, :user_id)
69
68
  end
70
69
 
71
70
  end
@@ -7,44 +7,43 @@ module Phcpresspro
7
7
  include Phccorehelpers::PhcpluginsproHelper
8
8
  before_action :authenticate_user!
9
9
  before_action :set_paper_trail_whodunnit
10
- before_action :set_article_post, only: [:show, :edit, :update, :destroy]
10
+ before_action :set_article_post, only: [:edit, :update, :destroy]
11
11
 
12
- # Article Index
12
+ # INDEX
13
13
  def index
14
- @article_posts = Phcpresspro::Article::Post.where(org_id: current_user.org_id)
14
+ @article_posts = Phcpresspro::Article::Post.all
15
15
  end
16
16
 
17
- # Article Show
17
+ # SHOW
18
18
  def show
19
19
  @article_post = Phcpresspro::Article::Post.friendly.find(params[:id])
20
20
  @versions = Phcpresspro::PostVersions.where(item_id: params[:id], item_type: 'Phcpresspro::Article::Post')
21
21
  end
22
22
 
23
- # Article New
23
+ # NEW
24
24
  def new
25
25
  @article_post = Phcpresspro::Article::Post.new
26
26
  end
27
27
 
28
- # Article Edit
28
+ # EDIT
29
29
  def edit
30
30
  end
31
31
 
32
- # POST
32
+ # CREATE
33
33
  def create
34
34
  @article_post = Phcpresspro::Article::Post.new(article_post_params)
35
35
  @article_post.user_id = current_user.id
36
- @article_post.org_id = current_user.org_id
37
36
  if @article_post.save
38
- redirect_to article_posts_url, notice: 'Post was successfully created.'
39
- else
40
- render :new
37
+ redirect_to article_posts_url, :flash => { :success => 'Post was successfully created.' }
38
+ else
39
+ render :new
41
40
  end
42
41
  end
43
42
 
44
- # PATCH/PUT
43
+ # UPDATE
45
44
  def update
46
45
  if @article_post.update(article_post_params)
47
- redirect_to article_posts_url, notice: 'Post was successfully updated.'
46
+ redirect_to article_posts_url, :flash => { :success => 'Post was successfully updated.' }
48
47
  else
49
48
  render :edit
50
49
  end
@@ -52,20 +51,20 @@ module Phcpresspro
52
51
 
53
52
  # DELETE
54
53
  def destroy
55
- @article_post.destroy
56
- redirect_to article_posts_url, notice: 'Post was successfully destroyed.'
54
+ @article_post.destroy
55
+ redirect_to article_posts_url, :flash => { :error => 'Post was successfully destroyed.' }
57
56
  end
58
57
 
59
58
  private
60
59
 
61
- # Use callbacks to share common setup or constraints between actions.
60
+ # Common Callbacks
62
61
  def set_article_post
63
62
  @article_post = Phcpresspro::Article::Post.find(params[:id])
64
63
  end
65
64
 
66
- # Only allow a trusted parameter "white list" through.
65
+ # Whitelist
67
66
  def article_post_params
68
- params.require(:article_post).permit(:post_tittle, :post_text, :post_status, :post_image, :remove_post_image, :slug, :user_id, :org_id, category_ids: [])
67
+ params.require(:article_post).permit(:post_title, :post_text, :post_status, :post_image, :remove_post_image, :slug, :user_id, category_ids: [])
69
68
  end
70
69
 
71
70
  end
@@ -3,17 +3,17 @@ require_dependency "phcpresspro/application_controller"
3
3
  module Phcpresspro
4
4
  class Blog::ArticlesController < ApplicationController
5
5
 
6
- # Security, Layouts & Action Filters
6
+ # Layout
7
7
  layout 'phcpresspro/frontend'
8
8
 
9
- # Index for All Published Posts
9
+ # INDEX
10
10
  def index
11
- @phcpresspro_posts_index = Article::Post.where(pststatus: "published")
11
+ @phcpress_posts_index = Article::Post.where(pststatus: "published")
12
12
  end
13
13
 
14
- # Single Page for Published Post
14
+ # SHOW
15
15
  def show
16
- @phcpresspro_posts_single = Article::Post.friendly.find(params[:id])
16
+ @phcpress_posts_single = Article::Post.friendly.find(params[:id])
17
17
  end
18
18
 
19
19
  end
@@ -4,27 +4,23 @@ module Phcpresspro
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
7
- # Add Paper Trail
7
+ # Paper Trail Initialize
8
8
  has_paper_trail :class_name => 'Phcpresspro::CategoryVersions'
9
9
 
10
10
  # Relationships
11
- has_and_belongs_to_many :posts, class_name: 'Phcpresspro::Article::Post', :join_table => 'categories_posts'
11
+ has_and_belongs_to_many :posts, class_name: 'Phcpresspro::Article::Post', :join_table => 'categories_posts', :dependent => :destroy
12
12
  belongs_to :user, class_name: 'Phcaccountspro::User'
13
13
 
14
- # Validation for Form Fields
14
+ # Form Fields Validation
15
15
  validates :category_name,
16
16
  presence: true,
17
- uniqueness: true,
18
- length: { minimum: 3 }
17
+ uniqueness: true
19
18
 
20
19
  # Clean URL Define
21
- friendly_id :phcpresspro_category_slug, use: [:slugged, :finders]
20
+ friendly_id :phc_nice_url_slug, use: [:slugged, :finders]
22
21
 
23
- # Define for Multiple Records
24
- def phcpresspro_category_slug
25
- [
26
- [:org_id, :category_name]
27
- ]
22
+ def phc_nice_url_slug
23
+ [:category_name]
28
24
  end
29
25
 
30
26
  end
@@ -4,36 +4,28 @@ module Phcpresspro
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
7
- # Add Paper Trail
7
+ # Paper Trail Initialize
8
8
  has_paper_trail :class_name => 'Phcpresspro::PostVersions'
9
9
 
10
10
  # Image Upload
11
11
  has_one_attached :post_image
12
12
 
13
- # Model Relationships
13
+ # Relationships
14
14
  has_and_belongs_to_many :categories, class_name: 'Phcpresspro::Article::Category', :join_table => 'categories_posts'
15
15
  belongs_to :user, class_name: 'Phcaccountspro::User'
16
16
 
17
- # Validation for Form Fields
18
- validates :post_tittle,
19
- presence: true,
20
- length: { minimum: 3 }
17
+ # Form Fields Validation
18
+ validates :post_title,
19
+ presence: true
21
20
 
22
21
  validates :post_text,
23
- presence: true,
24
- length: { minimum: 3 }
25
-
26
- validates :post_status,
27
22
  presence: true
28
23
 
29
24
  # Clean URL Define
30
- friendly_id :phcpresspro_post_slug, use: [:slugged, :finders]
25
+ friendly_id :phcpress_post_slug, use: [:slugged, :finders]
31
26
 
32
- # Define for Multiple Records
33
- def phcpresspro_post_slug
34
- [
35
- [:org_id, :post_tittle]
36
- ]
27
+ def phcpress_post_slug
28
+ [:post_title]
37
29
  end
38
30
 
39
31
  end
@@ -4,7 +4,7 @@
4
4
 
5
5
  <!-- SEO System -->
6
6
  <% phc_seo_title "PHCPress by PHCDevworks" %>
7
- <% phc_seo_description "PHCPress rails CMS engine to manage your website's articles, categories and media." %>
7
+ <% phc_seo_description "PHCPress rails CMS application to manage your website's articles, categories and media." %>
8
8
  <!-- SEO System -->
9
9
 
10
10
  <!-- SEO and Site Description -->
@@ -32,7 +32,7 @@
32
32
  <body>
33
33
 
34
34
  <!-- Page Container -->
35
- <div id="page-container" class="page-container fade page-sidebar-fixed page-header-fixed">
35
+ <div id="page-container" class="fade page-sidebar-fixed page-header-fixed">
36
36
 
37
37
  <!-- Page Header -->
38
38
  <div id="header" class="header navbar-default">
@@ -49,6 +49,7 @@
49
49
 
50
50
  <!-- Page Content -->
51
51
  <div id="content" class="content">
52
+ <%= render 'phcnotifi/default/notifications' %>
52
53
  <%= yield %>
53
54
  </div>
54
55
  <!-- Page Content -->
@@ -59,25 +60,20 @@
59
60
  </div>
60
61
  <!-- Footer Content -->
61
62
 
62
- <!-- Scroll to Top -->
63
- <a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top">
64
- <i class="fa fa-angle-up"></i>
65
- </a>
66
- <!-- Scroll to Top -->
67
-
68
63
  </div>
69
64
  <!-- Page Container -->
70
65
 
71
66
  <!-- JavaScript -->
72
67
  <%= javascript_include_tag "phcpresspro/application", 'data-turbolinks-track': 'reload' %>
68
+ <script src="https://cdn.ckeditor.com/4.10.0/full/ckeditor.js"></script>
73
69
  <!-- JavaScript -->
74
70
 
75
71
  <!-- JavaScript Loader -->
76
72
  <script>
77
- $(document).ready(function() {
78
- App.init();
79
- });
80
- </script>
73
+ $(document).ready(function() {
74
+ App.init();
75
+ });
76
+ </script>
81
77
  <!-- JavaScript Loader -->
82
78
 
83
79
  </body>
@@ -1,9 +1,9 @@
1
1
  <span class="float-left">
2
- &copy; 2012-<%= Time.now.year %> -
3
- <strong>PHC</strong>Press(Pro) -
4
- Engine v<%= Gem.loaded_specs["phcpresspro"].version.to_s %>
2
+ &copy; 2012-<%= Time.now.year %> -
3
+ <strong>PHC</strong>Press(Pro) -
4
+ Engine v<%= Gem.loaded_specs["phcpresspro"].version.to_s %>
5
5
  </span>
6
6
  <span class="float-right">
7
- Developed with <i class="fas fa-heart hanna_hearts"></i> by
8
- <a class="phcnet_copyright" href="https://phcdevworks.com/"><strong>PHC</strong>Devworks</a>
7
+ Developed with <i class="fas fa-heart hanna_hearts"></i> by
8
+ <a class="phcnet_copyright" href="https://phcdevworks.com/"><strong>PHC</strong>Devworks</a>
9
9
  </span>
@@ -15,47 +15,6 @@
15
15
  <% if current_user %>
16
16
  <ul class="navbar-nav navbar-right">
17
17
 
18
- <!-- Topbar - Navigation Main - Search
19
- <li>
20
- <form class="navbar-form">
21
- <div class="form-group">
22
- <input type="text" class="form-control" placeholder="Enter keyword" />
23
- <button type="submit" class="btn btn-search"><i class="fa fa-search"></i></button>
24
- </div>
25
- </form>
26
- </li>
27
- Topbar - Navigation Main - Search -->
28
-
29
- <!-- Topbar - Navigation Main - Notifications Menu
30
- <li class="dropdown">
31
- <a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle f-s-14">
32
- <i class="fa fa-bell"></i>
33
- <span class="label">5</span>
34
- </a>
35
- <ul class="dropdown-menu media-list dropdown-menu-right">
36
- <li class="dropdown-header">NOTIFICATIONS (5)</li>
37
- <li class="media">
38
- <a href="javascript:;">
39
- <div class="media-left">
40
- <i class="fa fa-bug media-object bg-silver-darker"></i>
41
- </div>
42
- <div class="media-body">
43
- <h6 class="media-heading">
44
- Server Error Reports
45
- <i class="fa fa-exclamation-circle text-danger"></i>
46
- </h6>
47
- <div class="text-muted f-s-11">3 minutes ago</div>
48
- </div>
49
- </a>
50
- </li>
51
- ...
52
- <li class="dropdown-footer text-center">
53
- <a href="javascript:;">View more</a>
54
- </li>
55
- </ul>
56
- </li>
57
- Topbar - Navigation Main - Notifications Menu -->
58
-
59
18
  <!-- Topbar - Navigation Main - User Menu -->
60
19
  <li class="dropdown navbar-user">
61
20
  <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">