phcpresspro 4.1.8 → 4.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/phcpresspro/articles/posts_controller.rb +9 -9
- data/app/controllers/phcpresspro/modules/categories_controller.rb +8 -7
- data/app/controllers/phcpresspro/modules/connections_controller.rb +52 -50
- data/app/models/phcpresspro/articles/post.rb +2 -2
- data/app/models/phcpresspro/modules/category.rb +2 -2
- data/app/models/phcpresspro/modules/connection.rb +2 -2
- data/app/views/phcpresspro/articles/posts/_form.html.erb +1 -1
- data/config/routes.rb +3 -3
- data/lib/phcpresspro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34205d4ef7d043b25606391d53a3459e7e9d9e01
|
4
|
+
data.tar.gz: d3315ffff71dc4d181496b2a1399dff948f3cdec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f160f65157912bff4d78b7bd9bd5aa1a86081f9115ea5d788ed8e45cc9a569b1842ddd419c1ec2be456f1df3400c917f9664cab82587b1fbff62e1c011a68673
|
7
|
+
data.tar.gz: 9dca3635fefb18428a018603eed8e02ea1fb49aad0821043c0f321d43f4613187940edf157c53e2f73c53d8aaf40f0805f808ef876177422a1632c97e5f918aa
|
@@ -6,31 +6,31 @@ module Phcpresspro
|
|
6
6
|
# Filters & Security
|
7
7
|
before_action :set_articles_post, only: [:show, :edit, :update, :destroy]
|
8
8
|
|
9
|
-
# Article
|
9
|
+
# Article Index
|
10
10
|
def index
|
11
11
|
@articles_posts = Articles::Post.all
|
12
12
|
end
|
13
13
|
|
14
|
-
#
|
14
|
+
# Article Show
|
15
15
|
def show
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
18
|
+
# Article New
|
19
19
|
def new
|
20
20
|
@articles_post = Articles::Post.new
|
21
|
+
|
21
22
|
end
|
22
23
|
|
23
|
-
#
|
24
|
+
# Article Edit
|
24
25
|
def edit
|
25
26
|
end
|
26
27
|
|
27
28
|
# POST
|
28
29
|
def create
|
29
30
|
@articles_post = Articles::Post.new(articles_post_params)
|
30
|
-
|
31
31
|
if @articles_post.save
|
32
32
|
@articles_post.connections.build
|
33
|
-
redirect_to
|
33
|
+
redirect_to articles_posts_url, notice: 'Post was successfully created.'
|
34
34
|
else
|
35
35
|
render :new
|
36
36
|
end
|
@@ -40,7 +40,7 @@ module Phcpresspro
|
|
40
40
|
def update
|
41
41
|
if @articles_post.update(articles_post_params)
|
42
42
|
@articles_post.connections.build
|
43
|
-
redirect_to
|
43
|
+
redirect_to articles_posts_url, notice: 'Post was successfully updated.'
|
44
44
|
else
|
45
45
|
render :edit
|
46
46
|
end
|
@@ -59,9 +59,9 @@ module Phcpresspro
|
|
59
59
|
@articles_post = Articles::Post.find(params[:id])
|
60
60
|
end
|
61
61
|
|
62
|
-
#
|
62
|
+
# Params Whitelist
|
63
63
|
def articles_post_params
|
64
|
-
params.require(:articles_post).permit(:psttitle, :psttext, :pstexcerpts, :pststatus, :
|
64
|
+
params.require(:articles_post).permit(:psttitle, :psttext, :pstexcerpts, :pststatus, :pstimage, :remove_pstimage, category_ids: [])
|
65
65
|
end
|
66
66
|
|
67
67
|
end
|
@@ -11,22 +11,23 @@ module Phcpresspro
|
|
11
11
|
@modules_categories = Modules::Category.all
|
12
12
|
end
|
13
13
|
|
14
|
-
#
|
14
|
+
# Categories Show
|
15
15
|
def show
|
16
16
|
end
|
17
17
|
|
18
|
-
# New
|
18
|
+
# Categories New
|
19
19
|
def new
|
20
20
|
@modules_category = Modules::Category.new
|
21
21
|
end
|
22
22
|
|
23
|
-
# Edit
|
23
|
+
# Categories Edit
|
24
24
|
def edit
|
25
25
|
end
|
26
26
|
|
27
|
-
#
|
27
|
+
# POST
|
28
28
|
def create
|
29
29
|
@modules_category = Modules::Category.new(modules_category_params)
|
30
|
+
|
30
31
|
if @modules_category.save
|
31
32
|
redirect_to modules_categories_url, notice: 'Category was successfully created.'
|
32
33
|
else
|
@@ -34,7 +35,7 @@ module Phcpresspro
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
|
-
#
|
38
|
+
# PATCH/PUT
|
38
39
|
def update
|
39
40
|
if @modules_category.update(modules_category_params)
|
40
41
|
redirect_to modules_categories_url, notice: 'Category was successfully updated.'
|
@@ -43,7 +44,7 @@ module Phcpresspro
|
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
46
|
-
#
|
47
|
+
# DELETE
|
47
48
|
def destroy
|
48
49
|
@modules_category.destroy
|
49
50
|
redirect_to modules_categories_url, notice: 'Category was successfully destroyed.'
|
@@ -58,7 +59,7 @@ module Phcpresspro
|
|
58
59
|
|
59
60
|
# Whitelist
|
60
61
|
def modules_category_params
|
61
|
-
params.require(:modules_category).permit(:catname
|
62
|
+
params.require(:modules_category).permit(:catname)
|
62
63
|
end
|
63
64
|
|
64
65
|
end
|
@@ -1,64 +1,66 @@
|
|
1
1
|
require_dependency "phcpresspro/application_controller"
|
2
2
|
|
3
3
|
module Phcpresspro
|
4
|
-
|
5
|
-
before_action :set_modules_connection, only: [:show, :edit, :update, :destroy]
|
4
|
+
class Modules::ConnectionsController < ApplicationController
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
@modules_connections = Modules::Connection.all
|
10
|
-
end
|
6
|
+
# Security and Filters
|
7
|
+
before_action :set_modules_connection, only: [:show, :edit, :update, :destroy]
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
# Connections Index
|
10
|
+
def index
|
11
|
+
@modules_connections = Modules::Connection.all
|
12
|
+
end
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@modules_connection.posts.build
|
20
|
-
@modules_connection.categories.build
|
21
|
-
end
|
14
|
+
# Connections Show
|
15
|
+
def show
|
16
|
+
end
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
# Connections New
|
19
|
+
def new
|
20
|
+
@modules_connection = Modules::Connection.new
|
21
|
+
end
|
26
22
|
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
# Connections Edit
|
24
|
+
def edit
|
25
|
+
end
|
30
26
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
render :new
|
35
|
-
end
|
36
|
-
end
|
27
|
+
# POST
|
28
|
+
def create
|
29
|
+
@modules_connection = Modules::Connection.new(modules_connection_params)
|
37
30
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
31
|
+
if @modules_connection.save
|
32
|
+
redirect_to modules_connections_url, notice: 'Connection was successfully created.'
|
33
|
+
else
|
34
|
+
render :new
|
35
|
+
end
|
36
|
+
end
|
46
37
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
38
|
+
# PATCH/PUT
|
39
|
+
def update
|
40
|
+
if @modules_connection.update(modules_connection_params)
|
41
|
+
redirect_to modules_connections_url, notice: 'Connection was successfully updated.'
|
42
|
+
else
|
43
|
+
render :edit
|
44
|
+
end
|
45
|
+
end
|
52
46
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
47
|
+
# DELETE
|
48
|
+
def destroy
|
49
|
+
@modules_connection.destroy
|
50
|
+
redirect_to modules_connections_url, notice: 'Connection was successfully destroyed.'
|
51
|
+
end
|
58
52
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
53
|
+
private
|
54
|
+
|
55
|
+
# Common Callbacks
|
56
|
+
def set_modules_connection
|
57
|
+
@modules_connection = Modules::Connection.find(params[:id])
|
58
|
+
end
|
59
|
+
|
60
|
+
# Whitelist
|
61
|
+
def modules_connection_params
|
62
|
+
params.require(:modules_connection).permit(:post_id, :category_id)
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
64
66
|
end
|
@@ -5,8 +5,8 @@ module Phcpresspro
|
|
5
5
|
mount_uploader :pstimage, Phcpresspro::PstimageUploader
|
6
6
|
|
7
7
|
# Relationships
|
8
|
-
has_many :connections, class_name: 'Modules::Connection'
|
9
|
-
has_many :categories, class_name: 'Modules::Category', :through => :connections
|
8
|
+
has_many :connections, class_name: 'Phcpresspro::Modules::Connection'
|
9
|
+
has_many :categories, class_name: 'Phcpresspro::Modules::Category', :through => :connections
|
10
10
|
|
11
11
|
end
|
12
12
|
end
|
@@ -2,8 +2,8 @@ module Phcpresspro
|
|
2
2
|
class Modules::Category < ApplicationRecord
|
3
3
|
|
4
4
|
# Relationships
|
5
|
-
has_many :connections, class_name: 'Modules::Connection'
|
6
|
-
has_many :posts, class_name: 'Modules::Category', :through => :connections
|
5
|
+
has_many :connections, class_name: 'Phcpresspro::Modules::Connection'
|
6
|
+
has_many :posts, class_name: 'Phcpresspro::Modules::Category', :through => :connections
|
7
7
|
|
8
8
|
end
|
9
9
|
end
|
@@ -2,8 +2,8 @@ module Phcpresspro
|
|
2
2
|
class Modules::Connection < ApplicationRecord
|
3
3
|
|
4
4
|
# Relationships
|
5
|
-
belongs_to :post, class_name: 'Articles::Post'
|
6
|
-
belongs_to :category, class_name: 'Modules::Category'
|
5
|
+
belongs_to :post, class_name: 'Phcpresspro::Articles::Post'
|
6
|
+
belongs_to :category, class_name: 'Phcpresspro::Modules::Category'
|
7
7
|
|
8
8
|
end
|
9
9
|
end
|
@@ -44,7 +44,7 @@
|
|
44
44
|
</div>
|
45
45
|
<div class="panel-body">
|
46
46
|
<div class="form-group">
|
47
|
-
<%= f.collection_check_boxes :category_ids, Modules::Category.all, :id, :catname do |post_category| %>
|
47
|
+
<%= f.collection_check_boxes :category_ids, Phcpresspro::Modules::Category.all, :id, :catname do |post_category| %>
|
48
48
|
<%= post_category.check_box %>
|
49
49
|
<%= post_category.label %></br>
|
50
50
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -2,13 +2,13 @@ Phcpresspro::Engine.routes.draw do
|
|
2
2
|
|
3
3
|
# Article Routes
|
4
4
|
namespace :articles do
|
5
|
-
resources :posts, class_name: 'Articles::Post'
|
5
|
+
resources :posts, class_name: 'Phcpresspro::Articles::Post'
|
6
6
|
end
|
7
7
|
|
8
8
|
# Module Routes
|
9
9
|
namespace :modules do
|
10
|
-
resources :connections, class_name: 'Modules::Connection'
|
11
|
-
resources :categories, class_name: 'Modules::Category'
|
10
|
+
resources :connections, class_name: 'Phcpresspro::Modules::Connection'
|
11
|
+
resources :categories, class_name: 'Phcpresspro::Modules::Category'
|
12
12
|
end
|
13
13
|
|
14
14
|
end
|
data/lib/phcpresspro/version.rb
CHANGED