phcpress 50.0.0 → 51.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/app/assets/javascripts/phcpress/application.js +4 -1
  4. data/app/assets/javascripts/phcpress/article/categories.js +0 -0
  5. data/app/assets/javascripts/phcpress/article/posts.js +0 -0
  6. data/app/assets/javascripts/phcpress/blog/articles.js +0 -0
  7. data/app/assets/javascripts/phcpress/custom/custom.js +0 -0
  8. data/app/assets/stylesheets/phcpress/application.scss +3 -1
  9. data/app/assets/stylesheets/phcpress/article/categories.scss +0 -0
  10. data/app/assets/stylesheets/phcpress/article/posts.scss +0 -0
  11. data/app/assets/stylesheets/phcpress/blog/articles.scss +0 -0
  12. data/app/controllers/phcpress/api/v1/post_index.json.rabl +2 -0
  13. data/app/controllers/phcpress/api/v1/post_single.json.rabl +2 -0
  14. data/app/controllers/phcpress/application_controller.rb +20 -10
  15. data/app/controllers/phcpress/article/categories_controller.rb +72 -0
  16. data/app/controllers/phcpress/article/posts_controller.rb +17 -13
  17. data/app/controllers/phcpress/blog/articles_controller.rb +20 -0
  18. data/app/helpers/phcpress/application_helper.rb +2 -12
  19. data/app/helpers/phcpress/article/categories_helper.rb +4 -0
  20. data/app/helpers/phcpress/article/posts_helper.rb +4 -0
  21. data/app/jobs/phcpress/application_job.rb +2 -2
  22. data/app/mailers/phcpress/application_mailer.rb +4 -4
  23. data/app/models/phcpress/{modules → article}/category.rb +4 -3
  24. data/app/models/phcpress/article/post.rb +4 -4
  25. data/app/views/layouts/phcpress/application.html.erb +16 -19
  26. data/app/views/layouts/phcpress/components/backend/footer/_footer.html.erb +9 -1
  27. data/app/views/layouts/phcpress/components/backend/navigation/_top_menu.html.erb +3 -68
  28. data/app/views/layouts/phcpress/components/backend/sidebars/_side_menu.html.erb +98 -60
  29. data/app/views/layouts/phcpress/frontend.html.erb +5 -24
  30. data/app/views/phcpress/article/categories/_form.html.erb +13 -0
  31. data/app/views/phcpress/{modules → article}/categories/edit.html.erb +5 -4
  32. data/app/views/phcpress/{modules → article}/categories/index.html.erb +18 -5
  33. data/app/views/phcpress/{modules → article}/categories/new.html.erb +8 -5
  34. data/app/views/phcpress/article/categories/show.html.erb +9 -0
  35. data/app/views/phcpress/article/posts/_form.html.erb +17 -24
  36. data/app/views/phcpress/article/posts/edit.html.erb +14 -24
  37. data/app/views/phcpress/article/posts/index.html.erb +13 -2
  38. data/app/views/phcpress/article/posts/new.html.erb +16 -5
  39. data/app/views/phcpress/blog/articles/index.html.erb +69 -0
  40. data/app/views/phcpress/blog/articles/show.html.erb +1 -0
  41. data/config/routes.rb +12 -20
  42. data/db/migrate/20170517064030_create_phcpress_post_versions.rb +17 -0
  43. data/db/migrate/20170517064427_create_phcpress_category_versions.rb +17 -0
  44. data/db/migrate/{20160718204718_create_phcpress_article_posts.rb → 20190315010932_create_phcpress_article_posts.rb} +2 -3
  45. data/db/migrate/{20160716182936_create_phcpress_modules_categories.rb → 20190315040834_create_phcpress_article_categories.rb} +2 -3
  46. data/db/migrate/20190315173237_create_join_table_categories_posts.rb +8 -0
  47. data/lib/phcpress/engine.rb +66 -60
  48. data/lib/phcpress/version.rb +1 -1
  49. metadata +111 -130
  50. data/app/controllers/phcpress/api/v1/categories_controller.rb +0 -15
  51. data/app/controllers/phcpress/api/v1/posts_controller.rb +0 -20
  52. data/app/controllers/phcpress/frontend/articles_controller.rb +0 -21
  53. data/app/controllers/phcpress/modules/categories_controller.rb +0 -65
  54. data/app/controllers/phcpress/modules/connections_controller.rb +0 -65
  55. data/app/models/phcpress/api/v1/category.rb +0 -4
  56. data/app/models/phcpress/api/v1/post.rb +0 -4
  57. data/app/models/phcpress/connection_versions.rb +0 -5
  58. data/app/models/phcpress/frontend.rb +0 -7
  59. data/app/models/phcpress/frontend/article.rb +0 -4
  60. data/app/models/phcpress/modules.rb +0 -7
  61. data/app/models/phcpress/modules/connection.rb +0 -25
  62. data/app/views/phcpress/api/v1/categories/index.json.rabl +0 -2
  63. data/app/views/phcpress/api/v1/posts/index.json.rabl +0 -2
  64. data/app/views/phcpress/api/v1/posts/show.json.rabl +0 -2
  65. data/app/views/phcpress/frontend/articles/index.html.erb +0 -35
  66. data/app/views/phcpress/frontend/articles/show.html.erb +0 -35
  67. data/app/views/phcpress/modules/categories/_form.html.erb +0 -17
  68. data/app/views/phcpress/modules/categories/show.html.erb +0 -22
  69. data/app/views/phcpress/modules/connections/_form.html.erb +0 -24
  70. data/app/views/phcpress/modules/connections/edit.html.erb +0 -39
  71. data/app/views/phcpress/modules/connections/index.html.erb +0 -66
  72. data/app/views/phcpress/modules/connections/new.html.erb +0 -39
  73. data/app/views/phcpress/modules/connections/show.html.erb +0 -50
  74. data/db/migrate/20160719221205_create_phcpress_modules_connections.rb +0 -17
