phcpresspro 69.1.0 → 70.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/README.md +8 -1
- data/app/assets/javascripts/phcpresspro/application.js +4 -1
- data/app/assets/javascripts/phcpresspro/article/categories.js +3 -0
- data/app/assets/javascripts/phcpresspro/article/posts.js +2 -0
- data/app/assets/javascripts/phcpresspro/custom/custom.js +0 -0
- data/app/assets/stylesheets/phcpresspro/application.scss +3 -1
- data/app/assets/stylesheets/phcpresspro/article/categories.scss +0 -0
- data/app/assets/stylesheets/phcpresspro/article/posts.scss +0 -0
- data/app/controllers/phcpresspro/application_controller.rb +1 -1
- data/app/controllers/phcpresspro/article/categories_controller.rb +75 -0
- data/app/controllers/phcpresspro/article/posts_controller.rb +6 -7
- data/app/helpers/phcpresspro/article/categories_helper.rb +4 -0
- data/app/helpers/phcpresspro/article/posts_helper.rb +4 -0
- data/app/mailers/phcpresspro/application_mailer.rb +1 -1
- data/app/models/phcpresspro/{modules → article}/category.rb +2 -3
- data/app/models/phcpresspro/article/post.rb +3 -4
- data/app/views/layouts/phcpresspro/application.html.erb +2 -11
- data/app/views/layouts/phcpresspro/components/backend/footer/_footer.html.erb +1 -1
- data/app/views/layouts/phcpresspro/components/backend/sidebars/_side_menu.html.erb +4 -6
- data/app/views/phcpresspro/article/categories/_form.html.erb +13 -0
- data/app/views/phcpresspro/{modules → article}/categories/edit.html.erb +1 -1
- data/app/views/phcpresspro/{modules → article}/categories/index.html.erb +3 -3
- data/app/views/phcpresspro/{modules → article}/categories/new.html.erb +2 -2
- data/app/views/phcpresspro/article/categories/show.html.erb +9 -0
- data/app/views/phcpresspro/article/posts/_form.html.erb +14 -14
- data/app/views/phcpresspro/article/posts/index.html.erb +1 -1
- data/config/routes.rb +9 -16
- data/db/migrate/{20160718204718_create_phcpresspro_article_posts.rb → 20190315010932_create_phcpresspro_article_posts.rb} +2 -3
- data/db/migrate/{20160716182936_create_phcpresspro_modules_categories.rb → 20190315040834_create_phcpresspro_article_categories.rb} +2 -3
- data/db/migrate/20190315173237_create_phcpresspro_join_table_categories_posts.rb +8 -0
- data/lib/phcpresspro/version.rb +1 -1
- metadata +20 -43
- data/app/controllers/phcpresspro/api/v1/categories_controller.rb +0 -15
- data/app/controllers/phcpresspro/api/v1/posts_controller.rb +0 -20
- data/app/controllers/phcpresspro/frontend/article_controller.rb +0 -21
- data/app/controllers/phcpresspro/modules/categories_controller.rb +0 -75
- data/app/controllers/phcpresspro/modules/connections_controller.rb +0 -75
- data/app/models/phcpresspro/api/v1/category.rb +0 -4
- data/app/models/phcpresspro/api/v1/post.rb +0 -4
- data/app/models/phcpresspro/connection_versions.rb +0 -5
- data/app/models/phcpresspro/frontend/article.rb +0 -4
- data/app/models/phcpresspro/frontend.rb +0 -7
- data/app/models/phcpresspro/modules/connection.rb +0 -25
- data/app/models/phcpresspro/modules.rb +0 -7
- data/app/views/layouts/phcpresspro/components/frontend/footer/_footer.html.erb +0 -14
- data/app/views/layouts/phcpresspro/components/frontend/footer/_footer_copyright.html.erb +0 -21
- data/app/views/layouts/phcpresspro/components/frontend/header/_slideout.html.erb +0 -24
- data/app/views/layouts/phcpresspro/components/frontend/header/_topbar.html.erb +0 -17
- data/app/views/layouts/phcpresspro/components/frontend/navigation/_navigation.html.erb +0 -29
- data/app/views/layouts/phcpresspro/components/frontend/pages/_titlebars.html.erb +0 -14
- data/app/views/layouts/phcpresspro/components/frontend/seo/_seo_main.html.erb +0 -5
- data/app/views/layouts/phcpresspro/frontend.html.erb +0 -60
- data/app/views/phcpresspro/api/v1/categories/index.json.rabl +0 -2
- data/app/views/phcpresspro/api/v1/posts/index.json.rabl +0 -2
- data/app/views/phcpresspro/api/v1/posts/show.json.rabl +0 -2
- data/app/views/phcpresspro/frontend/article/index.html.erb +0 -69
- data/app/views/phcpresspro/frontend/article/show.html.erb +0 -58
- data/app/views/phcpresspro/modules/categories/_form.html.erb +0 -17
- data/app/views/phcpresspro/modules/categories/show.html.erb +0 -22
- data/app/views/phcpresspro/modules/connections/_form.html.erb +0 -21
- data/app/views/phcpresspro/modules/connections/edit.html.erb +0 -24
- data/app/views/phcpresspro/modules/connections/index.html.erb +0 -42
- data/app/views/phcpresspro/modules/connections/new.html.erb +0 -24
- data/app/views/phcpresspro/modules/connections/show.html.erb +0 -22
- data/db/migrate/20160719221205_create_phcpresspro_modules_connections.rb +0 -17
- data/db/migrate/20170517064114_create_phcpresspro_connection_versions.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 568a5f49b83362679e43aaadabc34f79fa54a165743cf464d7080f0ca5894d69
|
4
|
+
data.tar.gz: 82c886ab0c714a0bc1a9890e8860c447587b0ea24f602a42d9b77ee67429b0c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c87e78eb8cfe8d8291be7fe4d8eac05fd32531f02d56f11085cdb02547061a9c38e7f6152118c324a32e850f9654f578526fd81c1f1fa46f7962b6fd7568d12d
|
7
|
+
data.tar.gz: 68a7ec8af071cbaaa9e861f4edfbc9a0f0ad9077818e4a38eed93343c163c101d48026c424dae5570d0f2fa363a7a1ad2c1682f17dcd4ad6b9a7ad268e7be0ee
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/phcpresspro.svg)](https://badge.fury.io/rb/phcpresspro)
|
2
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/bradpotts/phc-press-pro/blob/master/MIT-LICENSEru)
|
3
|
+
|
1
4
|
### PHCPress(PRO) (News/Blog Engine) Documentation
|
2
5
|
PHCPress(PRO) rails CMS engine to manage your website's articles, categories and media.
|
3
6
|
|
@@ -7,7 +10,7 @@ PHCPress(PRO) rails CMS engine to manage your website's articles, categories and
|
|
7
10
|
|
8
11
|
#### Step 1 - Add PHCPress to your gemfile and run command
|
9
12
|
|
10
|
-
gem 'phcpresspro', '~>
|
13
|
+
gem 'phcpresspro', '~> 59.0'
|
11
14
|
bundle install
|
12
15
|
|
13
16
|
#### Step 2 - Copy PHCPress Database Tables
|
@@ -31,3 +34,7 @@ To properly function re-compile your application's assets to copy over requried
|
|
31
34
|
All PHCPress views and layouts can be overwritten by copying files to your application.
|
32
35
|
|
33
36
|
rails generate phcpresspro:views
|
37
|
+
|
38
|
+
- [How to Override PHCPress Uploader](https://github.com/PHCNetworks/phc-press/wiki/Image-Uploader---Override)
|
39
|
+
- [How to Override Cloudinary Uploader](https://github.com/PHCNetworks/phc-press/wiki/Image-Uploader-(Cloudinary))
|
40
|
+
- [Critical Security Updates](https://github.com/PHCNetworks/phc-press/wiki/Critical-Security-Updates)
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require_dependency "phcpresspro/application_controller"
|
2
|
+
|
3
|
+
module Phcpresspro
|
4
|
+
class Article::CategoriesController < ApplicationController
|
5
|
+
|
6
|
+
# Security & Action Filters
|
7
|
+
before_action :authenticate_user!
|
8
|
+
before_action :set_paper_trail_whodunnit
|
9
|
+
before_action :set_article_category, only: [:show, :edit, :update, :destroy]
|
10
|
+
|
11
|
+
# Categories Index
|
12
|
+
def index
|
13
|
+
@article_categories = Article::Category.where(org_id: current_user.org_id)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Categories Show
|
17
|
+
def show
|
18
|
+
@article_category = Article::Category.friendly.find(params[:id])
|
19
|
+
@versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcpresspro::Article::Category')
|
20
|
+
end
|
21
|
+
|
22
|
+
# Categories New
|
23
|
+
def new
|
24
|
+
@article_category = Article::Category.new
|
25
|
+
@article_category.user_id = current_user.id
|
26
|
+
@article_category.org_id = current_user.org_id
|
27
|
+
end
|
28
|
+
|
29
|
+
# Categories Edit
|
30
|
+
def edit
|
31
|
+
end
|
32
|
+
|
33
|
+
# POST
|
34
|
+
def create
|
35
|
+
@article_category = Article::Category.new(article_category_params)
|
36
|
+
@article_category.user_id = current_user.id
|
37
|
+
@article_category.org_id = current_user.org_id
|
38
|
+
if @article_category.save
|
39
|
+
redirect_to article_categories_url, notice: 'Category was successfully created.'
|
40
|
+
else
|
41
|
+
render :new
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# PATCH/PUT
|
46
|
+
def update
|
47
|
+
@article_category.user_id = current_user.id
|
48
|
+
@article_category.org_id = current_user.org_id
|
49
|
+
if @article_category.update(article_category_params)
|
50
|
+
redirect_to article_categories_url, notice: 'Category was successfully updated.'
|
51
|
+
else
|
52
|
+
render :edit
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# DELETE
|
57
|
+
def destroy
|
58
|
+
@article_category.destroy
|
59
|
+
redirect_to article_categories_url, notice: 'Category was successfully destroyed.'
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
# Use callbacks to share common setup or constraints between actions.
|
65
|
+
def set_article_category
|
66
|
+
@article_category = Article::Category.find(params[:id])
|
67
|
+
end
|
68
|
+
|
69
|
+
# Only allow a trusted parameter "white list" through.
|
70
|
+
def article_category_params
|
71
|
+
params.require(:article_category).permit(:catname, :slug, :user_id, :org_id)
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
@@ -7,7 +7,6 @@ module Phcpresspro
|
|
7
7
|
before_action :authenticate_user!
|
8
8
|
before_action :set_paper_trail_whodunnit
|
9
9
|
before_action :set_article_post, only: [:show, :edit, :update, :destroy]
|
10
|
-
layout "phcpresspro/application"
|
11
10
|
|
12
11
|
# Article Index
|
13
12
|
def index
|
@@ -51,8 +50,8 @@ module Phcpresspro
|
|
51
50
|
if @article_post.update(article_post_params)
|
52
51
|
@article_post.connections.build
|
53
52
|
redirect_to article_posts_url, notice: 'Post was successfully updated.'
|
54
|
-
|
55
|
-
|
53
|
+
else
|
54
|
+
render :edit
|
56
55
|
end
|
57
56
|
end
|
58
57
|
|
@@ -64,14 +63,14 @@ module Phcpresspro
|
|
64
63
|
|
65
64
|
private
|
66
65
|
|
67
|
-
#
|
66
|
+
# Use callbacks to share common setup or constraints between actions.
|
68
67
|
def set_article_post
|
69
|
-
@article_post = Article::Post.
|
68
|
+
@article_post = Article::Post.find(params[:id])
|
70
69
|
end
|
71
70
|
|
72
|
-
#
|
71
|
+
# Only allow a trusted parameter "white list" through.
|
73
72
|
def article_post_params
|
74
|
-
params.require(:article_post).permit(:
|
73
|
+
params.require(:article_post).permit(:psttittle, :psttext, :pststatus, :pstimage, :remove_pstimage, :slug, :user_id, :org_id, category_ids: [])
|
75
74
|
end
|
76
75
|
|
77
76
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Phcpresspro
|
2
|
-
class
|
2
|
+
class Article::Category < ApplicationRecord
|
3
3
|
|
4
4
|
# Clean URL Initialize
|
5
5
|
extend FriendlyId
|
@@ -8,8 +8,7 @@ module Phcpresspro
|
|
8
8
|
has_paper_trail :class_name => 'Phcpresspro::CategoryVersions'
|
9
9
|
|
10
10
|
# Relationships
|
11
|
-
has_many :
|
12
|
-
has_many :posts, class_name: 'Phcpresspro::Modules::Category', :through => :connections
|
11
|
+
has_many :posts, class_name: 'Phcpresspro::Article::Post'
|
13
12
|
|
14
13
|
# Validation for Form Fields
|
15
14
|
validates :catname,
|
@@ -11,11 +11,10 @@ module Phcpresspro
|
|
11
11
|
has_one_attached :pstimage
|
12
12
|
|
13
13
|
# Model Relationships
|
14
|
-
has_many :
|
15
|
-
has_many :categories, class_name: 'Phcpresspro::Modules::Category', :through => :connections
|
14
|
+
has_many :categories, class_name: 'Phcpresspro::Article::Category'
|
16
15
|
|
17
16
|
# Validation for Form Fields
|
18
|
-
validates :
|
17
|
+
validates :psttittle,
|
19
18
|
presence: true,
|
20
19
|
length: { minimum: 3 }
|
21
20
|
|
@@ -32,7 +31,7 @@ module Phcpresspro
|
|
32
31
|
# Define for Multiple Records
|
33
32
|
def phcpresspro_post_slug
|
34
33
|
[
|
35
|
-
[:
|
34
|
+
[:psttittle]
|
36
35
|
]
|
37
36
|
end
|
38
37
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<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"/>
|
17
17
|
|
18
18
|
<!-- Requried Style Sheets -->
|
19
|
-
<%= stylesheet_link_tag "
|
19
|
+
<%= stylesheet_link_tag "phcpresspro/application", media: "all", 'data-turbolinks-track': 'reload' %>
|
20
20
|
|
21
21
|
<!-- Security -->
|
22
22
|
<%= csrf_meta_tags %>
|
@@ -61,17 +61,8 @@
|
|
61
61
|
<!-- Page Container -->
|
62
62
|
|
63
63
|
<!-- Requried JavaScripts -->
|
64
|
-
<%= javascript_include_tag "
|
64
|
+
<%= javascript_include_tag "phcpresspro/application", 'data-turbolinks-track': 'reload' %>
|
65
65
|
<script src="https://cdn.ckeditor.com/4.10.0/full/ckeditor.js"></script>
|
66
|
-
|
67
|
-
<!-- WTF Slowing Down my Site. Nothing Nice to Say. Keep Bad Comments to Myself -->
|
68
|
-
<!--[if lt IE 9]>
|
69
|
-
<script src="https://frmwrks.phcnetworks.net/coloradmin/version-latest/admin/template/assets/crossbrowserjs/html5shiv.js"></script>
|
70
|
-
<script src="https://frmwrks.phcnetworks.net/coloradmin/version-latest/admin/template/assets/crossbrowserjs/respond.min.js"></script>
|
71
|
-
<script src="https://frmwrks.phcnetworks.net/coloradmin/version-latest/admin/template/assets/crossbrowserjs/excanvas.min.js"></script>
|
72
|
-
<![endif]-->
|
73
|
-
<!-- WTF Slowing Down my Site. Nothing Nice to Say. Keep Bad Comments to Myself -->
|
74
|
-
|
75
66
|
<script>
|
76
67
|
$(document).ready(function() {
|
77
68
|
App.init();
|
@@ -1 +1 @@
|
|
1
|
-
<span class="float-left">© 2012-<%= Time.now.year %> - <strong>PHC</strong>Press(Pro) Engine v<%= Gem.loaded_specs["phcpresspro"].version.to_s %></span> <span class="float-right">Developed with <i class="fas fa-heart hanna_hearts"></i> by <strong>PHC</strong>
|
1
|
+
<span class="float-left">© 2012-<%= Time.now.year %> - <strong>PHC</strong>Press(Pro) Engine v<%= Gem.loaded_specs["phcpresspro"].version.to_s %></span> <span class="float-right">Developed with <i class="fas fa-heart hanna_hearts"></i> by <strong>PHC</strong>Devworks</span>
|
@@ -44,8 +44,8 @@
|
|
44
44
|
<span>Article Posts</span>
|
45
45
|
</a>
|
46
46
|
<ul class="sub-menu">
|
47
|
-
<li><%= link_to('Article Index', phcpresspro.article_posts_path) %></li>
|
48
|
-
<li><%= link_to('New Aritcle', phcpresspro.new_article_post_path) %></li>
|
47
|
+
<li class="<%= is_active_controller('phcpresspro/article/posts') %>"><%= link_to('Article Index', phcpresspro.article_posts_path) %></li>
|
48
|
+
<li class="<%= is_active_controller('phcpresspro/article/posts#new') %>"><%= link_to('New Aritcle', phcpresspro.new_article_post_path) %></li>
|
49
49
|
</ul>
|
50
50
|
</li>
|
51
51
|
<li class="has-sub">
|
@@ -55,10 +55,8 @@
|
|
55
55
|
<span>Article Categories</span>
|
56
56
|
</a>
|
57
57
|
<ul class="sub-menu">
|
58
|
-
<li><%= link_to('Category Index', phcpresspro.
|
59
|
-
<li><%= link_to('New Category', phcpresspro.
|
60
|
-
<li><%= link_to('Category Manager', phcpresspro.modules_connections_path) %></li>
|
61
|
-
<li><%= link_to('Connect Article', phcpresspro.new_modules_connection_path) %></li>
|
58
|
+
<li class="<%= is_active_controller('phcpresspro/article/categories') %>"><%= link_to('Category Index', phcpresspro.article_categories_path) %></li>
|
59
|
+
<li class="<%= is_active_controller('phcpresspro/article/categories#new') %>"><%= link_to('New Category', phcpresspro.new_article_category_path) %></li>
|
62
60
|
</ul>
|
63
61
|
</li>
|
64
62
|
<!-- Sidebar - Sidebar Navigation - PHCPressPro -->
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= form_with(model: article_category, local: true) do |form| %>
|
2
|
+
|
3
|
+
<!-- PHCPressPro - Category Form -->
|
4
|
+
<div class="form-group">
|
5
|
+
<%= form.label :catname, "Category Name" %>
|
6
|
+
<%= form.text_field :catname, class: "form-control" %>
|
7
|
+
</div>
|
8
|
+
<div class="actions">
|
9
|
+
<%= form.submit class: "btn btn-primary" %>
|
10
|
+
</div>
|
11
|
+
<!-- PHCPressPro - Category Form -->
|
12
|
+
|
13
|
+
<% end %>
|
@@ -25,10 +25,10 @@
|
|
25
25
|
</tr>
|
26
26
|
</thead>
|
27
27
|
<tbody>
|
28
|
-
<% @
|
28
|
+
<% @article_categories.each do |article_category| %>
|
29
29
|
<tr>
|
30
|
-
<td><%= link_to
|
31
|
-
<td><%= link_to 'Trash',
|
30
|
+
<td><%= link_to article_category.catname, phcpresspro.edit_article_category_path(article_category) %></td>
|
31
|
+
<td><%= link_to 'Trash', article_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
32
32
|
</tr>
|
33
33
|
<% end %>
|
34
34
|
</tbody>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<!-- Title System -->
|
2
2
|
<% phc_title "Plugin: Article Category Manager" %>
|
3
3
|
<% phc_title_tagline "Create a New Category" %>
|
4
|
-
<% phc_breadcrumb_one link_to "Category Index", phcpresspro.
|
4
|
+
<% phc_breadcrumb_one link_to "Category Index", phcpresspro.article_categories_path %>
|
5
5
|
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
6
|
<!-- Title System -->
|
7
7
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
</div>
|
18
18
|
<div class="panel-body">
|
19
19
|
<!-- Table - Category New Form -->
|
20
|
-
<%= render 'form',
|
20
|
+
<%= render 'form', article_category: @article_category %>
|
21
21
|
<!-- Table - Category New Form -->
|
22
22
|
</div>
|
23
23
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%=
|
1
|
+
<%= form_with(model: article_post, local: true) do |form| %>
|
2
2
|
<div class="row">
|
3
3
|
<div class="col-md-3">
|
4
4
|
|
@@ -8,11 +8,11 @@
|
|
8
8
|
</div>
|
9
9
|
<div class="panel-body">
|
10
10
|
<div class="form-group">
|
11
|
-
<%=
|
12
|
-
<%=
|
11
|
+
<%= form.label :pststatus, "Post Status" %>
|
12
|
+
<%= form.select( :pststatus, [['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" %>
|
16
16
|
</div>
|
17
17
|
</div>
|
18
18
|
</div>
|
@@ -23,13 +23,13 @@
|
|
23
23
|
</div>
|
24
24
|
<div class="panel-body">
|
25
25
|
<div class="form-group">
|
26
|
-
<%=
|
27
|
-
<%=
|
26
|
+
<%= form.label :pstimage, "Featured Image" %>
|
27
|
+
<%= form.file_field :pstimage, class: "form-control" %>
|
28
28
|
</div>
|
29
|
-
<% if
|
30
|
-
<%= image_tag
|
31
|
-
<%=
|
32
|
-
<%=
|
29
|
+
<% if form.object.pstimage? %>
|
30
|
+
<%= image_tag form.object.pstimage_url, class: "img-responsive img-thumbnail" %>
|
31
|
+
<%= form.label :remove_pstimage %>
|
32
|
+
<%= form.check_box :remove_pstimage %>
|
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
|
-
<%=
|
42
|
+
<%= form.collection_check_boxes :category_ids, Phcpresspro::Article::Category.all, :id, :catname do |post_category| %>
|
43
43
|
<%= post_category.check_box %>
|
44
44
|
<%= post_category.label %></br>
|
45
45
|
<% end %>
|
@@ -54,8 +54,8 @@
|
|
54
54
|
<!-- PHCNotifi Render Validation -->
|
55
55
|
|
56
56
|
<div class="form-group">
|
57
|
-
<%=
|
58
|
-
<%=
|
57
|
+
<%= form.label :psttittle, "Article Title" %>
|
58
|
+
<%= form.text_field :psttittle, class: "form-control" %>
|
59
59
|
</div>
|
60
60
|
|
61
61
|
<div class="panel panel-inverse">
|
@@ -69,7 +69,7 @@
|
|
69
69
|
</div>
|
70
70
|
<div class="panel-body panel-form">
|
71
71
|
<div class="form-group">
|
72
|
-
<%=
|
72
|
+
<%= form.text_area :psttext, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
|
73
73
|
</div>
|
74
74
|
</div>
|
75
75
|
</div>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<tbody>
|
31
31
|
<% @article_posts.each do |article_post| %>
|
32
32
|
<tr>
|
33
|
-
<td><%= article_post.
|
33
|
+
<td><%= article_post.psttittle %></td>
|
34
34
|
<td><%= truncate(article_post.psttext, :length => 80, :escape => false) %></td>
|
35
35
|
<td><%= article_post.pststatus.capitalize %></td>
|
36
36
|
<td><div class="btn-group" role="group" aria-label="Blog Articles">
|
data/config/routes.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
Phcpresspro::Engine.routes.draw do
|
2
2
|
|
3
|
-
#
|
4
|
-
|
5
|
-
|
3
|
+
# Add Accounts and Logins
|
4
|
+
mount Phcaccountspro::Engine => "/"
|
5
|
+
|
6
|
+
# Application Routes
|
7
|
+
namespace :article do
|
8
|
+
resources :categories, class_name: 'Phcpresspro::Articles::Category'
|
9
|
+
resources :posts, class_name: 'Phcpresspro::Articles::Post'
|
6
10
|
end
|
7
|
-
|
8
|
-
# API
|
11
|
+
|
12
|
+
# Application API
|
9
13
|
namespace :api do
|
10
14
|
namespace :v1 do
|
11
15
|
resources :posts, defaults: {format: 'json'}
|
@@ -13,15 +17,4 @@ Phcpresspro::Engine.routes.draw do
|
|
13
17
|
end
|
14
18
|
end
|
15
19
|
|
16
|
-
# Article Routes
|
17
|
-
namespace :article do
|
18
|
-
resources :posts, class_name: 'Phcpresspro::Articles::Post'
|
19
|
-
end
|
20
|
-
|
21
|
-
# Module Routes
|
22
|
-
namespace :modules do
|
23
|
-
resources :connections, class_name: 'Phcpresspro::Modules::Connection'
|
24
|
-
resources :categories, class_name: 'Phcpresspro::Modules::Category'
|
25
|
-
end
|
26
|
-
|
27
20
|
end
|
@@ -2,13 +2,12 @@ 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.
|
5
|
+
t.string :psttittle
|
6
|
+
t.string :psttext
|
7
7
|
t.string :pststatus
|
8
8
|
t.string :pstimage
|
9
9
|
|
10
10
|
t.string :slug
|
11
|
-
|
12
11
|
t.string :user_id
|
13
12
|
t.string :org_id
|
14
13
|
|
@@ -1,11 +1,10 @@
|
|
1
|
-
class
|
1
|
+
class CreatePhcpressproArticleCategories < ActiveRecord::Migration[5.2]
|
2
2
|
def change
|
3
|
-
create_table :
|
3
|
+
create_table :phcpresspro_article_categories do |t|
|
4
4
|
|
5
5
|
t.string :catname
|
6
6
|
|
7
7
|
t.string :slug
|
8
|
-
|
9
8
|
t.string :user_id
|
10
9
|
t.string :org_id
|
11
10
|
|
data/lib/phcpresspro/version.rb
CHANGED