phcpress 42.0.0 → 43.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/MIT-LICENSE +1 -1
- data/README.md +2 -14
- data/Rakefile +3 -0
- data/app/assets/javascripts/phcpress/application.js +2 -2
- data/app/assets/stylesheets/phcpress/application.scss +2 -2
- data/app/controllers/phcpress/article/posts_controller.rb +2 -1
- data/app/models/phcpress/article/post.rb +1 -1
- data/app/views/layouts/phcpress/application.html.erb +79 -54
- data/app/views/layouts/phcpress/components/backend/footer/_footer.html.erb +1 -0
- data/app/views/layouts/phcpress/components/backend/navigation/_top_menu.html.erb +143 -0
- data/app/views/layouts/phcpress/components/backend/sidebars/_side_menu.html.erb +116 -0
- data/app/views/phcpress/article/posts/_form.html.erb +67 -62
- data/app/views/phcpress/article/posts/edit.html.erb +24 -23
- data/app/views/phcpress/article/posts/index.html.erb +39 -63
- data/app/views/phcpress/article/posts/new.html.erb +5 -25
- data/app/views/phcpress/article/posts/show.html.erb +39 -28
- data/app/views/phcpress/modules/categories/_form.html.erb +6 -9
- data/app/views/phcpress/modules/categories/edit.html.erb +15 -30
- data/app/views/phcpress/modules/categories/index.html.erb +32 -58
- data/app/views/phcpress/modules/categories/new.html.erb +14 -31
- data/app/views/phcpress/modules/categories/show.html.erb +13 -31
- data/config/routes.rb +6 -0
- data/db/migrate/20160716182936_create_phcpress_modules_categories.rb +16 -0
- data/db/migrate/20160718204718_create_phcpress_article_posts.rb +19 -0
- data/db/migrate/20160719221205_create_phcpress_modules_connections.rb +17 -0
- data/db/migrate/20170509002355_create_phcpress_friendly_id_slugs.rb +18 -0
- data/lib/phcpress.rb +1 -0
- data/lib/phcpress/engine.rb +61 -59
- data/lib/phcpress/version.rb +1 -1
- metadata +93 -63
- data/app/views/layouts/components/backend/footer/_footer.html.erb +0 -4
- data/app/views/layouts/components/backend/navigation/_navigation.html.erb +0 -48
- data/app/views/layouts/components/backend/topbar/_topbar.html.erb +0 -5
- data/app/views/layouts/components/backend/topbar/_topbar_links.html.erb +0 -0
@@ -5,35 +5,20 @@
|
|
5
5
|
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
6
|
<!-- Title System -->
|
7
7
|
|
8
|
-
<!-- Page
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
</ol>
|
16
|
-
<!-- Page Title and BreadCrumb -->
|
17
|
-
</section>
|
18
|
-
<!-- Page Title Bar -->
|
19
|
-
|
20
|
-
<!-- Main Content -->
|
21
|
-
<section class="content">
|
22
|
-
<div class="row">
|
23
|
-
<div class="col-lg-12">
|
24
|
-
<div class="box">
|
25
|
-
<div class="box-header with-border">
|
26
|
-
<h3 class="box-title"><%= yield(:phc_title) %></h3>
|
27
|
-
</div>
|
28
|
-
<div class="box-body">
|
29
|
-
|
30
|
-
<!-- Page Form (Edit) -->
|
31
|
-
<%= render 'form', modules_category: @modules_category %>
|
32
|
-
<!-- Page Form (Edit) -->
|
33
|
-
|
34
|
-
</div>
|
35
|
-
</div>
|
8
|
+
<!-- Page Content -->
|
9
|
+
<div class="panel panel-inverse">
|
10
|
+
<div class="panel-heading">
|
11
|
+
<div class="panel-heading-btn">
|
12
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
13
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
14
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
36
15
|
</div>
|
16
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
17
|
+
</div>
|
18
|
+
<div class="panel-body">
|
19
|
+
<!-- Table - Category Edit Form -->
|
20
|
+
<%= render 'form', modules_category: @modules_category %>
|
21
|
+
<!-- Table - Category Edit Form -->
|
37
22
|
</div>
|
38
|
-
</
|
39
|
-
<!--
|
23
|
+
</div>
|
24
|
+
<!-- Page Content -->
|
@@ -4,63 +4,37 @@
|
|
4
4
|
<% phc_breadcrumb_one yield(:phc_title_tagline) %>
|
5
5
|
<!-- Title System -->
|
6
6
|
|
7
|
-
<!-- Page
|
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
|
-
</tr>
|
37
|
-
</thead>
|
38
|
-
|
39
|
-
<tbody>
|
40
|
-
<% @modules_categories.each do |modules_category| %>
|
41
|
-
<tr>
|
42
|
-
<td><%= modules_category.catname %></td>
|
43
|
-
<td><div class="btn-group" role="group" aria-label="Blog Articles">
|
44
|
-
<%= link_to 'Edit', edit_modules_category_path(modules_category), class: "btn btn-primary btn-xs" %>
|
45
|
-
<%= link_to 'Trash', modules_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
|
46
|
-
</div>
|
47
|
-
</td>
|
48
|
-
</tr>
|
49
|
-
<% end %>
|
50
|
-
</tbody>
|
51
|
-
</table>
|
52
|
-
</div>
|
53
|
-
<!-- Index Table -->
|
54
|
-
|
55
|
-
<!-- Panel Footer -->
|
56
|
-
<div class="box-footer clearfix">
|
57
|
-
<%= link_to 'New Category', new_modules_category_path, class: "btn btn-primary" %>
|
58
|
-
</div>
|
59
|
-
<!-- Panel Footer -->
|
60
|
-
|
61
|
-
</div>
|
62
|
-
</div>
|
7
|
+
<!-- Page Content -->
|
8
|
+
<div class="panel panel-inverse">
|
9
|
+
<div class="panel-heading">
|
10
|
+
<div class="panel-heading-btn">
|
11
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
12
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
13
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
14
|
+
</div>
|
15
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
16
|
+
</div>
|
17
|
+
<div class="panel-body">
|
18
|
+
<!-- Table - Category Index -->
|
19
|
+
<div class="table-responsive">
|
20
|
+
<table class="table table-striped table-bordered table-hover dataTables-example">
|
21
|
+
<thead>
|
22
|
+
<tr>
|
23
|
+
<th>Category Name</th>
|
24
|
+
<th></th>
|
25
|
+
</tr>
|
26
|
+
</thead>
|
27
|
+
<tbody>
|
28
|
+
<% @modules_categories.each do |modules_category| %>
|
29
|
+
<tr>
|
30
|
+
<td><%= link_to modules_category.catname, phcpress.edit_modules_category_path(modules_category) %></td>
|
31
|
+
<td><%= link_to 'Trash', modules_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
32
|
+
</tr>
|
33
|
+
<% end %>
|
34
|
+
</tbody>
|
35
|
+
</table>
|
63
36
|
</div>
|
37
|
+
<!-- Table - Category Index -->
|
64
38
|
</div>
|
65
|
-
</
|
66
|
-
<!--
|
39
|
+
</div>
|
40
|
+
<!-- Page Content -->
|
@@ -1,39 +1,22 @@
|
|
1
1
|
<!-- Title System -->
|
2
2
|
<% phc_title "Plugin: Article Category Manager" %>
|
3
|
-
<% phc_title_tagline "
|
3
|
+
<% phc_title_tagline "Category Details" %>
|
4
4
|
<% phc_breadcrumb_one link_to "Category Index", phcpress.modules_categories_path %>
|
5
5
|
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
6
|
<!-- Title System -->
|
7
7
|
|
8
|
-
<!-- Page
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
</ol>
|
16
|
-
<!-- Page Title and BreadCrumb -->
|
17
|
-
</section>
|
18
|
-
<!-- Page Title Bar -->
|
19
|
-
|
20
|
-
<!-- Main Content -->
|
21
|
-
<section class="content">
|
22
|
-
<div class="row">
|
23
|
-
<div class="col-lg-12">
|
24
|
-
<div class="box">
|
25
|
-
<div class="box-header with-border">
|
26
|
-
<h3 class="box-title"><%= yield(:phc_title) %></h3>
|
27
|
-
</div>
|
28
|
-
<div class="box-body">
|
29
|
-
|
30
|
-
<!-- Page Form (New) -->
|
31
|
-
<%= render 'form', modules_category: @modules_category %>
|
32
|
-
<!-- Page Form (New) -->
|
33
|
-
|
34
|
-
</div>
|
35
|
-
</div>
|
8
|
+
<!-- Page Content -->
|
9
|
+
<div class="panel panel-inverse">
|
10
|
+
<div class="panel-heading">
|
11
|
+
<div class="panel-heading-btn">
|
12
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
13
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
14
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
36
15
|
</div>
|
16
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
17
|
+
</div>
|
18
|
+
<div class="panel-body">
|
19
|
+
|
37
20
|
</div>
|
38
|
-
</
|
39
|
-
<!--
|
21
|
+
</div>
|
22
|
+
<!-- Page Content -->
|
@@ -5,36 +5,18 @@
|
|
5
5
|
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
6
|
<!-- Title System -->
|
7
7
|
|
8
|
-
<!-- Page
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
</ol>
|
16
|
-
<!-- Page Title and BreadCrumb -->
|
17
|
-
</section>
|
18
|
-
<!-- Page Title Bar -->
|
19
|
-
|
20
|
-
<!-- Main Content -->
|
21
|
-
<section class="content">
|
22
|
-
<div class="row">
|
23
|
-
<div class="col-lg-12">
|
24
|
-
<div class="box">
|
25
|
-
<div class="box-header with-border">
|
26
|
-
<h3 class="box-title"><%= yield(:phc_title) %></h3>
|
27
|
-
</div>
|
28
|
-
<div class="box-body">
|
29
|
-
|
30
|
-
<!-- Show Content -->
|
31
|
-
<%= link_to 'Edit', edit_modules_category_path(@modules_category) %> |
|
32
|
-
<%= link_to 'Back', modules_categories_path %>
|
33
|
-
<!-- Show Content -->
|
34
|
-
|
35
|
-
</div>
|
36
|
-
</div>
|
8
|
+
<!-- Page Content -->
|
9
|
+
<div class="panel panel-inverse">
|
10
|
+
<div class="panel-heading">
|
11
|
+
<div class="panel-heading-btn">
|
12
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
13
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
14
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
37
15
|
</div>
|
16
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
17
|
+
</div>
|
18
|
+
<div class="panel-body">
|
19
|
+
|
38
20
|
</div>
|
39
|
-
</
|
40
|
-
<!--
|
21
|
+
</div>
|
22
|
+
<!-- Page Content -->
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Phcpress::Engine.routes.draw do
|
2
2
|
|
3
|
+
# Define Root Path
|
4
|
+
root 'article/posts#index'
|
5
|
+
|
3
6
|
# Frontend
|
4
7
|
namespace :frontend do
|
5
8
|
resources :articles
|
@@ -24,4 +27,7 @@ Phcpress::Engine.routes.draw do
|
|
24
27
|
resources :categories, class_name: 'Phcpress::Modules::Category'
|
25
28
|
end
|
26
29
|
|
30
|
+
# Add Security Features
|
31
|
+
mount Phcaccounts::Engine => "/"
|
32
|
+
|
27
33
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreatePhcpressModulesCategories < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
create_table :phcpress_modules_categories do |t|
|
4
|
+
|
5
|
+
t.string :catname
|
6
|
+
|
7
|
+
t.string :slug
|
8
|
+
|
9
|
+
t.string :user_id
|
10
|
+
t.string :org_id
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreatePhcpressArticlePosts < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
create_table :phcpress_article_posts do |t|
|
4
|
+
|
5
|
+
t.string :psttitle
|
6
|
+
t.text :psttext
|
7
|
+
t.string :pststatus
|
8
|
+
t.string :pstimage
|
9
|
+
|
10
|
+
t.string :slug
|
11
|
+
|
12
|
+
t.string :user_id
|
13
|
+
t.string :org_id
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreatePhcpressModulesConnections < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
create_table :phcpress_modules_connections do |t|
|
4
|
+
|
5
|
+
t.references :post
|
6
|
+
t.references :category
|
7
|
+
|
8
|
+
t.string :slug
|
9
|
+
|
10
|
+
t.string :user_id
|
11
|
+
t.string :org_id
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreatePhcpressFriendlyIdSlugs < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :phcpress_friendly_id_slugs do |t|
|
5
|
+
t.string :slug, :null => false
|
6
|
+
t.integer :sluggable_id, :null => false
|
7
|
+
t.string :sluggable_type, :limit => 50
|
8
|
+
t.string :scope
|
9
|
+
t.datetime :created_at
|
10
|
+
end
|
11
|
+
|
12
|
+
add_index :phcpress_friendly_id_slugs, :sluggable_id
|
13
|
+
add_index :phcpress_friendly_id_slugs, [:slug, :sluggable_type], length: { slug: 140, sluggable_type: 50 }
|
14
|
+
add_index :phcpress_friendly_id_slugs, [:slug, :sluggable_type, :scope], name: 'phcpress_fri_id_slugable_scope_type', length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
|
15
|
+
add_index :phcpress_friendly_id_slugs, :sluggable_type
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/phcpress.rb
CHANGED
data/lib/phcpress/engine.rb
CHANGED
@@ -1,61 +1,63 @@
|
|
1
1
|
module Phcpress
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
|
4
|
+
# PHCTheme Dependencies
|
5
|
+
require 'phctheme1'
|
6
|
+
require 'phctheme2'
|
7
|
+
require 'phctheme3'
|
8
|
+
require 'phctheme4'
|
9
|
+
require 'phctheme5'
|
10
|
+
require 'phctheme6'
|
11
|
+
|
12
|
+
require 'phcadmin1'
|
13
|
+
require 'phcadmin2'
|
14
|
+
require 'phcadmin3'
|
15
|
+
require 'phcadmin4'
|
16
|
+
require 'phcadmin5'
|
17
|
+
require 'phcadmin6'
|
18
|
+
|
19
|
+
# PHC Helper Dependencies
|
20
|
+
require 'phcnotifi'
|
21
|
+
require 'phctitleseo'
|
22
|
+
|
23
|
+
# UI & URL Frontend Dependencies
|
24
|
+
require 'country_select'
|
25
|
+
require 'gravtastic'
|
26
|
+
require 'friendly_id'
|
27
|
+
|
28
|
+
# File Upload & Service Dependencies
|
29
|
+
require 'aws-sdk-s3'
|
30
|
+
require 'google-cloud-storage'
|
31
|
+
require 'mini_magick'
|
32
|
+
|
33
|
+
# Database & Paper Trail Dependencies
|
34
|
+
require 'paper_trail'
|
35
|
+
require 'pg'
|
36
|
+
|
37
|
+
# Security Dependencies
|
38
|
+
require 'phcaccounts'
|
39
|
+
|
40
|
+
# Isolate Namespace
|
41
|
+
isolate_namespace Phcpress
|
42
|
+
|
43
|
+
# Testing Generator
|
44
|
+
config.generators do |g|
|
45
|
+
g.test_framework :rspec,
|
46
|
+
fixtures: true,
|
47
|
+
view_specs: false,
|
48
|
+
helper_specs: false,
|
49
|
+
routing_specs: false,
|
50
|
+
controller_specs: true,
|
51
|
+
request_specs: false
|
52
|
+
g.fixture_replacement :factory_bot,
|
53
|
+
dir: "spec/factories"
|
54
|
+
end
|
55
|
+
|
56
|
+
# Load Requried Helper Files
|
57
|
+
config.to_prepare do
|
58
|
+
Phcnotifi::ApplicationController.helper(ApplicationHelper)
|
59
|
+
Phctitleseo::ApplicationController.helper(ApplicationHelper)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
61
63
|
end
|