phcpresspro 82.0.0 → 83.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/assets/javascripts/phcpresspro/application.js +0 -3
- data/app/assets/stylesheets/phcpresspro/application.scss +0 -2
- data/app/controllers/phcpresspro/api/v1/post_index.json.rabl +2 -2
- data/app/controllers/phcpresspro/api/v1/post_single.json.rabl +2 -2
- data/app/controllers/phcpresspro/application_controller.rb +19 -19
- data/app/controllers/phcpresspro/article/categories_controller.rb +15 -16
- data/app/controllers/phcpresspro/article/posts_controller.rb +17 -18
- data/app/controllers/phcpresspro/blog/articles_controller.rb +5 -5
- data/app/models/phcpresspro/article/category.rb +7 -11
- data/app/models/phcpresspro/article/post.rb +8 -16
- data/app/views/layouts/phcpresspro/application.html.erb +8 -12
- data/app/views/layouts/phcpresspro/components/backend/footer/_footer.html.erb +5 -5
- data/app/views/layouts/phcpresspro/components/backend/navigation/_top_menu.html.erb +0 -41
- data/app/views/layouts/phcpresspro/components/backend/sidebars/_side_menu.html.erb +68 -61
- data/app/views/phcpresspro/article/categories/_form.html.erb +12 -3
- data/app/views/phcpresspro/article/categories/edit.html.erb +15 -3
- data/app/views/phcpresspro/article/categories/index.html.erb +23 -15
- data/app/views/phcpresspro/article/categories/new.html.erb +15 -3
- data/app/views/phcpresspro/article/posts/_form.html.erb +22 -14
- data/app/views/phcpresspro/article/posts/edit.html.erb +3 -3
- data/app/views/phcpresspro/article/posts/index.html.erb +25 -20
- data/app/views/phcpresspro/article/posts/new.html.erb +3 -3
- data/app/views/phcpresspro/blog/articles/index.html.erb +57 -57
- data/config/routes.rb +13 -13
- data/db/migrate/20190315010932_create_phcpresspro_article_posts.rb +1 -1
- data/lib/phcpresspro/engine.rb +67 -66
- data/lib/phcpresspro/version.rb +1 -1
- data/lib/phcpresspro.rb +0 -1
- metadata +62 -72
- data/app/assets/javascripts/phcpresspro/article/categories.js +0 -3
- data/app/assets/javascripts/phcpresspro/article/posts.js +0 -2
- data/app/assets/javascripts/phcpresspro/blog/articles.js +0 -0
- data/app/assets/javascripts/phcpresspro/custom/custom.js +0 -0
- data/app/assets/stylesheets/phcpresspro/article/categories.scss +0 -0
- data/app/assets/stylesheets/phcpresspro/article/posts.scss +0 -0
- data/app/assets/stylesheets/phcpresspro/blog/articles.scss +0 -3
- data/app/helpers/phcpresspro/blog/articles_helper.rb +0 -4
- data/app/views/phcpresspro/article/categories/show.html.erb +0 -9
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bb90277a5d7d57ce20b5ae8ff24ec31a5c1be8a25c9c9000e63e2f62c96f095
|
4
|
+
data.tar.gz: 1c1654ca8a48ec5e83bb7d8171462f14bb51fc9b4615f417a59aee812b451f89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d858e20043c7099ac9c365596434b8ae2b54fcac4deb870f445494e12f09c9b67cbcc2f1b361b6adbca46e09afdabcb51c6acd36c608072cf225be72b0c4845
|
7
|
+
data.tar.gz: b80357105d349f61e091717350e311890d2679062bd91d3cd677a66079c4e82e0f3ea83a36835fe16fd20d42ccfdab854e95fb145700187e4d043a1cfedc55fb
|
data/MIT-LICENSE
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
object @
|
2
|
-
attributes :id, :
|
1
|
+
object @phcpress_posts_index
|
2
|
+
attributes :id, :post_title, :post_text, :post_status
|
@@ -1,2 +1,2 @@
|
|
1
|
-
object @
|
2
|
-
attributes :id, :
|
1
|
+
object @phcpress_posts_single
|
2
|
+
attributes :id, :post_title, :post_text, :post_status
|
@@ -1,22 +1,22 @@
|
|
1
1
|
module Phcpresspro
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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: [:
|
10
|
+
before_action :set_article_category, only: [:edit, :update, :destroy]
|
11
11
|
|
12
|
-
#
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
|
-
@article_categories = Phcpresspro::Article::Category.
|
14
|
+
@article_categories = Phcpresspro::Article::Category.all
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
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
|
-
#
|
23
|
+
# NEW
|
24
24
|
def new
|
25
25
|
@article_category = Phcpresspro::Article::Category.new
|
26
26
|
end
|
27
27
|
|
28
|
-
#
|
28
|
+
# EDIT
|
29
29
|
def edit
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
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,
|
37
|
+
redirect_to article_categories_url, :flash => { :success => 'Category was successfully created.' }
|
39
38
|
else
|
40
|
-
|
39
|
+
render :new
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
#
|
43
|
+
# UPDATE
|
45
44
|
def update
|
46
45
|
if @article_category.update(article_category_params)
|
47
|
-
redirect_to article_categories_url,
|
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,
|
55
|
+
redirect_to article_categories_url, :flash => { :success => 'Category was successfully destroyed.' }
|
57
56
|
end
|
58
57
|
|
59
58
|
private
|
60
59
|
|
61
|
-
#
|
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
|
-
#
|
65
|
+
# Whitelist
|
67
66
|
def article_category_params
|
68
|
-
params.require(:article_category).permit(:category_name, :slug, :user_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: [:
|
10
|
+
before_action :set_article_post, only: [:edit, :update, :destroy]
|
11
11
|
|
12
|
-
#
|
12
|
+
# INDEX
|
13
13
|
def index
|
14
|
-
@article_posts = Phcpresspro::Article::Post.
|
14
|
+
@article_posts = Phcpresspro::Article::Post.all
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
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
|
-
#
|
23
|
+
# NEW
|
24
24
|
def new
|
25
25
|
@article_post = Phcpresspro::Article::Post.new
|
26
26
|
end
|
27
27
|
|
28
|
-
#
|
28
|
+
# EDIT
|
29
29
|
def edit
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
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,
|
39
|
-
|
40
|
-
|
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
|
-
#
|
43
|
+
# UPDATE
|
45
44
|
def update
|
46
45
|
if @article_post.update(article_post_params)
|
47
|
-
redirect_to article_posts_url,
|
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
|
-
|
56
|
-
redirect_to article_posts_url,
|
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
|
-
#
|
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
|
-
#
|
65
|
+
# Whitelist
|
67
66
|
def article_post_params
|
68
|
-
params.require(:article_post).permit(:
|
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
|
-
#
|
6
|
+
# Layout
|
7
7
|
layout 'phcpresspro/frontend'
|
8
8
|
|
9
|
-
#
|
9
|
+
# INDEX
|
10
10
|
def index
|
11
|
-
@
|
11
|
+
@phcpress_posts_index = Article::Post.where(pststatus: "published")
|
12
12
|
end
|
13
13
|
|
14
|
-
#
|
14
|
+
# SHOW
|
15
15
|
def show
|
16
|
-
@
|
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
|
-
#
|
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
|
-
#
|
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 :
|
20
|
+
friendly_id :phc_nice_url_slug, use: [:slugged, :finders]
|
22
21
|
|
23
|
-
|
24
|
-
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
18
|
-
validates :
|
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 :
|
25
|
+
friendly_id :phcpress_post_slug, use: [:slugged, :finders]
|
31
26
|
|
32
|
-
|
33
|
-
|
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
|
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="
|
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
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
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
|
-
|
3
|
-
|
4
|
-
|
2
|
+
© 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
|
-
|
8
|
-
|
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">
|