phcpresspro 81.0.0 → 82.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/phcpresspro/article/categories_controller.rb +1 -1
- data/app/controllers/phcpresspro/article/posts_controller.rb +1 -1
- data/app/models/phcpresspro/article/category.rb +2 -2
- data/app/models/phcpresspro/article/post.rb +5 -5
- data/app/views/layouts/phcpresspro/application.html.erb +21 -16
- data/app/views/layouts/phcpresspro/components/backend/sidebars/_side_menu.html.erb +38 -10
- data/app/views/phcpresspro/article/categories/_form.html.erb +2 -2
- data/app/views/phcpresspro/article/categories/index.html.erb +2 -2
- data/app/views/phcpresspro/article/categories/show.html.erb +2 -2
- data/app/views/phcpresspro/article/posts/_form.html.erb +12 -12
- data/app/views/phcpresspro/article/posts/index.html.erb +4 -4
- data/db/migrate/20190315010932_create_phcpresspro_article_posts.rb +5 -4
- data/db/migrate/20190315040834_create_phcpresspro_article_categories.rb +2 -1
- data/lib/phcpresspro/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a052a0cd5fcd5cbfa1e325ed796d713c668a3bf49c7b8072d7acf8a2bdde16ca
|
4
|
+
data.tar.gz: 3d14bdb7a22bbbee6d1a80d6a2c70160c3df3feeb02d40b0a92a55d9e9212df4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 128f540b6349892e4f7ae8f7d9b085893c5b1ab3f0a7e42c1b02d2a79c23dd98831fe168c7e9b87e4bf4406d16b339da48f040bf4a669c16105d1f8827f469cc
|
7
|
+
data.tar.gz: 35cd0b118152320577f36550a7c2839c8f1cc9def7ee433123ff345d0ada2e510df12401ce725a638b8dffca63f3960624bf7c65200186348ca75aa00be8ab4c
|
@@ -65,7 +65,7 @@ module Phcpresspro
|
|
65
65
|
|
66
66
|
# Only allow a trusted parameter "white list" through.
|
67
67
|
def article_category_params
|
68
|
-
params.require(:article_category).permit(:
|
68
|
+
params.require(:article_category).permit(:category_name, :slug, :user_id, :org_id)
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
@@ -65,7 +65,7 @@ module Phcpresspro
|
|
65
65
|
|
66
66
|
# Only allow a trusted parameter "white list" through.
|
67
67
|
def article_post_params
|
68
|
-
params.require(:article_post).permit(:
|
68
|
+
params.require(:article_post).permit(:post_tittle, :post_text, :post_status, :post_image, :remove_post_image, :slug, :user_id, :org_id, category_ids: [])
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
@@ -12,7 +12,7 @@ module Phcpresspro
|
|
12
12
|
belongs_to :user, class_name: 'Phcaccountspro::User'
|
13
13
|
|
14
14
|
# Validation for Form Fields
|
15
|
-
validates :
|
15
|
+
validates :category_name,
|
16
16
|
presence: true,
|
17
17
|
uniqueness: true,
|
18
18
|
length: { minimum: 3 }
|
@@ -23,7 +23,7 @@ module Phcpresspro
|
|
23
23
|
# Define for Multiple Records
|
24
24
|
def phcpresspro_category_slug
|
25
25
|
[
|
26
|
-
[:
|
26
|
+
[:org_id, :category_name]
|
27
27
|
]
|
28
28
|
end
|
29
29
|
|
@@ -8,22 +8,22 @@ module Phcpresspro
|
|
8
8
|
has_paper_trail :class_name => 'Phcpresspro::PostVersions'
|
9
9
|
|
10
10
|
# Image Upload
|
11
|
-
has_one_attached :
|
11
|
+
has_one_attached :post_image
|
12
12
|
|
13
13
|
# Model 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
17
|
# Validation for Form Fields
|
18
|
-
validates :
|
18
|
+
validates :post_tittle,
|
19
19
|
presence: true,
|
20
20
|
length: { minimum: 3 }
|
21
21
|
|
22
|
-
validates :
|
22
|
+
validates :post_text,
|
23
23
|
presence: true,
|
24
24
|
length: { minimum: 3 }
|
25
25
|
|
26
|
-
validates :
|
26
|
+
validates :post_status,
|
27
27
|
presence: true
|
28
28
|
|
29
29
|
# Clean URL Define
|
@@ -32,7 +32,7 @@ module Phcpresspro
|
|
32
32
|
# Define for Multiple Records
|
33
33
|
def phcpresspro_post_slug
|
34
34
|
[
|
35
|
-
[:
|
35
|
+
[:org_id, :post_tittle]
|
36
36
|
]
|
37
37
|
end
|
38
38
|
|
@@ -2,25 +2,27 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
|
5
|
-
|
6
|
-
<%
|
5
|
+
<!-- SEO System -->
|
6
|
+
<% phc_seo_title "PHCPress by PHCDevworks" %>
|
7
|
+
<% phc_seo_description "PHCPress rails CMS engine to manage your website's articles, categories and media." %>
|
8
|
+
<!-- SEO System -->
|
7
9
|
|
8
|
-
<!--
|
9
|
-
<meta name="viewport" content="width=device-width, initial-scale=1
|
10
|
+
<!-- SEO and Site Description -->
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
10
12
|
<title><%= yield(:phc_seo_title) %></title>
|
11
13
|
<meta name="description" content="<%= yield(:phc_seo_description) %>">
|
12
14
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
|
13
|
-
<link rel="canonical" href="http://
|
14
|
-
<!--
|
15
|
-
|
16
|
-
<!--
|
15
|
+
<link rel="canonical" href="http://phcdevworks.com">
|
16
|
+
<!-- SEO and Site Description -->
|
17
|
+
|
18
|
+
<!-- Rails Security Tags -->
|
17
19
|
<%= csrf_meta_tags %>
|
18
20
|
<%= csp_meta_tag %>
|
19
|
-
<!--
|
20
|
-
|
21
|
-
<!--
|
21
|
+
<!-- Rails Security Tags -->
|
22
|
+
|
23
|
+
<!-- CSS Styles -->
|
22
24
|
<%= stylesheet_link_tag 'phcpresspro/application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
23
|
-
<!--
|
25
|
+
<!-- CSS Styles -->
|
24
26
|
|
25
27
|
<!-- Font -->
|
26
28
|
<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"/>
|
@@ -31,6 +33,7 @@
|
|
31
33
|
|
32
34
|
<!-- Page Container -->
|
33
35
|
<div id="page-container" class="page-container fade page-sidebar-fixed page-header-fixed">
|
36
|
+
|
34
37
|
<!-- Page Header -->
|
35
38
|
<div id="header" class="header navbar-default">
|
36
39
|
<%= render 'layouts/phcpresspro/components/backend/navigation/top_menu' %>
|
@@ -51,7 +54,7 @@
|
|
51
54
|
<!-- Page Content -->
|
52
55
|
|
53
56
|
<!-- Footer Content -->
|
54
|
-
<div id="footer" class="footer">
|
57
|
+
<div id="footer" class="footer mb-4">
|
55
58
|
<%= render 'layouts/phcpresspro/components/backend/footer/footer' %>
|
56
59
|
</div>
|
57
60
|
<!-- Footer Content -->
|
@@ -65,15 +68,17 @@
|
|
65
68
|
</div>
|
66
69
|
<!-- Page Container -->
|
67
70
|
|
68
|
-
<!--
|
71
|
+
<!-- JavaScript -->
|
69
72
|
<%= javascript_include_tag "phcpresspro/application", 'data-turbolinks-track': 'reload' %>
|
70
|
-
|
73
|
+
<!-- JavaScript -->
|
74
|
+
|
75
|
+
<!-- JavaScript Loader -->
|
71
76
|
<script>
|
72
77
|
$(document).ready(function() {
|
73
78
|
App.init();
|
74
79
|
});
|
75
80
|
</script>
|
76
|
-
<!--
|
81
|
+
<!-- JavaScript Loader -->
|
77
82
|
|
78
83
|
</body>
|
79
84
|
</html>
|
@@ -47,8 +47,8 @@
|
|
47
47
|
<span>Article Posts</span>
|
48
48
|
</a>
|
49
49
|
<ul class="sub-menu">
|
50
|
-
<li class="<%= phc_menus_active_controller('phcpresspro/article/posts') %>"><%= link_to
|
51
|
-
<li class="<%= phc_menus_active_controller('phcpresspro/article/posts#new') %>"><%= link_to
|
50
|
+
<li class="<%= phc_menus_active_controller('phcpresspro/article/posts') %>"><%= link_to 'Article Index', phcpresspro.article_posts_path %></li>
|
51
|
+
<li class="<%= phc_menus_active_controller('phcpresspro/article/posts#new') %>"><%= link_to 'New Aritcle', phcpresspro.new_article_post_path %></li>
|
52
52
|
</ul>
|
53
53
|
</li>
|
54
54
|
<li class="has-sub">
|
@@ -58,8 +58,8 @@
|
|
58
58
|
<span>Article Categories</span>
|
59
59
|
</a>
|
60
60
|
<ul class="sub-menu">
|
61
|
-
<li class="<%= phc_menus_active_controller('phcpresspro/article/categories') %>"><%= link_to
|
62
|
-
<li class="<%= phc_menus_active_controller('phcpresspro/article/categories#new') %>"><%= link_to
|
61
|
+
<li class="<%= phc_menus_active_controller('phcpresspro/article/categories') %>"><%= link_to 'Category Index', phcpresspro.article_categories_path %></li>
|
62
|
+
<li class="<%= phc_menus_active_controller('phcpresspro/article/categories#new') %>"><%= link_to 'New Category', phcpresspro.new_article_category_path %></li>
|
63
63
|
</ul>
|
64
64
|
</li>
|
65
65
|
<!-- Sidebar - Sidebar Navigation - PHCPress(Pro) -->
|
@@ -75,8 +75,8 @@
|
|
75
75
|
<span>Member's Data</span>
|
76
76
|
</a>
|
77
77
|
<ul class="sub-menu">
|
78
|
-
<li class="<%= phc_menus_active_controller('phcmemberspro/member/profiles') %>"><%= link_to
|
79
|
-
<li class="<%= phc_menus_active_controller('phcmemberspro/member/profiles#new') %>"><%= link_to
|
78
|
+
<li class="<%= phc_menus_active_controller('phcmemberspro/member/profiles') %>"><%= link_to 'Profile Index', phcmemberspro.member_profiles_path %></li>
|
79
|
+
<li class="<%= phc_menus_active_controller('phcmemberspro/member/profiles#new') %>"><%= link_to 'New Member Profile', phcmemberspro.new_member_profile_path %></li>
|
80
80
|
</ul>
|
81
81
|
</li>
|
82
82
|
<li class="has-sub">
|
@@ -86,8 +86,36 @@
|
|
86
86
|
<span>Member's Directory</span>
|
87
87
|
</a>
|
88
88
|
<ul class="sub-menu">
|
89
|
-
<li class="<%= phc_menus_active_controller('phcmemberspro/directory/categories') %>"><%= link_to
|
90
|
-
<li class="<%= phc_menus_active_controller('phcmemberspro/directory/categories#new') %>"><%= link_to
|
89
|
+
<li class="<%= phc_menus_active_controller('phcmemberspro/directory/categories') %>"><%= link_to 'Directory Index', phcmemberspro.directory_categories_path %></li>
|
90
|
+
<li class="<%= phc_menus_active_controller('phcmemberspro/directory/categories#new') %>"><%= link_to 'New Directory Listing', phcmemberspro.new_directory_category_path %></li>
|
91
|
+
</ul>
|
92
|
+
</li>
|
93
|
+
<!-- Sidebar - Sidebar Navigation - PHCPress(Pro) -->
|
94
|
+
<% end %>
|
95
|
+
|
96
|
+
<% if defined?phcreallistingspro %>
|
97
|
+
<!-- Sidebar - Sidebar Navigation - PHCPress(Pro) -->
|
98
|
+
<li class="nav-header">Listing Management</li>
|
99
|
+
<li class="has-sub">
|
100
|
+
<a href="javascript:;">
|
101
|
+
<b class="caret"></b>
|
102
|
+
<i class="fas fa-store-alt"></i>
|
103
|
+
<span>Property Listings</span>
|
104
|
+
</a>
|
105
|
+
<ul class="sub-menu">
|
106
|
+
<li class="<%= phc_menus_active_controller('phcreallistingspro/property/listings') %>"><%= link_to 'Listing Index', phcreallistingspro.property_listings_path %></li>
|
107
|
+
<li class="<%= phc_menus_active_controller('phcreallistingspro/property/listings#new') %>"><%= link_to 'New Listing', phcreallistingspro.new_property_listing_path %></li>
|
108
|
+
</ul>
|
109
|
+
</li>
|
110
|
+
<li class="has-sub">
|
111
|
+
<a href="javascript:;">
|
112
|
+
<b class="caret"></b>
|
113
|
+
<i class="fas fa-list-alt"></i>
|
114
|
+
<span>Listing Features</span>
|
115
|
+
</a>
|
116
|
+
<ul class="sub-menu">
|
117
|
+
<li class="<%= phc_menus_active_controller('phcreallistingspro/property/listings') %>"><%= link_to 'Features Index', phcreallistingspro.property_features_path %></li>
|
118
|
+
<li class="<%= phc_menus_active_controller('phcreallistingspro/property/listings#new') %>"><%= link_to 'New Features', phcreallistingspro.new_property_feature_path %></li>
|
91
119
|
</ul>
|
92
120
|
</li>
|
93
121
|
<!-- Sidebar - Sidebar Navigation - PHCPress(Pro) -->
|
@@ -133,8 +161,8 @@
|
|
133
161
|
<span>Accounts Dashboard</span>
|
134
162
|
</a>
|
135
163
|
<ul class="sub-menu">
|
136
|
-
<li class="<%= phc_menus_active_controller('phcaccountspro/admin/edit') %>"><%= link_to
|
137
|
-
<li class="<%= phc_menus_active_controller('phcaccountspro/admin/new') %>"><%= link_to
|
164
|
+
<li class="<%= phc_menus_active_controller('phcaccountspro/admin/edit') %>"><%= link_to 'Settings', phcaccountspro.edit_user_registration_path %></li>
|
165
|
+
<li class="<%= phc_menus_active_controller('phcaccountspro/admin/new') %>"><%= link_to 'Logout', phcaccountspro.destroy_user_session_path, method: :delete %></li>
|
138
166
|
</ul>
|
139
167
|
</li>
|
140
168
|
<!-- Sidebar - Sidebar Navigation - PHCAccountsPro -->
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
<!-- PHCPressPro - Category Form -->
|
4
4
|
<div class="form-group">
|
5
|
-
<%= form.label :
|
6
|
-
<%= form.text_field :
|
5
|
+
<%= form.label :category_name, "Category Name" %>
|
6
|
+
<%= form.text_field :category_name, class: "form-control" %>
|
7
7
|
</div>
|
8
8
|
<div class="actions">
|
9
9
|
<%= form.submit class: "btn btn-primary" %>
|
@@ -40,13 +40,13 @@
|
|
40
40
|
<tbody>
|
41
41
|
<% @article_categories.each do |article_category| %>
|
42
42
|
<tr>
|
43
|
-
<td><%= link_to article_category.
|
43
|
+
<td><%= link_to article_category.category_name, phcpresspro.edit_article_category_path(article_category) %></td>
|
44
44
|
<td><%= link_to 'Trash', article_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
45
45
|
</tr>
|
46
46
|
<% end %>
|
47
47
|
</tbody>
|
48
48
|
</table>
|
49
|
-
<%= link_to phcpresspro.new_article_category_path, class: "btn btn-primary" do %>
|
49
|
+
<%= link_to phcpresspro.new_article_category_path, class: "btn btn-primary btn-sm" do %>
|
50
50
|
<i class="fas fa-plus-circle"></i>
|
51
51
|
<%= "Add a New Article Category" %>
|
52
52
|
<% end %>
|
@@ -8,8 +8,8 @@
|
|
8
8
|
</div>
|
9
9
|
<div class="panel-body">
|
10
10
|
<div class="form-group">
|
11
|
-
<%= form.label :
|
12
|
-
<%= form.select( :
|
11
|
+
<%= form.label :post_status, "Post Status" %>
|
12
|
+
<%= form.select( :post_status, [['Draft','draft'],['Published','published'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
|
13
13
|
</div>
|
14
14
|
<div class="actions">
|
15
15
|
<%= form.submit class: "btn btn-primary waves-effect" %>
|
@@ -23,13 +23,13 @@
|
|
23
23
|
</div>
|
24
24
|
<div class="panel-body">
|
25
25
|
<div class="form-group">
|
26
|
-
<%= form.label :
|
27
|
-
<%= form.file_field :
|
26
|
+
<%= form.label :post_image, "Featured Image" %>
|
27
|
+
<%= form.file_field :post_image, class: "form-control" %>
|
28
28
|
</div>
|
29
|
-
<% if form.object.
|
30
|
-
<%= image_tag form.object.
|
31
|
-
<%= form.label :
|
32
|
-
<%= form.check_box :
|
29
|
+
<% if form.object.post_image? %>
|
30
|
+
<%= image_tag form.object.post_image_url, class: "img-responsive img-thumbnail" %>
|
31
|
+
<%= form.label :remove_post_image %>
|
32
|
+
<%= form.check_box :remove_post_image %>
|
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
|
-
<%= form.collection_check_boxes :category_ids, Phcpresspro::Article::Category.where(org_id: current_user.org_id), :id, :
|
42
|
+
<%= form.collection_check_boxes :category_ids, Phcpresspro::Article::Category.where(org_id: current_user.org_id), :id, :category_name do |post_category| %>
|
43
43
|
<%= post_category.check_box %>
|
44
44
|
<%= post_category.label %></br>
|
45
45
|
<% end %>
|
@@ -64,11 +64,11 @@
|
|
64
64
|
</div>
|
65
65
|
<div class="panel-body ">
|
66
66
|
<div class="form-group">
|
67
|
-
<%= form.label :
|
68
|
-
<%= form.text_field :
|
67
|
+
<%= form.label :post_tittle, "Article Title" %>
|
68
|
+
<%= form.text_field :post_tittle, class: "form-control" %>
|
69
69
|
</div>
|
70
70
|
<div class="form-group">
|
71
|
-
<%= form.text_area :
|
71
|
+
<%= form.text_area :post_text, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
|
72
72
|
</div>
|
73
73
|
</div>
|
74
74
|
</div>
|
@@ -41,9 +41,9 @@
|
|
41
41
|
<tbody>
|
42
42
|
<% @article_posts.each do |article_post| %>
|
43
43
|
<tr>
|
44
|
-
<td><%= article_post.
|
45
|
-
<td><%= truncate(article_post.
|
46
|
-
<td><%= article_post.
|
44
|
+
<td><%= article_post.post_tittle %></td>
|
45
|
+
<td><%= truncate(article_post.post_text, :length => 80, :escape => false) %></td>
|
46
|
+
<td><%= article_post.post_status.capitalize %></td>
|
47
47
|
<td><div class="btn-group" role="group" aria-label="Blog Articles">
|
48
48
|
<%= link_to 'Edit Post', edit_article_post_path(article_post), class: "btn btn-primary btn-xs" %>
|
49
49
|
<%= link_to 'Trash Post', article_post, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
|
@@ -52,7 +52,7 @@
|
|
52
52
|
<% end %>
|
53
53
|
</tbody>
|
54
54
|
</table>
|
55
|
-
<%= link_to phcpresspro.new_article_post_path, class: "btn btn-primary" do %>
|
55
|
+
<%= link_to phcpresspro.new_article_post_path, class: "btn btn-primary btn-sm" do %>
|
56
56
|
<i class="fas fa-plus-circle"></i>
|
57
57
|
<%= "Add a New Article Post" %>
|
58
58
|
<% end %>
|
@@ -2,12 +2,13 @@ class CreatePhcpressproArticlePosts < ActiveRecord::Migration[5.2]
|
|
2
2
|
def change
|
3
3
|
create_table :phcpresspro_article_posts do |t|
|
4
4
|
|
5
|
-
t.string :
|
6
|
-
t.string :
|
7
|
-
t.string :
|
8
|
-
t.string :
|
5
|
+
t.string :post_tittle
|
6
|
+
t.string :post_text
|
7
|
+
t.string :post_status
|
8
|
+
t.string :post_image
|
9
9
|
|
10
10
|
t.string :slug
|
11
|
+
|
11
12
|
t.string :user_id
|
12
13
|
t.string :org_id
|
13
14
|
|
data/lib/phcpresspro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcpresspro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 82.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BradPotts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -624,7 +624,8 @@ dependencies:
|
|
624
624
|
- - "~>"
|
625
625
|
- !ruby/object:Gem::Version
|
626
626
|
version: '2.4'
|
627
|
-
description:
|
627
|
+
description: PHCPress(Pro) rails CMS engine to manage your website's articles, categories
|
628
|
+
and media.
|
628
629
|
email:
|
629
630
|
- info@phcdevworks.com
|
630
631
|
executables: []
|