phcdevworks_press 8.2.3 → 8.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -20
- data/README.md +33 -33
- data/Rakefile +8 -8
- data/app/assets/config/phcdevworks_press_manifest.js +3 -3
- data/app/assets/stylesheets/phcdevworks_press/application.scss +0 -0
- data/app/assets/stylesheets/phcdevworks_press/article/posts.scss +0 -0
- data/app/assets/stylesheets/phcdevworks_press/blog/articles.scss +0 -0
- data/app/assets/stylesheets/phcdevworks_press/list/items.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_press/list/posts.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_press/review/posts.scss +3 -3
- data/app/controllers/phcdevworks_press/application_controller.rb +13 -13
- data/app/controllers/phcdevworks_press/article/posts_controller.rb +83 -83
- data/app/controllers/phcdevworks_press/blog/articles_controller.rb +29 -29
- data/app/controllers/phcdevworks_press/blog/lists_controller.rb +29 -29
- data/app/controllers/phcdevworks_press/blog/reviews_controller.rb +29 -29
- data/app/controllers/phcdevworks_press/list/items_controller.rb +89 -89
- data/app/controllers/phcdevworks_press/list/posts_controller.rb +82 -82
- data/app/controllers/phcdevworks_press/review/posts_controller.rb +82 -82
- data/app/helpers/phcdevworks_press/application_helper.rb +4 -4
- data/app/helpers/phcdevworks_press/article/posts_helper.rb +4 -4
- data/app/helpers/phcdevworks_press/blog/articles_helper.rb +4 -4
- data/app/helpers/phcdevworks_press/list/items_helper.rb +4 -4
- data/app/helpers/phcdevworks_press/list/posts_helper.rb +4 -4
- data/app/helpers/phcdevworks_press/review/posts_helper.rb +4 -4
- data/app/jobs/phcdevworks_press/application_job.rb +4 -4
- data/app/mailers/phcdevworks_press/application_mailer.rb +6 -6
- data/app/models/phcdevworks_press/application_record.rb +5 -5
- data/app/models/phcdevworks_press/article/post.rb +34 -34
- data/app/models/phcdevworks_press/article.rb +7 -7
- data/app/models/phcdevworks_press/article_post_versions.rb +0 -0
- data/app/models/phcdevworks_press/list/item.rb +33 -33
- data/app/models/phcdevworks_press/list/post.rb +34 -34
- data/app/models/phcdevworks_press/list.rb +7 -7
- data/app/models/phcdevworks_press/list_item_versions.rb +0 -0
- data/app/models/phcdevworks_press/list_post_versions.rb +0 -0
- data/app/models/phcdevworks_press/review/post.rb +33 -33
- data/app/models/phcdevworks_press/review.rb +7 -7
- data/app/models/phcdevworks_press/review_post_versions.rb +0 -0
- data/app/views/layouts/phcdevworks_press/application.html.erb +131 -131
- data/app/views/layouts/phcdevworks_press/components/backend/footer/_footer.html.erb +0 -0
- data/app/views/layouts/phcdevworks_press/components/backend/navigation/_top_menu.html.erb +0 -0
- data/app/views/layouts/phcdevworks_press/components/backend/sidebars/_side_menu.html.erb +43 -43
- data/app/views/layouts/phcdevworks_press/frontend.html.erb +5 -5
- data/app/views/phcdevworks_press/article/posts/_form.html.erb +105 -105
- data/app/views/phcdevworks_press/article/posts/edit.html.erb +23 -23
- data/app/views/phcdevworks_press/article/posts/index.html.erb +83 -83
- data/app/views/phcdevworks_press/article/posts/new.html.erb +23 -23
- data/app/views/phcdevworks_press/blog/articles/index.html.erb +69 -69
- data/app/views/phcdevworks_press/blog/articles/show.html.erb +0 -0
- data/app/views/phcdevworks_press/list/items/_form.html.erb +37 -37
- data/app/views/phcdevworks_press/list/items/edit.html.erb +47 -47
- data/app/views/phcdevworks_press/list/items/index.html.erb +81 -81
- data/app/views/phcdevworks_press/list/items/new.html.erb +48 -48
- data/app/views/phcdevworks_press/list/items/show.html.erb +0 -0
- data/app/views/phcdevworks_press/list/posts/_form.html.erb +86 -86
- data/app/views/phcdevworks_press/list/posts/edit.html.erb +23 -23
- data/app/views/phcdevworks_press/list/posts/index.html.erb +84 -84
- data/app/views/phcdevworks_press/list/posts/new.html.erb +23 -23
- data/app/views/phcdevworks_press/list/posts/show.html.erb +76 -76
- data/app/views/phcdevworks_press/review/posts/_form.html.erb +90 -90
- data/app/views/phcdevworks_press/review/posts/edit.html.erb +23 -23
- data/app/views/phcdevworks_press/review/posts/index.html.erb +83 -83
- data/app/views/phcdevworks_press/review/posts/new.html.erb +23 -23
- data/app/views/phcdevworks_press/review/posts/show.html.erb +9 -9
- data/config/routes.rb +38 -39
- data/config/spring.rb +1 -1
- data/db/migrate/20170517064030_create_phcdevworks_press_article_post_versions.rb +0 -0
- data/db/migrate/20190805232522_create_phcdevworks_press_article_posts.rb +19 -19
- data/db/migrate/20191024232406_create_phcdevworks_press_article_categories_posts.rb +10 -10
- data/db/migrate/20200708231335_create_phcdevworks_press_list_post_versions.rb +18 -18
- data/db/migrate/20200708231351_create_phcdevworks_press_review_post_versions.rb +18 -18
- data/db/migrate/20200712064624_create_phcdevworks_press_list_posts.rb +19 -19
- data/db/migrate/20200712064740_create_phcdevworks_press_review_posts.rb +21 -21
- data/db/migrate/20200712064920_create_phcdevworks_press_list_items.rb +22 -22
- data/db/migrate/20200712065808_create_phcdevworks_press_list_item_versions.rb +18 -18
- data/db/migrate/20200716224648_create_phcdevworks_press_review_categories_posts.rb +10 -10
- data/db/migrate/20200716224738_create_phcdevworks_press_list_categories_posts.rb +10 -10
- data/db/migrate/20210213025633_add_affiliatelink_to_article_posts.rb +5 -5
- data/lib/phcdevworks_press/engine.rb +47 -48
- data/lib/phcdevworks_press/version.rb +3 -3
- data/lib/phcdevworks_press.rb +6 -6
- data/lib/tasks/phcdevworks_press_tasks.rake +4 -4
- metadata +33 -33
@@ -1,89 +1,89 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class List::ItemsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_list_item, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /list/items
|
13
|
-
def index
|
14
|
-
@list_items = list_post.items.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /list/items/1
|
18
|
-
def show
|
19
|
-
@list_item = list_post.items.find(params[:id])
|
20
|
-
end
|
21
|
-
|
22
|
-
# GET /list/items/new
|
23
|
-
def new
|
24
|
-
@list_item = list_post.items.build
|
25
|
-
end
|
26
|
-
|
27
|
-
# GET /list/items/1/edit
|
28
|
-
def edit
|
29
|
-
@list_post = List::Post.friendly.find(params[:post_id])
|
30
|
-
end
|
31
|
-
|
32
|
-
# POST /list/items
|
33
|
-
def create
|
34
|
-
@list_item = list_post.items.create(list_item_params)
|
35
|
-
@list_item.user_id = current_user.id
|
36
|
-
@list_item.org_id = current_user.org_id
|
37
|
-
respond_to do |format|
|
38
|
-
if @list_item.save
|
39
|
-
format.html { redirect_to list_post_items_url, :flash => { :success => 'List Item has been Added' }}
|
40
|
-
format.json { render :show, status: :created, location: @list_item }
|
41
|
-
else
|
42
|
-
format.html { render :new }
|
43
|
-
format.json { render json: @list_item.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# PATCH/PUT /list/items/1
|
49
|
-
def update
|
50
|
-
@list_item = List::Item.friendly.find(params[:post_id])
|
51
|
-
respond_to do |format|
|
52
|
-
if @list_item.update(list_item_params)
|
53
|
-
format.html { redirect_to list_post_items_url, :flash => { :notice => 'List Item has been Updated.' }}
|
54
|
-
format.json { render :show, status: :ok, location: @list_item }
|
55
|
-
else
|
56
|
-
format.html { render :edit }
|
57
|
-
format.json { render json: @list_item.errors, status: :unprocessable_entity }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
# DELETE /list/items/1
|
63
|
-
def destroy
|
64
|
-
@list_item = list_post.items.find(params[:id])
|
65
|
-
@list_item.destroy
|
66
|
-
respond_to do |format|
|
67
|
-
format.html { redirect_to list_post_items_url, :flash => { :error => 'Item Listing has been Removed' }}
|
68
|
-
format.json { head :no_content }
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
# Common Callbacks
|
75
|
-
def set_list_item
|
76
|
-
@list_item = List::Item.find(params[:id])
|
77
|
-
end
|
78
|
-
|
79
|
-
def list_post
|
80
|
-
@list_post = List::Post.friendly.find(params[:post_id])
|
81
|
-
end
|
82
|
-
|
83
|
-
# Only allow a trusted parameter "white list" through.
|
84
|
-
def list_item_params
|
85
|
-
params.require(:list_item).permit(:list_item_title, :list_item_text, :list_item_url, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
end
|
1
|
+
require_dependency "phcdevworks_press/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksPress
|
4
|
+
class List::ItemsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_list_item, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /list/items
|
13
|
+
def index
|
14
|
+
@list_items = list_post.items.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /list/items/1
|
18
|
+
def show
|
19
|
+
@list_item = list_post.items.find(params[:id])
|
20
|
+
end
|
21
|
+
|
22
|
+
# GET /list/items/new
|
23
|
+
def new
|
24
|
+
@list_item = list_post.items.build
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /list/items/1/edit
|
28
|
+
def edit
|
29
|
+
@list_post = List::Post.friendly.find(params[:post_id])
|
30
|
+
end
|
31
|
+
|
32
|
+
# POST /list/items
|
33
|
+
def create
|
34
|
+
@list_item = list_post.items.create(list_item_params)
|
35
|
+
@list_item.user_id = current_user.id
|
36
|
+
@list_item.org_id = current_user.org_id
|
37
|
+
respond_to do |format|
|
38
|
+
if @list_item.save
|
39
|
+
format.html { redirect_to list_post_items_url, :flash => { :success => 'List Item has been Added' }}
|
40
|
+
format.json { render :show, status: :created, location: @list_item }
|
41
|
+
else
|
42
|
+
format.html { render :new }
|
43
|
+
format.json { render json: @list_item.errors, status: :unprocessable_entity }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# PATCH/PUT /list/items/1
|
49
|
+
def update
|
50
|
+
@list_item = List::Item.friendly.find(params[:post_id])
|
51
|
+
respond_to do |format|
|
52
|
+
if @list_item.update(list_item_params)
|
53
|
+
format.html { redirect_to list_post_items_url, :flash => { :notice => 'List Item has been Updated.' }}
|
54
|
+
format.json { render :show, status: :ok, location: @list_item }
|
55
|
+
else
|
56
|
+
format.html { render :edit }
|
57
|
+
format.json { render json: @list_item.errors, status: :unprocessable_entity }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# DELETE /list/items/1
|
63
|
+
def destroy
|
64
|
+
@list_item = list_post.items.find(params[:id])
|
65
|
+
@list_item.destroy
|
66
|
+
respond_to do |format|
|
67
|
+
format.html { redirect_to list_post_items_url, :flash => { :error => 'Item Listing has been Removed' }}
|
68
|
+
format.json { head :no_content }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
# Common Callbacks
|
75
|
+
def set_list_item
|
76
|
+
@list_item = List::Item.find(params[:id])
|
77
|
+
end
|
78
|
+
|
79
|
+
def list_post
|
80
|
+
@list_post = List::Post.friendly.find(params[:post_id])
|
81
|
+
end
|
82
|
+
|
83
|
+
# Only allow a trusted parameter "white list" through.
|
84
|
+
def list_item_params
|
85
|
+
params.require(:list_item).permit(:list_item_title, :list_item_text, :list_item_url, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
@@ -1,82 +1,82 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class List::PostsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_list_post, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /list/posts
|
13
|
-
def index
|
14
|
-
@list_posts = List::Post.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /list/posts/1
|
18
|
-
def show
|
19
|
-
@list_post = List::Post.friendly.find(params[:id])
|
20
|
-
end
|
21
|
-
|
22
|
-
# GET /list/posts/new
|
23
|
-
def new
|
24
|
-
@list_post = List::Post.new
|
25
|
-
end
|
26
|
-
|
27
|
-
# GET /list/posts/1/edit
|
28
|
-
def edit
|
29
|
-
end
|
30
|
-
|
31
|
-
# POST /list/posts
|
32
|
-
def create
|
33
|
-
@list_post = List::Post.new(list_post_params)
|
34
|
-
@list_post.user_id = current_user.id
|
35
|
-
@list_post.org_id = current_user.org_id
|
36
|
-
respond_to do |format|
|
37
|
-
if @list_post.save
|
38
|
-
format.html { redirect_to list_posts_path, :flash => { :success => 'Article has been Added.' }}
|
39
|
-
format.json { render :show, status: :created, location: @list_post }
|
40
|
-
else
|
41
|
-
format.html { render :new }
|
42
|
-
format.json { render json: @list_post.errors, status: :unprocessable_entity }
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# PATCH/PUT /list/posts/1
|
48
|
-
def update
|
49
|
-
respond_to do |format|
|
50
|
-
if @list_post.update(list_post_params)
|
51
|
-
format.html { redirect_to list_posts_path, :flash => { :notice => 'Article has been Updated.' }}
|
52
|
-
format.json { render :show, status: :ok, location: @list_post }
|
53
|
-
else
|
54
|
-
format.html { render :edit }
|
55
|
-
format.json { render json: @list_post.errors, status: :unprocessable_entity }
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# DELETE /list/posts/1
|
61
|
-
def destroy
|
62
|
-
@list_post.destroy
|
63
|
-
respond_to do |format|
|
64
|
-
format.html { redirect_to list_posts_path, :flash => { :error => 'Article has been Removed.' }}
|
65
|
-
format.json { head :no_content }
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
private
|
70
|
-
|
71
|
-
# Common Callbacks
|
72
|
-
def set_list_post
|
73
|
-
@list_post = List::Post.find(params[:id])
|
74
|
-
end
|
75
|
-
|
76
|
-
# Whitelist
|
77
|
-
def list_post_params
|
78
|
-
params.require(:list_post).permit(:list_post_title, :list_post_text, :list_post_status, :list_post_image, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
end
|
1
|
+
require_dependency "phcdevworks_press/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksPress
|
4
|
+
class List::PostsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_list_post, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /list/posts
|
13
|
+
def index
|
14
|
+
@list_posts = List::Post.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /list/posts/1
|
18
|
+
def show
|
19
|
+
@list_post = List::Post.friendly.find(params[:id])
|
20
|
+
end
|
21
|
+
|
22
|
+
# GET /list/posts/new
|
23
|
+
def new
|
24
|
+
@list_post = List::Post.new
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /list/posts/1/edit
|
28
|
+
def edit
|
29
|
+
end
|
30
|
+
|
31
|
+
# POST /list/posts
|
32
|
+
def create
|
33
|
+
@list_post = List::Post.new(list_post_params)
|
34
|
+
@list_post.user_id = current_user.id
|
35
|
+
@list_post.org_id = current_user.org_id
|
36
|
+
respond_to do |format|
|
37
|
+
if @list_post.save
|
38
|
+
format.html { redirect_to list_posts_path, :flash => { :success => 'Article has been Added.' }}
|
39
|
+
format.json { render :show, status: :created, location: @list_post }
|
40
|
+
else
|
41
|
+
format.html { render :new }
|
42
|
+
format.json { render json: @list_post.errors, status: :unprocessable_entity }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# PATCH/PUT /list/posts/1
|
48
|
+
def update
|
49
|
+
respond_to do |format|
|
50
|
+
if @list_post.update(list_post_params)
|
51
|
+
format.html { redirect_to list_posts_path, :flash => { :notice => 'Article has been Updated.' }}
|
52
|
+
format.json { render :show, status: :ok, location: @list_post }
|
53
|
+
else
|
54
|
+
format.html { render :edit }
|
55
|
+
format.json { render json: @list_post.errors, status: :unprocessable_entity }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# DELETE /list/posts/1
|
61
|
+
def destroy
|
62
|
+
@list_post.destroy
|
63
|
+
respond_to do |format|
|
64
|
+
format.html { redirect_to list_posts_path, :flash => { :error => 'Article has been Removed.' }}
|
65
|
+
format.json { head :no_content }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
# Common Callbacks
|
72
|
+
def set_list_post
|
73
|
+
@list_post = List::Post.find(params[:id])
|
74
|
+
end
|
75
|
+
|
76
|
+
# Whitelist
|
77
|
+
def list_post_params
|
78
|
+
params.require(:list_post).permit(:list_post_title, :list_post_text, :list_post_status, :list_post_image, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
@@ -1,82 +1,82 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class Review::PostsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_review_post, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /review/posts
|
13
|
-
def index
|
14
|
-
@review_posts = Review::Post.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /review/posts/1
|
18
|
-
def show
|
19
|
-
@review_post = Review::Post.friendly.find(params[:id])
|
20
|
-
end
|
21
|
-
|
22
|
-
# GET /review/posts/new
|
23
|
-
def new
|
24
|
-
@review_post = Review::Post.new
|
25
|
-
end
|
26
|
-
|
27
|
-
# GET /review/posts/1/edit
|
28
|
-
def edit
|
29
|
-
end
|
30
|
-
|
31
|
-
# POST /review/posts
|
32
|
-
def create
|
33
|
-
@review_post = Review::Post.new(review_post_params)
|
34
|
-
@review_post.user_id = current_user.id
|
35
|
-
@review_post.org_id = current_user.org_id
|
36
|
-
respond_to do |format|
|
37
|
-
if @review_post.save
|
38
|
-
format.html { redirect_to review_posts_path, :flash => { :success => 'Review has been Added.' }}
|
39
|
-
format.json { render :show, status: :created, location: @review_post }
|
40
|
-
else
|
41
|
-
format.html { render :new }
|
42
|
-
format.json { render json: @review_post.errors, status: :unprocessable_entity }
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# PATCH/PUT /review/posts/1
|
48
|
-
def update
|
49
|
-
respond_to do |format|
|
50
|
-
if @review_post.update(review_post_params)
|
51
|
-
format.html { redirect_to review_posts_path, :flash => { :notice => 'Review has been Updated.' }}
|
52
|
-
format.json { render :show, status: :ok, location: @review_post }
|
53
|
-
else
|
54
|
-
format.html { render :edit }
|
55
|
-
format.json { render json: @review_post.errors, status: :unprocessable_entity }
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# DELETE /review/posts/1
|
61
|
-
def destroy
|
62
|
-
@review_post.destroy
|
63
|
-
respond_to do |format|
|
64
|
-
format.html { redirect_to review_posts_path, :flash => { :error => 'Review has been Removed.' }}
|
65
|
-
format.json { head :no_content }
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
private
|
70
|
-
|
71
|
-
# Common Callbacks
|
72
|
-
def set_review_post
|
73
|
-
@review_post = Review::Post.find(params[:id])
|
74
|
-
end
|
75
|
-
|
76
|
-
# Whitelist
|
77
|
-
def review_post_params
|
78
|
-
params.require(:review_post).permit(:review_post_title, :review_post_text, :review_post_status, :review_post_rating, :review_post_image, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
end
|
1
|
+
require_dependency "phcdevworks_press/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksPress
|
4
|
+
class Review::PostsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_review_post, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /review/posts
|
13
|
+
def index
|
14
|
+
@review_posts = Review::Post.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /review/posts/1
|
18
|
+
def show
|
19
|
+
@review_post = Review::Post.friendly.find(params[:id])
|
20
|
+
end
|
21
|
+
|
22
|
+
# GET /review/posts/new
|
23
|
+
def new
|
24
|
+
@review_post = Review::Post.new
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /review/posts/1/edit
|
28
|
+
def edit
|
29
|
+
end
|
30
|
+
|
31
|
+
# POST /review/posts
|
32
|
+
def create
|
33
|
+
@review_post = Review::Post.new(review_post_params)
|
34
|
+
@review_post.user_id = current_user.id
|
35
|
+
@review_post.org_id = current_user.org_id
|
36
|
+
respond_to do |format|
|
37
|
+
if @review_post.save
|
38
|
+
format.html { redirect_to review_posts_path, :flash => { :success => 'Review has been Added.' }}
|
39
|
+
format.json { render :show, status: :created, location: @review_post }
|
40
|
+
else
|
41
|
+
format.html { render :new }
|
42
|
+
format.json { render json: @review_post.errors, status: :unprocessable_entity }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# PATCH/PUT /review/posts/1
|
48
|
+
def update
|
49
|
+
respond_to do |format|
|
50
|
+
if @review_post.update(review_post_params)
|
51
|
+
format.html { redirect_to review_posts_path, :flash => { :notice => 'Review has been Updated.' }}
|
52
|
+
format.json { render :show, status: :ok, location: @review_post }
|
53
|
+
else
|
54
|
+
format.html { render :edit }
|
55
|
+
format.json { render json: @review_post.errors, status: :unprocessable_entity }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# DELETE /review/posts/1
|
61
|
+
def destroy
|
62
|
+
@review_post.destroy
|
63
|
+
respond_to do |format|
|
64
|
+
format.html { redirect_to review_posts_path, :flash => { :error => 'Review has been Removed.' }}
|
65
|
+
format.json { head :no_content }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
# Common Callbacks
|
72
|
+
def set_review_post
|
73
|
+
@review_post = Review::Post.find(params[:id])
|
74
|
+
end
|
75
|
+
|
76
|
+
# Whitelist
|
77
|
+
def review_post_params
|
78
|
+
params.require(:review_post).permit(:review_post_title, :review_post_text, :review_post_status, :review_post_rating, :review_post_image, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module ApplicationHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module ApplicationHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module Article::PostsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module Article::PostsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module Blog::ArticlesHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module Blog::ArticlesHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module List::ItemsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module List::ItemsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module List::PostsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module List::PostsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module Review::PostsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module Review::PostsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class ApplicationJob < ActiveJob::Base
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
class ApplicationJob < ActiveJob::Base
|
3
|
+
end
|
4
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class ApplicationMailer < ActionMailer::Base
|
3
|
-
default from: 'from@example.com'
|
4
|
-
layout 'mailer'
|
5
|
-
end
|
6
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
class ApplicationMailer < ActionMailer::Base
|
3
|
+
default from: 'from@example.com'
|
4
|
+
layout 'mailer'
|
5
|
+
end
|
6
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class ApplicationRecord < ActiveRecord::Base
|
3
|
-
self.abstract_class = true
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
class ApplicationRecord < ActiveRecord::Base
|
3
|
+
self.abstract_class = true
|
4
|
+
end
|
5
|
+
end
|