phcpress 53.1.0 → 54.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/app/assets/javascripts/phcpress/application.js +0 -3
  4. data/app/assets/stylesheets/phcpress/application.scss +0 -2
  5. data/app/controllers/phcpress/api/v1/post_index.json.rabl +1 -1
  6. data/app/controllers/phcpress/api/v1/post_single.json.rabl +1 -1
  7. data/app/controllers/phcpress/application_controller.rb +19 -19
  8. data/app/controllers/phcpress/article/categories_controller.rb +10 -10
  9. data/app/controllers/phcpress/article/posts_controller.rb +13 -13
  10. data/app/controllers/phcpress/blog/articles_controller.rb +3 -3
  11. data/app/models/phcpress/article/category.rb +6 -10
  12. data/app/models/phcpress/article/post.rb +6 -14
  13. data/app/views/layouts/phcpress/application.html.erb +6 -7
  14. data/app/views/layouts/phcpress/components/backend/footer/_footer.html.erb +5 -5
  15. data/app/views/layouts/phcpress/components/backend/navigation/_top_menu.html.erb +0 -41
  16. data/app/views/layouts/phcpress/components/backend/sidebars/_side_menu.html.erb +9 -9
  17. data/app/views/phcpress/article/categories/_form.html.erb +8 -4
  18. data/app/views/phcpress/article/categories/edit.html.erb +15 -3
  19. data/app/views/phcpress/article/categories/index.html.erb +17 -14
  20. data/app/views/phcpress/article/categories/new.html.erb +15 -3
  21. data/app/views/phcpress/article/posts/_form.html.erb +20 -12
  22. data/app/views/phcpress/article/posts/edit.html.erb +3 -3
  23. data/app/views/phcpress/article/posts/index.html.erb +18 -15
  24. data/app/views/phcpress/article/posts/new.html.erb +3 -3
  25. data/app/views/phcpress/blog/articles/index.html.erb +56 -56
  26. data/config/routes.rb +11 -11
  27. data/db/migrate/20190315010932_create_phcpress_article_posts.rb +1 -1
  28. data/lib/phcpress/engine.rb +54 -54
  29. data/lib/phcpress/version.rb +1 -1
  30. metadata +6 -15
  31. data/app/assets/javascripts/phcpress/article/categories.js +0 -0
  32. data/app/assets/javascripts/phcpress/article/posts.js +0 -0
  33. data/app/assets/javascripts/phcpress/blog/articles.js +0 -0
  34. data/app/assets/javascripts/phcpress/custom/custom.js +0 -0
  35. data/app/assets/stylesheets/phcpress/article/categories.scss +0 -0
  36. data/app/assets/stylesheets/phcpress/article/posts.scss +0 -0
  37. data/app/assets/stylesheets/phcpress/blog/articles.scss +0 -0
  38. data/app/views/phcpress/article/categories/show.html.erb +0 -9
  39. data/app/views/phcpress/article/posts/show.html.erb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17241937742639f830c660051c1b7ab7585cb62290cab05f7e1d2aff68f5a630
4
- data.tar.gz: 45f8293d2239a569548f21dc1cbc708ad50691544f08666fbe8357ca29f05bb0
3
+ metadata.gz: f4b62b92ee4ddcbab780ec9bf0aa113b4e642a000811c6f90ecec641d0ec43cb
4
+ data.tar.gz: 193367aa505b1493f30f4b7148bf1342162d1f6db446361e09b61477d09d833e
5
5
  SHA512:
6
- metadata.gz: a9f0bd71eadea242d80bd50385e3b14f5e51d3a4d65ccd42516dcd79004e3946bc7141380a70170c3d4cfb4c992c7804c8537e769aac8e05bc56f1c0eae30529
7
- data.tar.gz: 953735fc3785b911a65041af95ff52f52bbe0fbcde7935ca3a9a2997c88c12558f7a924eac6010e2b2f1bfd153e7b3f35beee9a8404fef73af55babe73254f25
6
+ metadata.gz: be917281228ae207d072949196e4b67e7c998dba21e8f37c2635b9f73c1029fc6422930eed156bfddef3ebaa44b8569110978a97500e633591287804a5dd3257
7
+ data.tar.gz: 911a97abc90ea537da2ecffa166b0dcf88bf84700806c8b16c5f38d877506ec3aa2eb932a0a34aea21c0fd1866d5146fd4a21e00af71dabb90c4d25a1363e2df
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2012-2019 BradPotts - 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 phcpress/custom/custom
4
- //= require phcpress/article/posts
5
- //= requrie phcpress/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
1
  object @phcpress_posts_index
