phcpresspro 86.3.0 → 87.0.1
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 +20 -9
- data/Rakefile +4 -18
- data/app/assets/config/phcpresspro_manifest.js +2 -2
- data/app/controllers/phcpresspro/application_controller.rb +4 -5
- 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 +18 -18
- data/app/models/phcpresspro/article/post.rb +21 -21
- data/app/views/layouts/phcpresspro/application.html.erb +58 -65
- data/app/views/layouts/phcpresspro/components/backend/footer/_footer.html.erb +14 -6
- data/app/views/layouts/phcpresspro/components/backend/navigation/_top_menu.html.erb +41 -37
- data/app/views/layouts/phcpresspro/components/backend/sidebars/_side_menu.html.erb +921 -189
- data/app/views/layouts/phcpresspro/frontend.html.erb +2 -2
- data/app/views/phcpresspro/article/categories/_form.html.erb +16 -16
- data/app/views/phcpresspro/article/categories/edit.html.erb +21 -17
- data/app/views/phcpresspro/article/categories/index.html.erb +35 -34
- data/app/views/phcpresspro/article/categories/new.html.erb +21 -17
- data/app/views/phcpresspro/article/posts/_form.html.erb +11 -16
- data/app/views/phcpresspro/article/posts/edit.html.erb +10 -10
- data/app/views/phcpresspro/article/posts/index.html.erb +28 -27
- data/app/views/phcpresspro/article/posts/new.html.erb +10 -10
- data/app/views/phcpresspro/blog/articles/index.html.erb +1 -1
- data/config/routes.rb +16 -19
- data/db/migrate/20170509002355_create_phcpresspro_friendly_id_slugs.rb +18 -0
- data/db/migrate/20170517064030_create_phcpresspro_post_versions.rb +17 -0
- data/db/migrate/20170517064427_create_phcpresspro_category_versions.rb +17 -0
- data/db/migrate/20190315010932_create_phcpresspro_article_posts.rb +19 -0
- data/db/migrate/20190315040834_create_phcpresspro_article_categories.rb +16 -0
- data/db/migrate/20190315173237_create_join_table_categories_posts.rb +8 -0
- data/lib/phcpresspro/engine.rb +42 -68
- data/lib/phcpresspro/version.rb +1 -1
- data/lib/phcpresspro.rb +2 -0
- metadata +71 -391
- data/app/assets/javascripts/phcpresspro/application.js +0 -2
- data/app/assets/stylesheets/phcpresspro/application.scss +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b2f1802a8a1bec7f8735e1d8f2dca4569ad98d03edec3854e2d9dd51c1cd2df
|
4
|
+
data.tar.gz: 3b8b312086952d8d79e6bee847fbaad20cbce9cae9acb9a81b5cb18cdbd283b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92d9423e585cd6fd1a25592012d0e6199eb062a7ad35c4a42279fd566e6f1f7e5af4dc58410ce94d3be24e5c9677ddfa19dc5d4e82deba27107323e4cca59912
|
7
|
+
data.tar.gz: 14ebd8182892b13362517d4b4c6b7d7a6c482ad35951e078a228c5d022583ba702567df15ad313f748206bd1227fb2de0f1785ef67fbc0fac1b7898cd2f26441
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,3 @@
|
|
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
|
-
|
4
1
|
### PHCPress(PRO) (News/Blog Engine) Documentation
|
5
2
|
PHCPress(PRO) rails CMS engine to manage your website's articles, categories and media.
|
6
3
|
|
@@ -12,25 +9,39 @@ PHCPress(PRO) rails CMS engine to manage your website's articles, categories and
|
|
12
9
|
|
13
10
|
gem 'phcpresspro'
|
14
11
|
bundle install
|
15
|
-
|
16
|
-
#### Step 2
|
17
|
-
|
12
|
+
|
13
|
+
#### Step 2 Add either [PHCDevworks Accounts Devise](https://github.com/phcdevworks/phcdevworks_accounts_devise) or [Devise](https://github.com/heartcombo/devise)
|
14
|
+
|
15
|
+
#### 2a - Add authentication option 1 to your gemfile. Can pick option 1 or 2
|
16
|
+
This plugin is optimized for PHCDevworks Accounts Devise (Skins built using Devise).
|
17
|
+
|
18
|
+
gem 'phcdevworks_accounts_devise'
|
19
|
+
bundle install
|
20
|
+
|
21
|
+
#### Step 2b - Or you can add authentication option 2 to your gemfile.
|
22
|
+
This plugin can run fine with devise to run and operate.
|
23
|
+
|
24
|
+
gem 'devise'
|
25
|
+
bundle install
|
26
|
+
|
27
|
+
#### Step 3 - Copy PHCPress Database Tables
|
28
|
+
To copy PHCPress' required database migrations, copy each command individually to your terminal's command line.
|
18
29
|
|
19
30
|
rails phcpresspro:install:migrations
|
20
31
|
rails db:migrate
|
21
32
|
|
22
|
-
#### Step
|
33
|
+
#### Step 4 - Mount PHCPress & Add Routes
|
23
34
|
Mount PHCPress by adding code below to your routes file.
|
24
35
|
|
25
36
|
mount Phcpresspro::Engine, :at => '/'
|
26
37
|
|
27
|
-
#### Step
|
38
|
+
#### Step 5 - Recompile Assets
|
28
39
|
To properly function re-compile your application's assets to copy over requried files.
|
29
40
|
|
30
41
|
rails assets:clobber
|
31
42
|
rails assets:precompile
|
32
43
|
|
33
|
-
#### Step
|
44
|
+
#### Step 6 - Generate Contact Form View (Customization)
|
34
45
|
All PHCPress views and layouts can be overwritten by copying files to your application.
|
35
46
|
|
36
47
|
rails generate phcpresspro:views
|
data/Rakefile
CHANGED
@@ -1,22 +1,8 @@
|
|
1
|
-
|
2
|
-
require 'bundler/setup'
|
3
|
-
rescue LoadError
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'rdoc/task'
|
8
|
-
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = 'Phcpresspro'
|
12
|
-
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.md')
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
end
|
1
|
+
require "bundler/setup"
|
16
2
|
|
17
3
|
APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
|
18
|
-
load
|
4
|
+
load "rails/tasks/engine.rake"
|
19
5
|
|
20
|
-
load
|
6
|
+
load "rails/tasks/statistics.rake"
|
21
7
|
|
22
|
-
require
|
8
|
+
require "bundler/gem_tasks"
|
@@ -1,2 +1,2 @@
|
|
1
|
-
//=
|
2
|
-
//=
|
1
|
+
//= link coloradmin/default/phcthemes_admin_panel_pack_coloradmin.css
|
2
|
+
//= link coloradmin/phcthemes_admin_panel_pack_coloradmin.js
|
@@ -5,11 +5,10 @@ module Phcpresspro
|
|
5
5
|
protect_from_forgery with: :exception
|
6
6
|
|
7
7
|
# Load Requried Helper Files
|
8
|
-
helper
|
9
|
-
helper
|
10
|
-
helper
|
11
|
-
helper
|
12
|
-
helper Phcnotifi::Engine.helpers
|
8
|
+
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
+
helper PhcdevworksNotifications::Engine.helpers
|
10
|
+
helper PhcdevworksTitleseo::Engine.helpers
|
11
|
+
helper PhcdevworksCore::Engine.helpers
|
13
12
|
|
14
13
|
# Papertrail Whodunnit Username
|
15
14
|
def user_for_paper_trail
|
@@ -4,7 +4,7 @@ module Phcpresspro
|
|
4
4
|
class Article::CategoriesController < ApplicationController
|
5
5
|
|
6
6
|
# Include Core Helpers, Security & Action Filters
|
7
|
-
include
|
7
|
+
include PhcdevworksCore::PhcdevPluginsHelper
|
8
8
|
before_action :authenticate_user!
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_article_category, only: [:edit, :update, :destroy]
|
@@ -4,7 +4,7 @@ module Phcpresspro
|
|
4
4
|
class Article::PostsController < ApplicationController
|
5
5
|
|
6
6
|
# Include Core Helpers, Security & Action Filters
|
7
|
-
include
|
7
|
+
include PhcdevworksCore::PhcdevPluginsHelper
|
8
8
|
before_action :authenticate_user!
|
9
9
|
before_action :set_paper_trail_whodunnit
|
10
10
|
before_action :set_article_post, only: [:edit, :update, :destroy]
|
@@ -1,27 +1,27 @@
|
|
1
1
|
module Phcpresspro
|
2
|
-
|
2
|
+
class Article::Category < ApplicationRecord
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'Phcpresspro::CategoryVersions'
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
# Relationships
|
11
|
+
has_and_belongs_to_many :posts, class_name: 'Phcpresspro::Article::Post', :join_table => 'categories_posts', :dependent => :destroy
|
12
|
+
belongs_to :user, class_name: 'PhcdevworksAccountsDevise::User'
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
# Form Fields Validation
|
15
|
+
validates :category_name,
|
16
|
+
presence: true,
|
17
|
+
uniqueness: true
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
# Clean URL Define
|
20
|
+
friendly_id :phc_nice_url_slug, use: [:slugged, :finders]
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
def phc_nice_url_slug
|
23
|
+
[:category_name]
|
24
|
+
end
|
25
25
|
|
26
|
-
|
26
|
+
end
|
27
27
|
end
|
@@ -1,32 +1,32 @@
|
|
1
1
|
module Phcpresspro
|
2
|
-
|
2
|
+
class Article::Post < ApplicationRecord
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'Phcpresspro::PostVersions'
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
# Image Upload
|
11
|
+
has_one_attached :post_image
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
# Relationships
|
14
|
+
has_and_belongs_to_many :categories, class_name: 'Phcpresspro::Article::Category', :join_table => 'categories_posts'
|
15
|
+
belongs_to :user, class_name: 'PhcdevworksAccountsDevise::User'
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
# Form Fields Validation
|
18
|
+
validates :post_title,
|
19
|
+
presence: true
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
validates :post_text,
|
22
|
+
presence: true
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
# Clean URL Define
|
25
|
+
friendly_id :phcpress_post_slug, use: [:slugged, :finders]
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
def phcpress_post_slug
|
28
|
+
[:post_title]
|
29
|
+
end
|
30
30
|
|
31
|
-
|
31
|
+
end
|
32
32
|
end
|
@@ -1,80 +1,73 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
<head>
|
3
|
+
<head>
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
<!-- SEO System -->
|
6
|
+
<% phc_seo_title "BradPotts - PHCPress-Pro" %>
|
7
|
+
<% phc_seo_description "Ruby on Rails 7 engine to manage your website's articles, categories and media." %>
|
8
|
+
<!-- SEO System -->
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<!-- SEO and Site Description -->
|
10
|
+
<!-- SEO and Site Description -->
|
11
|
+
<meta charset="utf-8">
|
12
|
+
<title><%= yield(:phc_seo_title) %></title>
|
13
|
+
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
|
14
|
+
<meta name="description" content="<%= yield(:phc_seo_description) %>">
|
15
|
+
<!-- SEO and Site Description -->
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
<!-- Rails Security Tags -->
|
18
|
+
<%= csrf_meta_tags %>
|
19
|
+
<%= csp_meta_tag %>
|
20
|
+
<!-- Rails Security Tags -->
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
<!-- CSS Styles -->
|
23
|
+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
|
24
|
+
<%= stylesheet_link_tag "coloradmin/default/phcthemes_admin_panel_pack_coloradmin", media: "all" %>
|
25
|
+
<!-- CSS Styles -->
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
<!-- Font -->
|
27
|
+
</head>
|
28
|
+
<body>
|
30
29
|
|
31
|
-
|
32
|
-
<
|
30
|
+
<!-- -PHCDEV- Page Container -->
|
31
|
+
<div id="app" class="app app-header-fixed app-sidebar-fixed app-with-wide-sidebar">
|
33
32
|
|
34
|
-
|
35
|
-
|
33
|
+
<!-- -PHCDEV- Page Container - Header -->
|
34
|
+
<div id="header" class="app-header">
|
35
|
+
<%= render "layouts/phcpresspro/components/backend/navigation/top_menu" %>
|
36
|
+
</div>
|
37
|
+
<!-- -PHCDEV- Page Container - Header -->
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
<!-- -PHCDEV- Page Container - Sidebar -->
|
40
|
+
<div id="sidebar" class="app-sidebar" data-disable-slide-animation="true">
|
41
|
+
<%= render "layouts/phcpresspro/components/backend/sidebars/side_menu" %>
|
42
|
+
</div>
|
43
|
+
<div class="app-sidebar-bg"></div>
|
44
|
+
<div class="app-sidebar-mobile-backdrop"><a href="#" data-dismiss="app-sidebar-mobile" class="stretched-link"></a></div>
|
45
|
+
<!-- -PHCDEV- Page Container - Sidebar -->
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
<!-- -PHCDEV- Page Container - Content -->
|
48
|
+
<div id="app" class="app app-content-full-height">
|
49
|
+
<div id="content" class="app-content d-flex flex-column p-0">
|
50
|
+
<!-- -PHCDEV- Page Container - Main -->
|
51
|
+
<div class="app-content-padding flex-grow-1 overflow-hidden" data-scrollbar="true" data-height="100%">
|
52
|
+
<%= render "phcdevworks_notifications/bootstrap/notifications" %>
|
53
|
+
<%= yield %>
|
54
|
+
</div>
|
55
|
+
<!-- -PHCDEV- Page Container - Main -->
|
56
|
+
<!-- -PHCDEV- Page Container - Footer -->
|
57
|
+
<div id="footer" class="app-footer m-0">
|
58
|
+
<%= render "layouts/phcpresspro/components/backend/footer/footer" %>
|
59
|
+
</div>
|
60
|
+
<!-- -PHCDEV- Page Container - Footer -->
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
<!-- -PHCDEV- Page Container - Content -->
|
49
64
|
|
50
|
-
|
51
|
-
|
52
|
-
<%= render 'phcnotifi/default/notifications' %>
|
53
|
-
<%= yield %>
|
54
|
-
</div>
|
55
|
-
<!-- Page Content -->
|
65
|
+
</div>
|
66
|
+
<!-- -PHCDEV- Page Container -->
|
56
67
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
</div>
|
61
|
-
<!-- Footer Content -->
|
68
|
+
<!-- JavaScript -->
|
69
|
+
<%= javascript_include_tag "coloradmin/phcthemes_admin_panel_pack_coloradmin" %>
|
70
|
+
<!-- JavaScript -->
|
62
71
|
|
63
|
-
|
64
|
-
<!-- Page Container -->
|
65
|
-
|
66
|
-
<!-- JavaScript -->
|
67
|
-
<%= javascript_include_tag "phcpresspro/application", 'data-turbolinks-track': 'reload' %>
|
68
|
-
<script src="https://cdn.ckeditor.com/4.10.0/full/ckeditor.js"></script>
|
69
|
-
<!-- JavaScript -->
|
70
|
-
|
71
|
-
<!-- JavaScript Loader -->
|
72
|
-
<script>
|
73
|
-
$(document).ready(function() {
|
74
|
-
App.init();
|
75
|
-
});
|
76
|
-
</script>
|
77
|
-
<!-- JavaScript Loader -->
|
78
|
-
|
79
|
-
</body>
|
72
|
+
</body>
|
80
73
|
</html>
|
@@ -1,9 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<!-- -PHCDEV- Page Container - Footer - Left -->
|
2
|
+
<span>
|
3
|
+
<!-- -PHCDEV- Page Container - Footer - Left - Copyright -->
|
4
|
+
<i class="fab fa-osi font-weight-bolder"></i> <%= Time.now.year %>
|
5
|
+
<span class="phc_dev_strong_plugin">PHC</span><span class="phc_dev_light_plugin">Press (Pro)</span> - Engine v<%= Gem.loaded_specs["phcpresspro"].version.to_s %>
|
6
|
+
<!-- -PHCDEV- Page Container - Footer - Left - Copyright -->
|
5
7
|
</span>
|
8
|
+
<!-- -PHCDEV- Page Container - Footer - Left -->
|
9
|
+
|
10
|
+
<!-- -PHCDEV- Page Container - Footer - Right -->
|
6
11
|
<span class="float-right">
|
7
|
-
|
8
|
-
|
12
|
+
<!-- -PHCDEV- Page Container - Footer - Right - Developed -->
|
13
|
+
Developed with <i class="fas fa-heart hanna_hearts"></i> by
|
14
|
+
<a class="phcnet_copyright text-dark" href="https://rubygems.org/profiles/bradpotts" target="_blank"><u><span class="phc_dev_strong_plugin">Brad</span><span class="phc_dev_light_plugin">Potts</span></u></a>
|
15
|
+
<!-- -PHCDEV- Page Container - Footer - Right - Developed -->
|
9
16
|
</span>
|
17
|
+
<!-- -PHCDEV- Page Container - Footer - Right -->
|
@@ -1,37 +1,41 @@
|
|
1
|
-
<!-- Topbar - Navigation Header -->
|
2
|
-
<div class="navbar-header">
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
<span class="icon-bar"></span>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
1
|
+
<!-- -PHCDEV- Topbar - Navigation Header -->
|
2
|
+
<div class="navbar-header">
|
3
|
+
|
4
|
+
<button type="button" class="navbar-mobile-toggler" data-toggle="app-sidebar-mobile">
|
5
|
+
<span class="icon-bar"></span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
</button>
|
9
|
+
|
10
|
+
<%= link_to phcdevworks_accounts_devise.user_path, class: "navbar-brand" do %>
|
11
|
+
<span class="phc_dev_strong_plugin_logo">PHC</span><span class="phc_dev_light_plugin_logo">Press</span>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
</div>
|
15
|
+
<!-- -PHCDEV- Topbar - Navigation Header -->
|
16
|
+
|
17
|
+
<!-- -PHCDEV- Topbar - Navigation Main -->
|
18
|
+
<% if current_user %>
|
19
|
+
<div class="navbar-nav">
|
20
|
+
<div class="navbar-item navbar-user dropdown">
|
21
|
+
<a href="#" class="navbar-link dropdown-toggle d-flex align-items-center" data-bs-toggle="dropdown">
|
22
|
+
<%= image_tag current_user.gravatar_url %>
|
23
|
+
<span>
|
24
|
+
<span class="d-none d-md-inline"><%= current_user.firstname + " " + current_user.lastname %></span>
|
25
|
+
<b class="caret"></b>
|
26
|
+
</span>
|
27
|
+
</a>
|
28
|
+
<div class="dropdown-menu dropdown-menu-end me-1">
|
29
|
+
<%= link_to phcdevworks_accounts_devise.edit_user_registration_path, class: "dropdown-item" do %>
|
30
|
+
<i class="fad fa-cogs"></i> Account Settings
|
31
|
+
<% end %>
|
32
|
+
<%= link_to phcdevworks_accounts_devise.destroy_user_session_path, method: :delete, class: "dropdown-item" do %>
|
33
|
+
<i class="fad fa-sign-out-alt"></i> Logout
|
34
|
+
<% end %>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
</div>
|
41
|
+
<!-- -PHCDEV- Topbar - Navigation Main -->
|