phcpress 42.0.0 → 43.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +2 -14
  4. data/Rakefile +3 -0
  5. data/app/assets/javascripts/phcpress/application.js +2 -2
  6. data/app/assets/stylesheets/phcpress/application.scss +2 -2
  7. data/app/controllers/phcpress/article/posts_controller.rb +2 -1
  8. data/app/models/phcpress/article/post.rb +1 -1
  9. data/app/views/layouts/phcpress/application.html.erb +79 -54
  10. data/app/views/layouts/phcpress/components/backend/footer/_footer.html.erb +1 -0
  11. data/app/views/layouts/phcpress/components/backend/navigation/_top_menu.html.erb +143 -0
  12. data/app/views/layouts/phcpress/components/backend/sidebars/_side_menu.html.erb +116 -0
  13. data/app/views/phcpress/article/posts/_form.html.erb +67 -62
  14. data/app/views/phcpress/article/posts/edit.html.erb +24 -23
  15. data/app/views/phcpress/article/posts/index.html.erb +39 -63
  16. data/app/views/phcpress/article/posts/new.html.erb +5 -25
  17. data/app/views/phcpress/article/posts/show.html.erb +39 -28
  18. data/app/views/phcpress/modules/categories/_form.html.erb +6 -9
  19. data/app/views/phcpress/modules/categories/edit.html.erb +15 -30
  20. data/app/views/phcpress/modules/categories/index.html.erb +32 -58
  21. data/app/views/phcpress/modules/categories/new.html.erb +14 -31
  22. data/app/views/phcpress/modules/categories/show.html.erb +13 -31
  23. data/config/routes.rb +6 -0
  24. data/db/migrate/20160716182936_create_phcpress_modules_categories.rb +16 -0
  25. data/db/migrate/20160718204718_create_phcpress_article_posts.rb +19 -0
  26. data/db/migrate/20160719221205_create_phcpress_modules_connections.rb +17 -0
  27. data/db/migrate/20170509002355_create_phcpress_friendly_id_slugs.rb +18 -0
  28. data/lib/phcpress.rb +1 -0
  29. data/lib/phcpress/engine.rb +61 -59
  30. data/lib/phcpress/version.rb +1 -1
  31. metadata +93 -63
  32. data/app/views/layouts/components/backend/footer/_footer.html.erb +0 -4
  33. data/app/views/layouts/components/backend/navigation/_navigation.html.erb +0 -48
  34. data/app/views/layouts/components/backend/topbar/_topbar.html.erb +0 -5
  35. 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 Title Bar -->
9
- <section class="content-header">
10
- <!-- Page Title and BreadCrumb -->
11
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
12
- <ol class="breadcrumb">
13
- <li><%= yield(:phc_breadcrumb_one) %></li>
14
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
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
- </section>
39
- <!-- Main Content -->
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 Title Bar -->
8
- <section class="content-header">
9
- <!-- Page Title and BreadCrumb -->
10
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
11
- <ol class="breadcrumb">
12
- <li><%= yield(:phc_breadcrumb_one) %></li>
13
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
14
- </ol>
15
- <!-- Page Title and BreadCrumb -->
16
- </section>
17
- <!-- Page Title Bar -->
18
-
19
- <!-- Main Content -->
20
- <section class="content">
21
- <div class="row">
22
- <div class="col-lg-12">
23
- <div class="box">
24
- <div class="box-header with-border">
25
- <h3 class="box-title"><%= yield(:phc_title) %></h3>
26
- </div>
27
- <div class="box-body">
28
-
29
- <!-- Index Table -->
30
- <div class="table-responsive">
31
- <table class="table table-bordered table-striped table-hover">
32
- <thead>
33
- <tr>
34
- <th>Category Name</th>
35
- <th></th>
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
- </section>
66
- <!-- Main Content -->
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 "Create a New Category" %>
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 Title Bar -->
9
- <section class="content-header">
10
- <!-- Page Title and BreadCrumb -->
11
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
12
- <ol class="breadcrumb">
13
- <li><%= yield(:phc_breadcrumb_one) %></li>
14
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
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
- </section>
39
- <!-- Main Content -->
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 Title Bar -->
9
- <section class="content-header">
10
- <!-- Page Title and BreadCrumb -->
11
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
12
- <ol class="breadcrumb">
13
- <li><%= yield(:phc_breadcrumb_one) %></li>
14
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
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
- </section>
40
- <!-- Main Content -->
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
@@ -1,4 +1,5 @@
1
1
  require "phcpress/engine"
2
2
 
3
3
  module Phcpress
4
+ # Your code goes here...
4
5
  end
@@ -1,61 +1,63 @@
1
1
  module Phcpress
2
- class Engine < ::Rails::Engine
3
-
4
- # PHCTheme Dependencies
5
- require 'phctheme1'
6
- require 'phctheme2'
7
- require 'phctheme3'
8
- require 'phctheme3'
9
- require 'phctheme3'
10
-
11
- # PHCAdmin Dependencies
12
- require 'phcadmin1'
13
- require 'phcadmin2'
14
- require 'phcadmin3'
15
- require 'phcadmin4'
16
- require 'phcadmin5'
17
-
18
- # PHC Helper Dependencies
19
- require 'phcnotifi'
20
- require 'phctitleseo'
21
-
22
- # PHC Engine Dependencies
23
- require 'phcaccounts'
24
-
25
- # UI & URL Frontend Dependencies
26
- require 'country_select'
27
- require 'gravtastic'
28
- require 'friendly_id'
29
-
30
- # File Upload & Service Dependencies
31
- require 'aws-sdk-s3'
32
- require 'google-cloud-storage'
33
- require 'mini_magick'
34
-
35
- # Database & Paper Trail Dependencies
36
- require 'paper_trail'
37
- require 'pg'
38
-
39
- # Isolate Namespace
40
- isolate_namespace Phcpress
41
-
42
- # Testing Generator
43
- config.generators do |g|
44
- g.test_framework :rspec,
45
- fixtures: true,
46
- view_specs: false,
47
- helper_specs: false,
48
- routing_specs: false,
49
- controller_specs: true,
50
- request_specs: false
51
- g.fixture_replacement :factory_bot, dir: "spec/factories"
52
- end
53
-
54
- # Load Requried Helper Files
55
- config.to_prepare do
56
- Phcnotifi::ApplicationController.helper(ApplicationHelper)
57
- Phctitleseo::ApplicationController.helper(ApplicationHelper)
58
- end
59
-
60
- end
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