@@ -1,15 +0,0 @@
1
- require_dependency "phcpress/application_controller"
2
-
3
- module Phcpress
4
- class Api::V1::CategoriesController < ApplicationController
5
-
6
- # Only Responds to API Requests
7
- respond_to :json
8
-
9
- # Article Category API
10
- def index
11
- @modules_categories = Modules::Category.order('catname ASC')
12
- end
13
-
14
- end
15
- end
@@ -1,20 +0,0 @@
1
- require_dependency "phcpress/application_controller"
2
-
3
- module Phcpress
4
- class Api::V1::PostsController < ApplicationController
5
-
6
- # Only Responds to API Requests
7
- respond_to :json
8
-
9
- # Article Category API
10
- def index
11
- @article_posts = Article::Post.where(poststatus: 'published').order('created_at ASC')
12
- end
13
-
14
- # Article Show
15
- def show
16
- @article_post = Article::Post.where(poststatus: published).find(params[:id])
17
- end
18
-
19
- end
20
- end
@@ -1,21 +0,0 @@
1
- require_dependency "phcpress/application_controller"
2
- require 'httparty'
3
-
4
- module Phcpress
5
- class Frontend::ArticlesController < ApplicationController
6
-
7
- # Security & Filters
8
- layout '/layouts/phcpress/frontend.html.erb'
9
-
10
- # Article Index
11
- def index
12
- @phcpress_frontend_article_list = HTTParty.get("https://#{ENV["PHC_PRESS_API_DOMAIN"]}/#{ENV["PHC_PRESS_API_FOLDER"]}/api/v1/posts.json")
13
- end
14
-
15
- # Article Show
16
- def show
17
- @phcpress_frontend_article_post = HTTParty.get("https://#{ENV["PHC_PRESS_API_DOMAIN"]}/#{ENV["PHC_PRESS_API_FOLDER"]}/api/v1/posts.json")
18
- end
19
-
20
- end
21
- end
@@ -1,65 +0,0 @@
1
- require_dependency "phcpress/application_controller"
2
-
3
- module Phcpress
4
- class Modules::CategoriesController < ApplicationController
5
-
6
- # Security and Filters
7
- before_action :set_modules_category, only: [:show, :edit, :update, :destroy]
8
-
9
- # Categories Index
10
- def index
11
- @modules_categories = Modules::Category.all
12
- end
13
-
14
- # Categories Show
15
- def show
16
- end
17
-
18
- # Categories New
19
- def new
20
- @modules_category = Modules::Category.new
21
- end
22
-
23
- # Categories Edit
24
- def edit
25
- end
26
-
27
- # POST
28
- def create
29
- @modules_category = Modules::Category.new(modules_category_params)
30
- if @modules_category.save
31
- redirect_to modules_categories_url, notice: 'Category was successfully created.'
32
- else
33
- render :new
34
- end
35
- end
36
-
37
- # PATCH/PUT
38
- def update
39
- if @modules_category.update(modules_category_params)
40
- redirect_to modules_categories_url, notice: 'Category was successfully updated.'
41
- else
42
- render :edit
43
- end
44
- end
45
-
46
- # DELETE
47
- def destroy
48
- @modules_category.destroy
49
- redirect_to modules_categories_url, notice: 'Category was successfully destroyed.'
50
- end
51
-
52
- private
53
-
54
- # Common Callbacks
55
- def set_modules_category
56
- @modules_category = Modules::Category.find(params[:id])
57
- end
58
-
59
- # Whitelist
60
- def modules_category_params
61
- params.require(:modules_category).permit(:catname)
62
- end
63
-
64
- end
65
- end
@@ -1,65 +0,0 @@
1
- require_dependency "phcpress/application_controller"
2
-
3
- module Phcpress
4
- class Modules::ConnectionsController < ApplicationController
5
-
6
- # Security and Filters
7
- before_action :set_modules_connection, only: [:show, :edit, :update, :destroy]
8
-
9
- # Connections Index
10
- def index
11
- @modules_connections = Modules::Connection.all
12
- end
13
-
14
- # Connections Show
15
- def show
16
- end
17
-
18
- # Connections New
19
- def new
20
- @modules_connection = Modules::Connection.new
21
- end
22
-
23
- # Connections Edit
24
- def edit
25
- end
26
-
27
- # POST
28
- def create
29
- @modules_connection = Modules::Connection.new(modules_connection_params)
30
- if @modules_connection.save
31
- redirect_to modules_connections_url, notice: 'Connection was successfully created.'
32
- else
33
- render :new
34
- end
35
- end
36
-
37
- # PATCH/PUT
38
- def update
39
- if @modules_connection.update(modules_connection_params)
40
- redirect_to modules_connections_url, notice: 'Connection was successfully updated.'
41
- else
42
- årender :edit
43
- end
44
- end
45
-
46
- # DELETE
47
- def destroy
48
- @modules_connection.destroy
49
- redirect_to modules_connections_url, notice: 'Connection was successfully destroyed.'
50
- end
51
-
52
- private
53
-
54
- # Common Callbacks
55
- def set_modules_connection
56
- @modules_connection = Modules::Connection.find(params[:id])
57
- end
58
-
59
- # Whitelist
60
- def modules_connection_params
61
- params.require(:modules_connection).permit(:post_id, :category_id)
62
- end
63
-
64
- end
65
- end
@@ -1,4 +0,0 @@
1
- module Phcpress
2
- class Api::V1::Category < ApplicationRecord
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module Phcpress
2
- class Api::V1::Post < ApplicationRecord
3
- end
4
- end
@@ -1,5 +0,0 @@
1
- module Phcpress
2
- class ConnectionVersions < PaperTrail::Version
3
- self.table_name = :phcpress_connection_versions
4
- end
5
- end
@@ -1,7 +0,0 @@
1
- module Phcpress
2
- module Frontend
3
- def self.table_name_prefix
4
- 'phcpress_frontend_'
5
- end
6
- end
7
- end
@@ -1,4 +0,0 @@
1
- module Phcpress
2
- class Frontend::Article < ApplicationRecord
3
- end
4
- end
@@ -1,7 +0,0 @@
1
- module Phcpress
2
- module Modules
3
- def self.table_name_prefix
4
- 'phcpress_modules_'
5
- end
6
- end
7
- end
@@ -1,25 +0,0 @@
1
- module Phcpress
2
- class Modules::Connection < ApplicationRecord
3
-
4
- # Clean URL Initialize
5
- extend FriendlyId
6
-
7
- # Add Paper Trail
8
- has_paper_trail :class_name => 'Phcpress::ConnectionVersions'
9
-
10
- # Relationships
11
- belongs_to :post, class_name: 'Phcpress::Article::Post'
12
- belongs_to :category, class_name: 'Phcpress::Modules::Category'
13
-
14
- # Clean URL Define
15
- friendly_id :phcpress_connections_slug, use: [:slugged, :finders]
16
-
17
- # Define for Multiple Records
18
- def phcpress_connections_slug
19
- [
20
- [:post_id, :category_id]
21
- ]
22
- end
23
-
24
- end
25
- end
@@ -1,2 +0,0 @@
1
- object @modules_categories
2
- attributes :id, :catname
@@ -1,2 +0,0 @@
1
- object @article_posts
2
- attributes :id, :psttitle, :psttext, :pststatus, :pstimage
@@ -1,2 +0,0 @@
1
- object @article_post
2
- attributes :id, :psttitle, :psttext, :pststatus, :pstimage
@@ -1,35 +0,0 @@
1
- <!-- Title System -->
2
- <% phc_title "PHCNetworks Blog" %>
3
- <% phc_title_tagline "News & Information" %>
4
- <!-- Title System -->
5
-
6
- <!-- Page Header -->
7
- <section class="page-header dark page-header-xs">
8
- <div class="container">
9
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
10
- </div>
11
- </section>
12
- <!-- Page Header -->
13
-
14
- <!-- Page Content -->
15
- <section>
16
- <div class="container">
17
- <div class="row">
18
-
19
- <!-- Left Sidebar -->
20
- <div class="col-md-3 col-sm-3">
21
- </div>
22
- <!-- Left Sidebar -->
23
-
24
- <!-- Blog List -->
25
- <div class="col-md-9 col-sm-9">
26
- <% @phcpress_frontend_article_list.each do |phcpress_index| %>
27
- <%= phcpress_index['phcpresspro_article_post']['id'] %>
28
- <% end %>
29
- </div>
30
- <!-- Blog List -->
31
-
32
- </div>
33
- </div>
34
- <section>
35
- <!-- Page Content -->
@@ -1,35 +0,0 @@
1
- <!-- Title System -->
2
- <% phc_title "PHCNetworks Blog" %>
3
- <% phc_title_tagline "News & Information" %>
4
- <!-- Title System -->
5
-
6
- <!-- Page Header -->
7
- <section class="page-header dark page-header-xs">
8
- <div class="container">
9
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
10
- </div>
11
- </section>
12
- <!-- Page Header -->
13
-
14
- <!-- Page Content -->
15
- <section>
16
- <div class="container">
17
- <div class="row">
18
-
19
- <!-- Left Sidebar -->
20
- <div class="col-md-3 col-sm-3">
21
- </div>
22
- <!-- Left Sidebar -->
23
-
24
- <!-- Blog List -->
25
- <div class="col-md-9 col-sm-9">
26
- <% @phcpress_frontend_article_index.psttitle %>
27
-
28
-
29
- </div>
30
- <!-- Blog List -->
31
-
32
- </div>
33
- </div>
34
- <section>
35
- <!-- Page Content -->
@@ -1,17 +0,0 @@
1
- <%= form_for(@modules_category) do |f| %>
2
-
3
- <!-- PHCNotifi Render Validation -->
4
- <%= render 'phcnotifi/validations', :object => @modules_category %>
5
- <!-- PHCNotifi Render Validation -->
6
-
7
- <!-- PHCPressPro - Category Form -->
8
- <div class="form-group">
9
- <%= f.label :catname, "Category Name" %>
10
- <%= f.text_field :catname, class: "form-control" %>
11
- </div>
12
- <div class="actions">
13
- <%= f.submit class: "btn btn-primary" %>
14
- </div>
15
- <!-- PHCPressPro - Category Form -->
16
-
17
- <% end %>
@@ -1,22 +0,0 @@
1
- <!-- Title System -->
2
- <% phc_title "Plugin: Article Category Manager" %>
3
- <% phc_title_tagline "Category Details" %>
4
- <% phc_breadcrumb_one link_to "Category Index", phcpress.modules_categories_path %>
5
- <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
- <!-- Title System -->
7
-
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>
15
- </div>
16
- <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
17
- </div>
18
- <div class="panel-body">
19
-
20
- </div>
21
- </div>
22
- <!-- Page Content -->
@@ -1,24 +0,0 @@
1
- <%= form_for(@modules_connection) do |f| %>
2
-
3
- <!-- PHC-Notifi Render Validation -->
4
- <%= render 'phcnotifi/validations', :object => @articles_post %>
5
- <!-- PHC-Notifi Render Validation -->
6
-
7
- <!-- Form Fields -->
8
- <div class="form-group field_with_errors">
9
- <%= f.label :category_id, "Category ID" %>
10
- <%= f.text_field :category_id, class: "form-control" %>
11
- </div>
12
- <div class="form-group field_with_errors">
13
- <%= f.label :post_id, "Post ID" %>
14
- <%= f.text_field :post_id, class: "form-control" %>
15
- </div>
16
- <!-- Form Fields -->
17
-
18
- <!-- Form Button -->
19
- <div class="actions">
20
- <%= f.submit class: "btn btn-primary" %>
21
- </div>
22
- <!-- Form Button -->
23
-
24
- <% end %>
@@ -1,39 +0,0 @@
1
- <!-- Title System -->
2
- <% phc_title "PHCPress Plugin: Connections" %>
3
- <% phc_title_tagline "Update Category Connections" %>
4
- <% phc_breadcrumb_one link_to "Connection Index", phcpresspro.modules_connections_path %>
5
- <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
- <!-- Title System -->
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_connection: @modules_connection %>
32
- <!-- Page Form (Edit) -->
33
-
34
- </div>
35
- </div>
36
- </div>
37
- </div>
38
- </section>
39
- <!-- Main Content -->