2
- attributes :id, :psttittle, :psttext, :pststatus, :pstimage
2
+ attributes :id, :post_title, :post_text, :post_status
@@ -1,2 +1,2 @@
1
1
  object @phcpress_posts_single
2
- attributes :id, :psttittle, :psttext, :pststatus, :pstimage
2
+ attributes :id, :post_title, :post_text, :post_status
@@ -1,22 +1,22 @@
1
1
  module Phcpress
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 Phcaccounts::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 Phccorehelpers::Engine.helpers
9
+ helper Phcmenus::Engine.helpers
10
+ helper Phctitleseo::Engine.helpers
11
+ helper Phcnotifi::Engine.helpers
12
+ helper Phcaccounts::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,40 +7,40 @@ module Phcpress
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
14
  @article_categories = Phcpress::Article::Category.all
15
15
  end
16
16
 
17
- # Categories Show
17
+ # SHOW
18
18
  def show
19
19
  @article_category = Phcpress::Article::Category.friendly.find(params[:id])
20
20
  @versions = Phcpress::CategoryVersions.where(item_id: params[:id], item_type: 'Phcpress::Article::Category')
21
21
  end
22
22
 
23
- # Categories New
23
+ # NEW
24
24
  def new
25
25
  @article_category = Phcpress::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 = Phcpress::Article::Category.new(article_category_params)
35
35
  @article_category.user_id = current_user.id
36
36
  if @article_category.save
37
37
  redirect_to article_categories_url, :flash => { :success => 'Category was successfully created.' }
38
38
  else
39
- render :new
39
+ render :new
40
40
  end
41
41
  end
42
42
 
43
- # PATCH/PUT
43
+ # UPDATE
44
44
  def update
45
45
  if @article_category.update(article_category_params)
46
46
  redirect_to article_categories_url, :flash => { :success => 'Category was successfully updated.' }
@@ -57,12 +57,12 @@ module Phcpress
57
57
 
58
58
  private
59
59
 
60
- # Use callbacks to share common setup or constraints between actions.
60
+ # Common Callbacks
61
61
  def set_article_category
62
62
  @article_category = Phcpress::Article::Category.find(params[:id])
63
63
  end
64
64
 
65
- # Only allow a trusted parameter "white list" through.
65
+ # Whitelist
66
66
  def article_category_params
67
67
  params.require(:article_category).permit(:category_name, :slug, :user_id)
68
68
  end
@@ -7,40 +7,40 @@ module Phcpress
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
14
  @article_posts = Phcpress::Article::Post.all
15
15
  end
16
16
 
17
- # Article Show
17
+ # SHOW
18
18
  def show
19
19
  @article_post = Phcpress::Article::Post.friendly.find(params[:id])
20
20
  @versions = Phcpress::PostVersions.where(item_id: params[:id], item_type: 'Phcpress::Article::Post')
21
21
  end
22
22
 
23
- # Article New
23
+ # NEW
24
24
  def new
25
25
  @article_post = Phcpress::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 = Phcpress::Article::Post.new(article_post_params)
35
35
  @article_post.user_id = current_user.id
36
36
  if @article_post.save
37
37
  redirect_to article_posts_url, :flash => { :success => 'Post was successfully created.' }
38
- else
39
- render :new
38
+ else
39
+ render :new
40
40
  end
41
41
  end
42
42
 
43
- # PATCH/PUT
43
+ # UPDATE
44
44
  def update
45
45
  if @article_post.update(article_post_params)
46
46
  redirect_to article_posts_url, :flash => { :success => 'Post was successfully updated.' }
@@ -51,20 +51,20 @@ module Phcpress
51
51
 
52
52
  # DELETE
53
53
  def destroy
54
- @article_post.destroy
54
+ @article_post.destroy
55
55
  redirect_to article_posts_url, :flash => { :error => 'Post was successfully destroyed.' }
56
56
  end
57
57
 
58
58
  private
59
59
 
60
- # Use callbacks to share common setup or constraints between actions.
60
+ # Common Callbacks
61
61
  def set_article_post
62
62
  @article_post = Phcpress::Article::Post.find(params[:id])
63
63
  end
64
64
 
65
- # Only allow a trusted parameter "white list" through.
65
+ # Whitelist
66
66
  def article_post_params
67
- params.require(:article_post).permit(:post_tittle, :post_text, :post_status, :post_image, :remove_post_image, :slug, :user_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: [])
68
68
  end
69
69
 
70
70
  end
@@ -3,15 +3,15 @@ require_dependency "phcpress/application_controller"
3
3
  module Phcpress
4
4
  class Blog::ArticlesController < ApplicationController
5
5
 
6
- # Security, Layouts & Action Filters
6
+ # Layout
7
7
  layout 'phcpress/frontend'
