phcdevworks_press 8.3.0 → 9.0.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 +1 -1
- data/README.md +34 -33
- data/app/assets/config/phcdevworks_press_manifest.js +2 -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/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/review/post.rb +33 -33
- data/app/models/phcdevworks_press/review.rb +7 -7
- data/app/views/layouts/phcdevworks_press/application.html.erb +34 -92
- data/app/views/layouts/phcdevworks_press/components/backend/footer/_footer.html.erb +10 -9
- data/app/views/layouts/phcdevworks_press/components/backend/navigation/_top_menu.html.erb +26 -25
- data/app/views/layouts/phcdevworks_press/components/backend/sidebars/_side_menu.html.erb +491 -287
- data/app/views/phcdevworks_press/article/posts/_form.html.erb +102 -105
- data/app/views/phcdevworks_press/article/posts/edit.html.erb +23 -23
- data/app/views/phcdevworks_press/article/posts/index.html.erb +75 -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/list/items/_form.html.erb +37 -37
- data/app/views/phcdevworks_press/list/items/edit.html.erb +39 -47
- data/app/views/phcdevworks_press/list/items/index.html.erb +73 -81
- data/app/views/phcdevworks_press/list/items/new.html.erb +40 -48
- 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 +76 -84
- data/app/views/phcdevworks_press/list/posts/new.html.erb +23 -23
- data/app/views/phcdevworks_press/list/posts/show.html.erb +68 -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 +75 -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 +0 -5
- data/config/spring.rb +1 -1
- data/db/migrate/20170517064030_create_phcdevworks_press_article_post_versions.rb +1 -1
- 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 +29 -30
- data/lib/phcdevworks_press/version.rb +1 -1
- metadata +36 -86
- 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 +0 -3
- data/app/assets/stylesheets/phcdevworks_press/list/posts.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_press/review/posts.scss +0 -3
- data/app/views/layouts/phcdevworks_press/frontend.html.erb +0 -5
@@ -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
|
@@ -1,34 +1,34 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class Article::Post < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => "PhcdevworksPress::ArticlePostVersions"
|
9
|
-
|
10
|
-
# Image Upload
|
11
|
-
has_one_attached :article_post_image
|
12
|
-
|
13
|
-
# Relationships
|
14
|
-
belongs_to :user, class_name: "
|
15
|
-
has_and_belongs_to_many :categories, class_name: "PhcdevworksCoreModules::Post::Category", :join_table => "phcdevworks_press_article_categories_posts", :dependent => :destroy
|
16
|
-
belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
|
17
|
-
belongs_to :link, class_name: "PhcdevworksCoreModules::Affiliate::Link", optional: true
|
18
|
-
|
19
|
-
# Form Fields Validation
|
20
|
-
validates :article_post_title,
|
21
|
-
presence: true
|
22
|
-
|
23
|
-
validates :article_post_text,
|
24
|
-
presence: true
|
25
|
-
|
26
|
-
# Clean URL Define
|
27
|
-
friendly_id :list_post_imagearticle_post_nice_urls, use: [:slugged, :finders]
|
28
|
-
|
29
|
-
def list_post_imagearticle_post_nice_urls
|
30
|
-
[:article_post_title]
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
class Article::Post < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => "PhcdevworksPress::ArticlePostVersions"
|
9
|
+
|
10
|
+
# Image Upload
|
11
|
+
has_one_attached :article_post_image
|
12
|
+
|
13
|
+
# Relationships
|
14
|
+
belongs_to :user, class_name: "PhcdevworksAccountsDevise::User"
|
15
|
+
has_and_belongs_to_many :categories, class_name: "PhcdevworksCoreModules::Post::Category", :join_table => "phcdevworks_press_article_categories_posts", :dependent => :destroy
|
16
|
+
belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
|
17
|
+
belongs_to :link, class_name: "PhcdevworksCoreModules::Affiliate::Link", optional: true
|
18
|
+
|
19
|
+
# Form Fields Validation
|
20
|
+
validates :article_post_title,
|
21
|
+
presence: true
|
22
|
+
|
23
|
+
validates :article_post_text,
|
24
|
+
presence: true
|
25
|
+
|
26
|
+
# Clean URL Define
|
27
|
+
friendly_id :list_post_imagearticle_post_nice_urls, use: [:slugged, :finders]
|
28
|
+
|
29
|
+
def list_post_imagearticle_post_nice_urls
|
30
|
+
[:article_post_title]
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module Article
|
3
|
-
def self.table_name_prefix
|
4
|
-
"phcdevworks_press_article_"
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module Article
|
3
|
+
def self.table_name_prefix
|
4
|
+
"phcdevworks_press_article_"
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|
@@ -1,33 +1,33 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class List::Item < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => "PhcdevworksPress::ListItemVersions"
|
9
|
-
|
10
|
-
# Image Upload
|
11
|
-
has_one_attached :list_item_image
|
12
|
-
|
13
|
-
# Relationships
|
14
|
-
belongs_to :user, class_name: "
|
15
|
-
belongs_to :post, class_name: "PhcdevworksPress::List::Post"
|
16
|
-
belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
|
17
|
-
|
18
|
-
# Form Fields Validation
|
19
|
-
validates :list_item_title,
|
20
|
-
presence: true
|
21
|
-
|
22
|
-
validates :list_item_text,
|
23
|
-
presence: true
|
24
|
-
|
25
|
-
# Clean URL Define
|
26
|
-
friendly_id :list_item_nice_urls, use: [:slugged, :finders]
|
27
|
-
|
28
|
-
def list_item_nice_urls
|
29
|
-
[:list_item_title]
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
class List::Item < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => "PhcdevworksPress::ListItemVersions"
|
9
|
+
|
10
|
+
# Image Upload
|
11
|
+
has_one_attached :list_item_image
|
12
|
+
|
13
|
+
# Relationships
|
14
|
+
belongs_to :user, class_name: "PhcdevworksAccountsDevise::User"
|
15
|
+
belongs_to :post, class_name: "PhcdevworksPress::List::Post"
|
16
|
+
belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
|
17
|
+
|
18
|
+
# Form Fields Validation
|
19
|
+
validates :list_item_title,
|
20
|
+
presence: true
|
21
|
+
|
22
|
+
validates :list_item_text,
|
23
|
+
presence: true
|
24
|
+
|
25
|
+
# Clean URL Define
|
26
|
+
friendly_id :list_item_nice_urls, use: [:slugged, :finders]
|
27
|
+
|
28
|
+
def list_item_nice_urls
|
29
|
+
[:list_item_title]
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -1,34 +1,34 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class List::Post < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => "PhcdevworksPress::ListPostVersions"
|
9
|
-
|
10
|
-
# Image Upload
|
11
|
-
has_one_attached :list_post_image
|
12
|
-
|
13
|
-
# Relationships
|
14
|
-
belongs_to :user, class_name: "
|
15
|
-
has_many :items, class_name: "PhcdevworksPress::List::Item", :dependent => :destroy
|
16
|
-
has_and_belongs_to_many :categories, class_name: "PhcdevworksCoreModules::Post::Category", :join_table => "phcdevworks_press_list_categories_posts", :dependent => :destroy
|
17
|
-
belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
|
18
|
-
|
19
|
-
# Form Fields Validation
|
20
|
-
validates :list_post_title,
|
21
|
-
presence: true
|
22
|
-
|
23
|
-
validates :list_post_text,
|
24
|
-
presence: true
|
25
|
-
|
26
|
-
# Clean URL Define
|
27
|
-
friendly_id :list_post_nice_urls, use: [:slugged, :finders]
|
28
|
-
|
29
|
-
def list_post_nice_urls
|
30
|
-
[:list_post_title]
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
class List::Post < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => "PhcdevworksPress::ListPostVersions"
|
9
|
+
|
10
|
+
# Image Upload
|
11
|
+
has_one_attached :list_post_image
|
12
|
+
|
13
|
+
# Relationships
|
14
|
+
belongs_to :user, class_name: "PhcdevworksAccountsDevise::User"
|
15
|
+
has_many :items, class_name: "PhcdevworksPress::List::Item", :dependent => :destroy
|
16
|
+
has_and_belongs_to_many :categories, class_name: "PhcdevworksCoreModules::Post::Category", :join_table => "phcdevworks_press_list_categories_posts", :dependent => :destroy
|
17
|
+
belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
|
18
|
+
|
19
|
+
# Form Fields Validation
|
20
|
+
validates :list_post_title,
|
21
|
+
presence: true
|
22
|
+
|
23
|
+
validates :list_post_text,
|
24
|
+
presence: true
|
25
|
+
|
26
|
+
# Clean URL Define
|
27
|
+
friendly_id :list_post_nice_urls, use: [:slugged, :finders]
|
28
|
+
|
29
|
+
def list_post_nice_urls
|
30
|
+
[:list_post_title]
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
module List
|
3
|
-
def self.table_name_prefix
|
4
|
-
'phcdevworks_press_list_'
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
module List
|
3
|
+
def self.table_name_prefix
|
4
|
+
'phcdevworks_press_list_'
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|