phcdevworks_press 4.9.0 → 5.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/models/phcdevworks_press/article/post.rb +2 -1
- data/app/views/layouts/phcdevworks_press/components/backend/sidebars/_side_menu.html.erb +64 -80
- data/app/views/phcdevworks_press/article/posts/_form.html.erb +1 -1
- data/config/routes.rb +1 -2
- data/lib/phcdevworks_press/engine.rb +1 -0
- data/lib/phcdevworks_press/version.rb +1 -1
- metadata +18 -16
- data/app/assets/javascripts/phcdevworks_press/article/categories.coffee +0 -0
- data/app/assets/stylesheets/phcdevworks_press/article/categories.scss +0 -0
- data/app/controllers/phcdevworks_press/article/categories_controller.rb +0 -83
- data/app/helpers/phcdevworks_press/article/categories_helper.rb +0 -4
- data/app/models/phcdevworks_press/article/category.rb +0 -27
- data/app/models/phcdevworks_press/article_category_versions.rb +0 -5
- data/app/views/phcdevworks_press/article/categories/_form.html.erb +0 -22
- data/app/views/phcdevworks_press/article/categories/edit.html.erb +0 -49
- data/app/views/phcdevworks_press/article/categories/index.html.erb +0 -81
- data/app/views/phcdevworks_press/article/categories/new.html.erb +0 -50
- data/db/migrate/20170517064427_create_phcdevworks_press_category_versions.rb +0 -17
- data/db/migrate/20190805232733_create_phcdevworks_press_article_categories.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1836838be82c9df266dc00edcbc0e6c16c63d906ce5270d4c7ec133c8e05c0b6
|
4
|
+
data.tar.gz: 25c1dd40e7c3fced39f8318cd69f3e372b1d3875e57f067ab68ce7452d9cf7db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7deddaf2f38a1a8d2cadfec011fb99741dd32b3034b78253553200eedd0f7f4ff242e2c37bd48ef38c3e737e171c3774bc67808afe0149e7d255043e47ffd0b
|
7
|
+
data.tar.gz: e23374c0adfa4a2d11afa895137e534ebecf0adfd78b05e6f9b88f26c27d60401e8b689fa33a909657a7d6bce6c7107c508c99c86df2436ba7c64d9daeab5145
|
@@ -11,8 +11,9 @@ module PhcdevworksPress
|
|
11
11
|
has_one_attached :post_image
|
12
12
|
|
13
13
|
# Relationships
|
14
|
-
has_and_belongs_to_many :categories, class_name: "Article::Category", :join_table => "phcdevworks_press_categories_posts"
|
15
14
|
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
15
|
+
has_and_belongs_to_many :categories, class_name: "PhcdevworksCoreModules::Modules::Category", :join_table => "phcdevworks_press_categories_posts"
|
16
|
+
|
16
17
|
|
17
18
|
# Form Fields Validation
|
18
19
|
validates :post_title,
|
@@ -38,33 +38,21 @@
|
|
38
38
|
<!-- -PHC- Sidebar - Sidebar Navigation -->
|
39
39
|
<ul class="nav">
|
40
40
|
|
41
|
-
<% if defined?
|
42
|
-
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks
|
43
|
-
<li class="nav-header">
|
44
|
-
<li class="has-sub">
|
45
|
-
<a href="javascript:;">
|
46
|
-
<b class="caret"></b>
|
47
|
-
<i class="fad fa-users"></i>
|
48
|
-
<span>Member"s Data</span>
|
49
|
-
</a>
|
50
|
-
<ul class="sub-menu">
|
51
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_members/member/profiles") %>"><%= link_to("Profile Index", phcdevworks_members.member_profiles_path) %></li>
|
52
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_members/member/profiles#new") %>"><%= link_to("New Member Profile", phcdevworks_members.new_member_profile_path) %></li>
|
53
|
-
</ul>
|
54
|
-
</li>
|
55
|
-
<li class="nav-header">Member"s Directory</li>
|
41
|
+
<% if defined?phcdevworks_press %>
|
42
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Press -->
|
43
|
+
<li class="nav-header">Articles & Blogging</li>
|
56
44
|
<li class="has-sub">
|
57
45
|
<a href="javascript:;">
|
58
46
|
<b class="caret"></b>
|
59
|
-
<i class="fad fa-
|
60
|
-
<span>
|
47
|
+
<i class="fad fa-newspaper"></i>
|
48
|
+
<span>Article Posts</span>
|
61
49
|
</a>
|
62
50
|
<ul class="sub-menu">
|
63
|
-
<li class="<%= phc_menu_active_controller("
|
64
|
-
<li class="<%= phc_menu_active_controller("
|
51
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_press/article/posts") %>"><%= link_to("Article Index", phcdevworks_press.article_posts_path) %></li>
|
52
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_press/article/posts#new") %>"><%= link_to("New Aritcle", phcdevworks_press.new_article_post_path) %></li>
|
65
53
|
</ul>
|
66
54
|
</li>
|
67
|
-
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks
|
55
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Press -->
|
68
56
|
<% end %>
|
69
57
|
|
70
58
|
<% if defined?phcdevworks_portfolio %>
|
@@ -84,54 +72,90 @@
|
|
84
72
|
<li class="has-sub">
|
85
73
|
<a href="javascript:;">
|
86
74
|
<b class="caret"></b>
|
87
|
-
<i class="fad fa-
|
88
|
-
<span>Project
|
75
|
+
<i class="fad fa-folders"></i>
|
76
|
+
<span>Project Types</span>
|
89
77
|
</a>
|
90
78
|
<ul class="sub-menu">
|
91
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts") %>"><%= link_to("Project
|
92
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New
|
79
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts") %>"><%= link_to("Project Type", phcdevworks_portfolio.project_types_path) %></li>
|
80
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New Types", phcdevworks_portfolio.new_project_type_path) %></li>
|
93
81
|
</ul>
|
94
82
|
</li>
|
83
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Press -->
|
84
|
+
<% end %>
|
85
|
+
|
86
|
+
<% if defined?phcdevworks_tutorials %>
|
87
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Tutorials -->
|
88
|
+
<li class="nav-header">Tutorial Posts</li>
|
95
89
|
<li class="has-sub">
|
96
90
|
<a href="javascript:;">
|
97
91
|
<b class="caret"></b>
|
98
|
-
<i class="fad fa-
|
99
|
-
<span>
|
92
|
+
<i class="fad fa-chalkboard-teacher"></i>
|
93
|
+
<span>Tutorial Posts</span>
|
100
94
|
</a>
|
101
95
|
<ul class="sub-menu">
|
102
|
-
<li class="<%= phc_menu_active_controller("
|
103
|
-
<li class="<%= phc_menu_active_controller("
|
96
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts") %>"><%= link_to "Tutorial Index", phcdevworks_tutorials.tutorial_posts_path %></li>
|
97
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts#new") %>"><%= link_to "New Tutorial", phcdevworks_tutorials.new_tutorial_post_path %></li>
|
104
98
|
</ul>
|
105
99
|
</li>
|
106
|
-
|
100
|
+
<li class="nav-header">Command Lists & Items</li>
|
101
|
+
<li class="has-sub">
|
102
|
+
<a href="javascript:;">
|
103
|
+
<b class="caret"></b>
|
104
|
+
<i class="fad fa-terminal"></i>
|
105
|
+
<span>Command Lists</span>
|
106
|
+
</a>
|
107
|
+
<ul class="sub-menu">
|
108
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/command/posts") %>"><%= link_to "List Index", phcdevworks_tutorials.command_posts_path %></li>
|
109
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/command/posts#new") %>"><%= link_to "New List", phcdevworks_tutorials.new_command_post_path %></li>
|
110
|
+
</ul>
|
111
|
+
</li>
|
112
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Tutorials -->
|
107
113
|
<% end %>
|
108
114
|
|
109
|
-
<% if defined?
|
115
|
+
<% if defined?phcdevworks_core_modules %>
|
110
116
|
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Press -->
|
111
|
-
<li class="nav-header">
|
117
|
+
<li class="nav-header">Core Modules</li>
|
112
118
|
<li class="has-sub">
|
113
119
|
<a href="javascript:;">
|
114
120
|
<b class="caret"></b>
|
115
|
-
<i class="fad fa-
|
116
|
-
<span>
|
121
|
+
<i class="fad fa-sitemap"></i>
|
122
|
+
<span>Categories</span>
|
117
123
|
</a>
|
118
124
|
<ul class="sub-menu">
|
119
|
-
<li class="<%= phc_menu_active_controller("
|
120
|
-
<li class="<%= phc_menu_active_controller("
|
125
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_core_modules/modules/categories") %>"><%= link_to("Category Index", phcdevworks_core_modules.modules_categories_path) %></li>
|
126
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_core_modules/modules/categories#new") %>"><%= link_to("New Category", phcdevworks_core_modules.new_modules_category_path) %></li>
|
121
127
|
</ul>
|
122
128
|
</li>
|
129
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Press -->
|
130
|
+
<% end %>
|
131
|
+
|
132
|
+
<% if defined?phcdevworks_members %>
|
133
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Members -->
|
134
|
+
<li class="nav-header">Membership Manager</li>
|
123
135
|
<li class="has-sub">
|
124
136
|
<a href="javascript:;">
|
125
137
|
<b class="caret"></b>
|
126
|
-
<i class="fad fa-
|
127
|
-
<span>
|
138
|
+
<i class="fad fa-users"></i>
|
139
|
+
<span>Member"s Data</span>
|
128
140
|
</a>
|
129
141
|
<ul class="sub-menu">
|
130
|
-
<li class="<%= phc_menu_active_controller("
|
131
|
-
<li class="<%= phc_menu_active_controller("
|
142
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_members/member/profiles") %>"><%= link_to("Profile Index", phcdevworks_members.member_profiles_path) %></li>
|
143
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_members/member/profiles#new") %>"><%= link_to("New Member Profile", phcdevworks_members.new_member_profile_path) %></li>
|
132
144
|
</ul>
|
133
145
|
</li>
|
134
|
-
|
146
|
+
<li class="nav-header">Member"s Directory</li>
|
147
|
+
<li class="has-sub">
|
148
|
+
<a href="javascript:;">
|
149
|
+
<b class="caret"></b>
|
150
|
+
<i class="fad fa-list-alt"></i>
|
151
|
+
<span>Member"s Directory</span>
|
152
|
+
</a>
|
153
|
+
<ul class="sub-menu">
|
154
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_members/modules/categories") %>"><%= link_to("Directory Index", phcdevworks_members.directory_categories_path) %></li>
|
155
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_members/modules/categories#new") %>"><%= link_to("New Directory Listing", phcdevworks_members.new_directory_category_path) %></li>
|
156
|
+
</ul>
|
157
|
+
</li>
|
158
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Members -->
|
135
159
|
<% end %>
|
136
160
|
|
137
161
|
<% if defined?phcdevworks_scripts %>
|
@@ -203,46 +227,6 @@
|
|
203
227
|
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks RealEstate -->
|
204
228
|
<% end %>
|
205
229
|
|
206
|
-
<% if defined?phcdevworks_tutorials %>
|
207
|
-
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Tutorials -->
|
208
|
-
<li class="nav-header">Tutorial Posts</li>
|
209
|
-
<li class="has-sub">
|
210
|
-
<a href="javascript:;">
|
211
|
-
<b class="caret"></b>
|
212
|
-
<i class="fad fa-chalkboard-teacher"></i>
|
213
|
-
<span>Tutorial Posts</span>
|
214
|
-
</a>
|
215
|
-
<ul class="sub-menu">
|
216
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts") %>"><%= link_to "Tutorial Index", phcdevworks_tutorials.tutorial_posts_path %></li>
|
217
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/posts#new") %>"><%= link_to "New Tutorial", phcdevworks_tutorials.new_tutorial_post_path %></li>
|
218
|
-
</ul>
|
219
|
-
</li>
|
220
|
-
<li class="has-sub">
|
221
|
-
<a href="javascript:;">
|
222
|
-
<b class="caret"></b>
|
223
|
-
<i class="fad fa-sitemap"></i>
|
224
|
-
<span>Tutorial Categories</span>
|
225
|
-
</a>
|
226
|
-
<ul class="sub-menu">
|
227
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/categories") %>"><%= link_to "Category Index", phcdevworks_tutorials.tutorial_categories_path %></li>
|
228
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/tutorials/categories#new") %>"><%= link_to "New Category", phcdevworks_tutorials.new_tutorial_category_path %></li>
|
229
|
-
</ul>
|
230
|
-
</li>
|
231
|
-
<li class="nav-header">Command Lists & Items</li>
|
232
|
-
<li class="has-sub">
|
233
|
-
<a href="javascript:;">
|
234
|
-
<b class="caret"></b>
|
235
|
-
<i class="fad fa-terminal"></i>
|
236
|
-
<span>Command Lists</span>
|
237
|
-
</a>
|
238
|
-
<ul class="sub-menu">
|
239
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/command/posts") %>"><%= link_to "List Index", phcdevworks_tutorials.command_posts_path %></li>
|
240
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_tutorials/command/posts#new") %>"><%= link_to "New List", phcdevworks_tutorials.new_command_post_path %></li>
|
241
|
-
</ul>
|
242
|
-
</li>
|
243
|
-
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Tutorials -->
|
244
|
-
<% end %>
|
245
|
-
|
246
230
|
<% if current_user && current_user.admin? %>
|
247
231
|
<!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
|
248
232
|
<li class="nav-header">User Administration</li>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<h4 class="panel-title">Post Categories</h4>
|
46
46
|
</div>
|
47
47
|
<div class="panel-body">
|
48
|
-
<%= form.collection_check_boxes :category_ids,
|
48
|
+
<%= form.collection_check_boxes :category_ids, PhcdevworksCoreModules::Modules::Category.all, :id, :category_name do |post_category| %>
|
49
49
|
<%= post_category.check_box %>
|
50
50
|
<%= post_category.label %><br>
|
51
51
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -2,7 +2,6 @@ PhcdevworksPress::Engine.routes.draw do
|
|
2
2
|
|
3
3
|
# Article Routes
|
4
4
|
namespace :article do
|
5
|
-
resources :categories, class_name: 'Articles::Category'
|
6
5
|
resources :posts, class_name: 'Articles::Post'
|
7
6
|
end
|
8
7
|
|
@@ -15,11 +14,11 @@ PhcdevworksPress::Engine.routes.draw do
|
|
15
14
|
namespace :api, :path => "", :constraints => {:subdomain => "api"} do
|
16
15
|
namespace :v1 do
|
17
16
|
resources :posts, defaults: {format: 'json'}
|
18
|
-
resources :categories, defaults: {format: 'json'}
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
22
20
|
# Mount Routes
|
23
21
|
mount PhcdevworksAccounts::Engine, :at => '/'
|
22
|
+
mount PhcdevworksCoreModules::Engine, :at => '/'
|
24
23
|
|
25
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_press
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -114,6 +114,20 @@ dependencies:
|
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '1.5'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: phcdevworks_core_modules
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '1.0'
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '1.0'
|
117
131
|
- !ruby/object:Gem::Dependency
|
118
132
|
name: phcdevworks_notifications
|
119
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,14 +246,14 @@ dependencies:
|
|
232
246
|
requirements:
|
233
247
|
- - "~>"
|
234
248
|
- !ruby/object:Gem::Version
|
235
|
-
version: '1.
|
249
|
+
version: '1.12'
|
236
250
|
type: :runtime
|
237
251
|
prerelease: false
|
238
252
|
version_requirements: !ruby/object:Gem::Requirement
|
239
253
|
requirements:
|
240
254
|
- - "~>"
|
241
255
|
- !ruby/object:Gem::Version
|
242
|
-
version: '1.
|
256
|
+
version: '1.12'
|
243
257
|
- !ruby/object:Gem::Dependency
|
244
258
|
name: sqlite3
|
245
259
|
requirement: !ruby/object:Gem::Requirement
|
@@ -267,38 +281,28 @@ files:
|
|
267
281
|
- Rakefile
|
268
282
|
- app/assets/config/phcdevworks_press_manifest.js
|
269
283
|
- app/assets/javascripts/phcdevworks_press/application.js
|
270
|
-
- app/assets/javascripts/phcdevworks_press/article/categories.coffee
|
271
284
|
- app/assets/javascripts/phcdevworks_press/article/posts.coffee
|
272
285
|
- app/assets/javascripts/phcdevworks_press/blog/articles.coffee
|
273
286
|
- app/assets/stylesheets/phcdevworks_press/application.scss
|
274
|
-
- app/assets/stylesheets/phcdevworks_press/article/categories.scss
|
275
287
|
- app/assets/stylesheets/phcdevworks_press/article/posts.scss
|
276
288
|
- app/assets/stylesheets/phcdevworks_press/blog/articles.scss
|
277
289
|
- app/controllers/phcdevworks_press/application_controller.rb
|
278
|
-
- app/controllers/phcdevworks_press/article/categories_controller.rb
|
279
290
|
- app/controllers/phcdevworks_press/article/posts_controller.rb
|
280
291
|
- app/controllers/phcdevworks_press/blog/articles_controller.rb
|
281
292
|
- app/helpers/phcdevworks_press/application_helper.rb
|
282
|
-
- app/helpers/phcdevworks_press/article/categories_helper.rb
|
283
293
|
- app/helpers/phcdevworks_press/article/posts_helper.rb
|
284
294
|
- app/helpers/phcdevworks_press/blog/articles_helper.rb
|
285
295
|
- app/jobs/phcdevworks_press/application_job.rb
|
286
296
|
- app/mailers/phcdevworks_press/application_mailer.rb
|
287
297
|
- app/models/phcdevworks_press/application_record.rb
|
288
298
|
- app/models/phcdevworks_press/article.rb
|
289
|
-
- app/models/phcdevworks_press/article/category.rb
|
290
299
|
- app/models/phcdevworks_press/article/post.rb
|
291
|
-
- app/models/phcdevworks_press/article_category_versions.rb
|
292
300
|
- app/models/phcdevworks_press/article_post_versions.rb
|
293
301
|
- app/views/layouts/phcdevworks_press/application.html.erb
|
294
302
|
- app/views/layouts/phcdevworks_press/components/backend/footer/_footer.html.erb
|
295
303
|
- app/views/layouts/phcdevworks_press/components/backend/navigation/_top_menu.html.erb
|
296
304
|
- app/views/layouts/phcdevworks_press/components/backend/sidebars/_side_menu.html.erb
|
297
305
|
- app/views/layouts/phcdevworks_press/frontend.html.erb
|
298
|
-
- app/views/phcdevworks_press/article/categories/_form.html.erb
|
299
|
-
- app/views/phcdevworks_press/article/categories/edit.html.erb
|
300
|
-
- app/views/phcdevworks_press/article/categories/index.html.erb
|
301
|
-
- app/views/phcdevworks_press/article/categories/new.html.erb
|
302
306
|
- app/views/phcdevworks_press/article/posts/_form.html.erb
|
303
307
|
- app/views/phcdevworks_press/article/posts/edit.html.erb
|
304
308
|
- app/views/phcdevworks_press/article/posts/index.html.erb
|
@@ -307,9 +311,7 @@ files:
|
|
307
311
|
- app/views/phcdevworks_press/blog/articles/show.html.erb
|
308
312
|
- config/routes.rb
|
309
313
|
- db/migrate/20170517064030_create_phcdevworks_press_post_versions.rb
|
310
|
-
- db/migrate/20170517064427_create_phcdevworks_press_category_versions.rb
|
311
314
|
- db/migrate/20190805232522_create_phcdevworks_press_article_posts.rb
|
312
|
-
- db/migrate/20190805232733_create_phcdevworks_press_article_categories.rb
|
313
315
|
- db/migrate/20191024232406_create_phcdevworks_press_categories_posts.rb
|
314
316
|
- lib/phcdevworks_press.rb
|
315
317
|
- lib/phcdevworks_press/engine.rb
|
File without changes
|
File without changes
|
@@ -1,83 +0,0 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class Article::CategoriesController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_article_category, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /article/categories
|
13
|
-
def index
|
14
|
-
@article_categories = Article::Category.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /article/categories/1
|
18
|
-
def show
|
19
|
-
@article_category = Article::Category.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksPress::ArticleCategoryVersions.where(item_id: params[:id], item_type: 'PhcdevworksPress::Article::Category')
|
21
|
-
end
|
22
|
-
|
23
|
-
# GET /article/categories/new
|
24
|
-
def new
|
25
|
-
@article_category = Article::Category.new
|
26
|
-
end
|
27
|
-
|
28
|
-
# GET /article/categories/1/edit
|
29
|
-
def edit
|
30
|
-
end
|
31
|
-
|
32
|
-
# POST /article/categories
|
33
|
-
def create
|
34
|
-
@article_category = Article::Category.new(article_category_params)
|
35
|
-
@article_category.user_id = current_user.id
|
36
|
-
@article_category.org_id = current_user.org_id
|
37
|
-
respond_to do |format|
|
38
|
-
if @article_category.save
|
39
|
-
format.html { redirect_to article_categories_path, :flash => { :success => 'Article Category has been Added.' }}
|
40
|
-
format.json { render :show, status: :created, location: @article_category }
|
41
|
-
else
|
42
|
-
format.html { render :new }
|
43
|
-
format.json { render json: @article_category.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# PATCH/PUT /article/categories/1
|
49
|
-
def update
|
50
|
-
respond_to do |format|
|
51
|
-
if @article_category.update(article_category_params)
|
52
|
-
format.html { redirect_to article_categories_path, :flash => { :notice => 'Article Category Name has been Updated.' }}
|
53
|
-
format.json { render :show, status: :ok, location: @article_category }
|
54
|
-
else
|
55
|
-
format.html { render :edit }
|
56
|
-
format.json { render json: @article_category.errors, status: :unprocessable_entity }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# DELETE /article/categories/1
|
62
|
-
def destroy
|
63
|
-
@article_category.destroy
|
64
|
-
respond_to do |format|
|
65
|
-
format.html { redirect_to article_categories_path, :flash => { :error => 'Category and Article Connections have all been Removed.' }}
|
66
|
-
format.json { head :no_content }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
# Common Callbacks
|
73
|
-
def set_article_category
|
74
|
-
@article_category = Article::Category.friendly.find(params[:id])
|
75
|
-
end
|
76
|
-
|
77
|
-
# Whitelist
|
78
|
-
def article_category_params
|
79
|
-
params.require(:article_category).permit(:category_name, :slug, :org_id, :user_id)
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class Article::Category < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => "PhcdevworksPress::ArticleCategoryVersions"
|
9
|
-
|
10
|
-
# Relationships
|
11
|
-
has_and_belongs_to_many :posts, class_name: "Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
|
12
|
-
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
13
|
-
|
14
|
-
# Form Fields Validation
|
15
|
-
validates :category_name,
|
16
|
-
presence: true,
|
17
|
-
uniqueness: true
|
18
|
-
|
19
|
-
# Clean URL Define
|
20
|
-
friendly_id :phcdev_article_category_nice_urls, use: [:slugged, :finders]
|
21
|
-
|
22
|
-
def phcdev_article_category_nice_urls
|
23
|
-
[:category_name]
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<!-- Form - Article - Category -->
|
2
|
-
<%= form_with(model: article_category, local: true) do |form| %>
|
3
|
-
|
4
|
-
<!-- PHCNotifi Render Validation -->
|
5
|
-
<%= render "phcdevworks_notifications/bootstrap/validations", :object => @article_category %>
|
6
|
-
<!-- PHCNotifi Render Validation -->
|
7
|
-
|
8
|
-
<!-- Form Input Fields -->
|
9
|
-
<div class="form-group field_with_errors">
|
10
|
-
<%= form.label :category_name, "Category Name" %>
|
11
|
-
<%= form.text_field :category_name, class: "form-control" %>
|
12
|
-
</div>
|
13
|
-
<!-- Form Input Fields -->
|
14
|
-
|
15
|
-
<!-- Form Submition Button -->
|
16
|
-
<div class="actions">
|
17
|
-
<%= form.submit class: "btn btn-primary" %>
|
18
|
-
</div>
|
19
|
-
<!-- For Submition Button -->
|
20
|
-
|
21
|
-
<% end %>
|
22
|
-
<!-- Form - Article - Category -->
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<!-- PHCTitleSEO Title Variables -->
|
2
|
-
<% phc_title "Article Category Manager" %>
|
3
|
-
<% phc_title_tagline "Update Category Data" %>
|
4
|
-
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
|
-
<% phc_breadcrumb_two link_to "Category Index", phcdevworks_press.article_categories_path %>
|
6
|
-
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- PHCTitleSEO Title Variables -->
|
8
|
-
|
9
|
-
<!-- Page Bradcrumbs -->
|
10
|
-
<ol class="breadcrumb pull-right">
|
11
|
-
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
-
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
-
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
-
</ol>
|
15
|
-
<!-- Page Bradcrumbs -->
|
16
|
-
|
17
|
-
<!-- Page Header -->
|
18
|
-
<h2 class="page-header"><%= yield(:phc_title) %></h2>
|
19
|
-
<!-- Page Header -->
|
20
|
-
|
21
|
-
<!-- Page Content -->
|
22
|
-
<div class="row">
|
23
|
-
<div class="col-lg-12">
|
24
|
-
|
25
|
-
<!-- Panel -->
|
26
|
-
<div class="panel panel-inverse">
|
27
|
-
|
28
|
-
<!-- Panel - Heading -->
|
29
|
-
<div class="panel-heading">
|
30
|
-
<h4 class="panel-title"><%= yield(:phc_title) %></h4>
|
31
|
-
</div>
|
32
|
-
<!-- Panel - Heading -->
|
33
|
-
|
34
|
-
<!-- Panel - Body -->
|
35
|
-
<div class="panel-body">
|
36
|
-
|
37
|
-
<!-- Edit Form -->
|
38
|
-
<%= render "form", article_category: @article_category %>
|
39
|
-
<!-- Edit Form -->
|
40
|
-
|
41
|
-
</div>
|
42
|
-
<!-- Panel - Body -->
|
43
|
-
|
44
|
-
</div>
|
45
|
-
<!-- Panel -->
|
46
|
-
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
<!-- Page Content -->
|
@@ -1,81 +0,0 @@
|
|
1
|
-
<!-- PHCTitleSEO Title Variables -->
|
2
|
-
<% phc_title "Article Category Manager" %>
|
3
|
-
<% phc_title_tagline "Category Index" %>
|
4
|
-
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
|
-
<% phc_breadcrumb_two link_to "Category Index", phcdevworks_press.article_categories_path %>
|
6
|
-
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- PHCTitleSEO Title Variables -->
|
8
|
-
|
9
|
-
<!-- Page Bradcrumbs -->
|
10
|
-
<ol class="breadcrumb pull-right">
|
11
|
-
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
-
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
-
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
-
</ol>
|
15
|
-
<!-- Page Bradcrumbs -->
|
16
|
-
|
17
|
-
<!-- Page Header -->
|
18
|
-
<h2 class="page-header"><%= yield(:phc_title) %></h2>
|
19
|
-
<!-- Page Header -->
|
20
|
-
|
21
|
-
<!-- Page Content -->
|
22
|
-
<div class="row">
|
23
|
-
<div class="col-lg-12">
|
24
|
-
|
25
|
-
<!-- Panel -->
|
26
|
-
<div class="panel panel-inverse">
|
27
|
-
|
28
|
-
<!-- Panel - Heading -->
|
29
|
-
<div class="panel-heading">
|
30
|
-
<h4 class="panel-title"><%= yield(:phc_title) %></h4>
|
31
|
-
</div>
|
32
|
-
<!-- Panel - Heading -->
|
33
|
-
|
34
|
-
<!-- Panel - Body -->
|
35
|
-
<div class="panel-body">
|
36
|
-
|
37
|
-
<!-- Index - Table -->
|
38
|
-
<div class="table-responsive">
|
39
|
-
<table class="table table-striped table-bordered">
|
40
|
-
|
41
|
-
<thead>
|
42
|
-
<tr>
|
43
|
-
<th>Category Name</th>
|
44
|
-
<th></th>
|
45
|
-
</tr>
|
46
|
-
</thead>
|
47
|
-
|
48
|
-
<tbody>
|
49
|
-
<% @article_categories.each do |article_category| %>
|
50
|
-
<tr>
|
51
|
-
<td><%= link_to article_category.category_name, phcdevworks_press.edit_article_category_path(article_category) %></td>
|
52
|
-
<td>
|
53
|
-
<div class="btn-group d-flex" role="group">
|
54
|
-
<%= link_to "Edit Category", edit_article_category_path(article_category), class: "btn btn-primary btn-xs" %>
|
55
|
-
<%= link_to "Remove Category", article_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: "Are you sure?" } %>
|
56
|
-
</div>
|
57
|
-
</td>
|
58
|
-
</tr>
|
59
|
-
<% end %>
|
60
|
-
</tbody>
|
61
|
-
|
62
|
-
</table>
|
63
|
-
</div>
|
64
|
-
<!-- Index - Table -->
|
65
|
-
|
66
|
-
<!-- New Button -->
|
67
|
-
<%= link_to phcdevworks_press.new_article_category_path, class: "btn btn-primary btn-sm" do %>
|
68
|
-
<i class="fad fa-plus-circle"></i>
|
69
|
-
<%= "Add a New Article Category" %>
|
70
|
-
<% end %>
|
71
|
-
<!-- New Button -->
|
72
|
-
|
73
|
-
</div>
|
74
|
-
<!-- Panel - Body -->
|
75
|
-
|
76
|
-
</div>
|
77
|
-
<!-- Panel -->
|
78
|
-
|
79
|
-
</div>
|
80
|
-
</div>
|
81
|
-
<!-- Page Content -->
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<!-- PHCTitleSEO Title Variables -->
|
2
|
-
<% phc_title "Article Category Manager" %>
|
3
|
-
<% phc_title_tagline "Create a New Category" %>
|
4
|
-
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
|
-
<% phc_breadcrumb_two link_to "Category Index", phcdevworks_press.article_categories_path %>
|
6
|
-
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- PHCTitleSEO Title Variables -->
|
8
|
-
|
9
|
-
<!-- Page Bradcrumbs -->
|
10
|
-
<ol class="breadcrumb pull-right">
|
11
|
-
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
-
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
-
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
-
</ol>
|
15
|
-
<!-- Page Bradcrumbs -->
|
16
|
-
|
17
|
-
<!-- Page Header -->
|
18
|
-
<h2 class="page-header"><%= yield(:phc_title) %></h2>
|
19
|
-
<!-- Page Header -->
|
20
|
-
|
21
|
-
<!-- Page Content -->
|
22
|
-
<div class="row">
|
23
|
-
<div class="col-lg-12">
|
24
|
-
|
25
|
-
<!-- Panel -->
|
26
|
-
<div class="panel panel-inverse">
|
27
|
-
|
28
|
-
<!-- Panel - Heading -->
|
29
|
-
<div class="panel-heading">
|
30
|
-
<h4 class="panel-title"><%= yield(:phc_title) %></h4>
|
31
|
-
</div>
|
32
|
-
<!-- Panel - Heading -->
|
33
|
-
|
34
|
-
<!-- Panel - Body -->
|
35
|
-
<div class="panel-body">
|
36
|
-
|
37
|
-
<!-- New Form -->
|
38
|
-
<%= render "form", article_category: @article_category %>
|
39
|
-
<!-- New Form -->
|
40
|
-
|
41
|
-
</div>
|
42
|
-
<!-- Panel - Body -->
|
43
|
-
|
44
|
-
</div>
|
45
|
-
<!-- Panel -->
|
46
|
-
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
<!-- Page Content -->
|
50
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class CreatePhcdevworksPressCategoryVersions < ActiveRecord::Migration[6.0]
|
2
|
-
TEXT_BYTES = 1_073_741_823
|
3
|
-
def change
|
4
|
-
|
5
|
-
create_table :phcdevworks_press_category_versions do |t|
|
6
|
-
t.string :item_type, {:null=>false}
|
7
|
-
t.integer :item_id, null: false
|
8
|
-
t.string :event, null: false
|
9
|
-
t.string :whodunnit
|
10
|
-
t.text :object, limit: TEXT_BYTES
|
11
|
-
t.datetime :created_at
|
12
|
-
end
|
13
|
-
|
14
|
-
add_index :phcdevworks_press_category_versions, %i(item_type item_id), :name => 'article_category_versions'
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class CreatePhcdevworksPressArticleCategories < ActiveRecord::Migration[6.0]
|
2
|
-
def change
|
3
|
-
create_table :phcdevworks_press_article_categories do |t|
|
4
|
-
|
5
|
-
t.string :category_name
|
6
|
-
|
7
|
-
t.string :slug
|
8
|
-
t.string :user_id
|
9
|
-
t.string :org_id
|
10
|
-
|
11
|
-
t.timestamps
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|