8
8
 
9
- # Index for All Published Posts
9
+ # INDEX
10
10
  def index
11
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
16
  @phcpress_posts_single = Article::Post.friendly.find(params[:id])
17
17
  end
@@ -4,27 +4,23 @@ module Phcpress
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 => 'Phcpress::CategoryVersions'
9
9
 
10
10
  # Relationships
11
11
  has_and_belongs_to_many :posts, class_name: 'Phcpress::Article::Post', :join_table => 'categories_posts', :dependent => :destroy
12
12
  belongs_to :user, class_name: 'Phcaccounts::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 :phcpress_category_slug, use: [:slugged, :finders]
20
+ friendly_id :phc_nice_url_slug, use: [:slugged, :finders]
22
21
 
23
- # Define for Multiple Records
24
- def phcpress_category_slug
25
- [
26
- [: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 Phcpress
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 => 'Phcpress::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: 'Phcpress::Article::Category', :join_table => 'categories_posts'
15
15
  belongs_to :user, class_name: 'Phcaccounts::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
25
  friendly_id :phcpress_post_slug, use: [:slugged, :finders]
31
26
 
32
- # Define for Multiple Records
33
27
  def phcpress_post_slug
34
- [
35
- [:post_tittle]
36
- ]
28
+ [:post_title]
37
29
  end
38
30
 
39
31
  end
@@ -22,7 +22,6 @@
22
22
 
23
23
  <!-- CSS Styles -->
24
24
  <%= stylesheet_link_tag 'phcpress/application', media: 'all', 'data-turbolinks-track': 'reload' %>
25
-
26
25
  <!-- CSS Styles -->
27
26
 
28
27
  <!-- Font -->
@@ -33,7 +32,7 @@
33
32
  <body>
34
33
 
35
34
  <!-- Page Container -->
36
- <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">
37
36
 
38
37
  <!-- Page Header -->
39
38
  <div id="header" class="header navbar-default">
@@ -48,7 +47,7 @@
48
47
  <div class="sidebar-bg"></div>
49
48
  <!-- Page Sidebar -->
50
49
 
51
- <!-- Page Content -->
50
+ <!-- Page Content -->
52
51
  <div id="content" class="content">
53
52
  <%= render 'phcnotifi/default/notifications' %>
54
53
  <%= yield %>
@@ -71,10 +70,10 @@
71
70
 
72
71
  <!-- JavaScript Loader -->
73
72
  <script>
74
- $(document).ready(function() {
75
- App.init();
76
- });
77
- </script>
73
+ $(document).ready(function() {
74
+ App.init();
75
+ });
76
+ </script>
78
77
  <!-- JavaScript Loader -->
79
78
 
80
79
  </body>
@@ -1,9 +1,9 @@
1
1
  <span class="float-left">
2
- &copy; 2012-<%= Time.now.year %> -
3
- <strong>PHC</strong>Press -
4
- Engine v<%= Gem.loaded_specs["phcpress"].version.to_s %>
2
+ &copy; 2012-<%= Time.now.year %> -
3
+ <strong>PHC</strong>Press -
4
+ Engine v<%= Gem.loaded_specs["phcpress"].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">
@@ -144,14 +144,14 @@
144
144
  <% if current_user && current_user.admin? %>
145
145
  <!-- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
146
146
  <li class="nav-header">User Administration</li>
147
- <li class="has-sub">
148
- <a href="javascript:;">
149
- <b class="caret"></b>
150
- <i class="fas fa-user"></i>
151
- <span>Admin</span>
152
- </a>
153
- <ul class="sub-menu">
154
- <li class="<%= phc_menus_active_controller('phcaccounts/admin/users') %>"><%= link_to 'User List', phcaccounts.admin_users_path %></li>
147
+ <li class="has-sub">
148
+ <a href="javascript:;">
149
+ <b class="caret"></b>
150
+ <i class="fas fa-user"></i>
151
+ <span>Admin</span>
152
+ </a>
153
+ <ul class="sub-menu">
154
+ <li class="<%= phc_menus_active_controller('phcaccounts/admin/users') %>"><%= link_to 'User List', phcaccounts.admin_users_path %></li>
155
155
  </ul>
156
156
  </li>
157
157
  <!-- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
@@ -173,7 +173,7 @@
173
173
  </li>
174
174
  <!-- Sidebar - Sidebar Navigation - PHCAccounts User Options -->
175
175
  <% end %>
176
-
176
+
177
177
  <!-- Sidebar - Sidebar Minifier -->
178
178
  <li>
179
179
  <a href="javascript:;" class="sidebar-minify-btn" data-click="sidebar-minify">