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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c07bbf90817317e11e8e8c330fb9a80863d0ee8846bbe8b2867177c7e595244a
|
4
|
+
data.tar.gz: 2f846622b604eb2952a30431f15abe06d4a68c8365ce273a84b5a503ac8effe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 822e22b7a4f1807799f49bf3d58f3f8f94ff770a6fd108b7b0c6eaf2cd51998f991b22e17f339c7f9f89659c4afdbab0cd1e07a1b190c8bb44e8216244023a09
|
7
|
+
data.tar.gz: da7cc65cc03bd7d0169dbf325a78910f7e8850306add0c5e79e8b9ab3fb004558fd8f1bac9019b867b26228d0ceba3d86f33b5e7d96323e594add00e800cfc7e
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,34 +1,35 @@
|
|
1
|
-
### Phcdevworks Press (News/Blog Engine) Documentation
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
*
|
6
|
-
*
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
rails
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
rails assets:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
1
|
+
### Phcdevworks Press (News/Blog Engine) Documentation [![Gem Version](https://badge.fury.io/rb/phcdevworks_press.svg)](https://badge.fury.io/rb/phcdevworks_press)
|
2
|
+
|
3
|
+
Phcdevworks Press rails CMS engine to manage your website's articles, categories and media.
|
4
|
+
|
5
|
+
* Website article posts with WYSIWYG editor.
|
6
|
+
* Upload images locally or use any popular cloud service.
|
7
|
+
* Customizable article categories module included.
|
8
|
+
|
9
|
+
#### Step 1 - Add Phcdevworks Press to your gemfile and run command
|
10
|
+
|
11
|
+
gem 'phcdevworks_press'
|
12
|
+
bundle install
|
13
|
+
|
14
|
+
#### Step 2 - Copy Phcdevworks Press Database Tables
|
15
|
+
To copy Phcdevworks Press' requried database migrations, copy each command individually to your terminal's command line.
|
16
|
+
|
17
|
+
rails phcdevworks_press:install:migrations
|
18
|
+
rails db:migrate
|
19
|
+
|
20
|
+
#### Step 3 - Mount Phcdevworks Press & Add Routes
|
21
|
+
Mount Phcdevworks Press by adding code below to your routes file.
|
22
|
+
|
23
|
+
mount PhcdevworksPress::Engine, :at => '/'
|
24
|
+
|
25
|
+
#### Step 4 - Recompile Assets
|
26
|
+
To properly function re-compile your application's assets to copy over required files.
|
27
|
+
|
28
|
+
rails assets:clobber
|
29
|
+
rails assets:precompile
|
30
|
+
|
31
|
+
#### Step 5 - Generate Contact Form View (Customization)
|
32
|
+
All Phcdevworks Press views and layouts can be overwritten by copying files to your application.
|
33
|
+
|
34
|
+
rails generate phcdevworks_press:views
|
34
35
|
|
@@ -1,3 +1,2 @@
|
|
1
|
-
//=
|
2
|
-
//= link phcthemes_admin_panel_pack_coloradmin.
|
3
|
-
//= link phcthemes_admin_panel_pack_coloradmin.js
|
1
|
+
//= link coloradmin/default/phcthemes_admin_panel_pack_coloradmin.css
|
2
|
+
//= link coloradmin/phcthemes_admin_panel_pack_coloradmin.js
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module PhcdevworksPress
|
2
|
-
class ApplicationController < ActionController::Base
|
3
|
-
|
4
|
-
# Security Filters
|
5
|
-
protect_from_forgery with: :exception
|
6
|
-
|
7
|
-
# Load Requried Helper Files
|
8
|
-
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
-
helper PhcdevworksNotifications::Engine.helpers
|
10
|
-
helper PhcdevworksTitleseo::Engine.helpers
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module PhcdevworksPress
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
# Security Filters
|
5
|
+
protect_from_forgery with: :exception
|
6
|
+
|
7
|
+
# Load Requried Helper Files
|
8
|
+
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
+
helper PhcdevworksNotifications::Engine.helpers
|
10
|
+
helper PhcdevworksTitleseo::Engine.helpers
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -1,83 +1,83 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class Article::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_article_post, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /article/posts
|
13
|
-
def index
|
14
|
-
@article_posts = Article::Post.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /article/posts/1
|
18
|
-
def show
|
19
|
-
@article_post = Article::Post.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksPress::ArticlePostVersions.where(item_id: params[:id], item_type: 'PhcdevworksPress::Article::Post')
|
21
|
-
end
|
22
|
-
|
23
|
-
# GET /article/posts/new
|
24
|
-
def new
|
25
|
-
@article_post = Article::Post.new
|
26
|
-
end
|
27
|
-
|
28
|
-
# GET /article/posts/1/edit
|
29
|
-
def edit
|
30
|
-
end
|
31
|
-
|
32
|
-
# POST /article/posts
|
33
|
-
def create
|
34
|
-
@article_post = Article::Post.new(article_post_params)
|
35
|
-
@article_post.user_id = current_user.id
|
36
|
-
@article_post.org_id = current_user.org_id
|
37
|
-
respond_to do |format|
|
38
|
-
if @article_post.save
|
39
|
-
format.html { redirect_to article_posts_path, :flash => { :success => 'Article has been Added.' }}
|
40
|
-
format.json { render :show, status: :created, location: @article_post }
|
41
|
-
else
|
42
|
-
format.html { render :new }
|
43
|
-
format.json { render json: @article_post.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# PATCH/PUT /article/posts/1
|
49
|
-
def update
|
50
|
-
respond_to do |format|
|
51
|
-
if @article_post.update(article_post_params)
|
52
|
-
format.html { redirect_to article_posts_path, :flash => { :notice => 'Article has been Updated.' }}
|
53
|
-
format.json { render :show, status: :ok, location: @article_post }
|
54
|
-
else
|
55
|
-
format.html { render :edit }
|
56
|
-
format.json { render json: @article_post.errors, status: :unprocessable_entity }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# DELETE /article/posts/1
|
62
|
-
def destroy
|
63
|
-
@article_post.destroy
|
64
|
-
respond_to do |format|
|
65
|
-
format.html { redirect_to article_posts_path, :flash => { :error => 'Article has been Removed.' }}
|
66
|
-
format.json { head :no_content }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
# Common Callbacks
|
73
|
-
def set_article_post
|
74
|
-
@article_post = Article::Post.friendly.find(params[:id])
|
75
|
-
end
|
76
|
-
|
77
|
-
# Whitelist
|
78
|
-
def article_post_params
|
79
|
-
params.require(:article_post).permit(:article_post_title, :article_post_text, :article_post_status, :article_post_image, :remove_article_post_image, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
end
|
1
|
+
require_dependency "phcdevworks_press/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksPress
|
4
|
+
class Article::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_article_post, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /article/posts
|
13
|
+
def index
|
14
|
+
@article_posts = Article::Post.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /article/posts/1
|
18
|
+
def show
|
19
|
+
@article_post = Article::Post.friendly.find(params[:id])
|
20
|
+
@versions = PhcdevworksPress::ArticlePostVersions.where(item_id: params[:id], item_type: 'PhcdevworksPress::Article::Post')
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /article/posts/new
|
24
|
+
def new
|
25
|
+
@article_post = Article::Post.new
|
26
|
+
end
|
27
|
+
|
28
|
+
# GET /article/posts/1/edit
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
# POST /article/posts
|
33
|
+
def create
|
34
|
+
@article_post = Article::Post.new(article_post_params)
|
35
|
+
@article_post.user_id = current_user.id
|
36
|
+
@article_post.org_id = current_user.org_id
|
37
|
+
respond_to do |format|
|
38
|
+
if @article_post.save
|
39
|
+
format.html { redirect_to article_posts_path, :flash => { :success => 'Article has been Added.' }}
|
40
|
+
format.json { render :show, status: :created, location: @article_post }
|
41
|
+
else
|
42
|
+
format.html { render :new }
|
43
|
+
format.json { render json: @article_post.errors, status: :unprocessable_entity }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# PATCH/PUT /article/posts/1
|
49
|
+
def update
|
50
|
+
respond_to do |format|
|
51
|
+
if @article_post.update(article_post_params)
|
52
|
+
format.html { redirect_to article_posts_path, :flash => { :notice => 'Article has been Updated.' }}
|
53
|
+
format.json { render :show, status: :ok, location: @article_post }
|
54
|
+
else
|
55
|
+
format.html { render :edit }
|
56
|
+
format.json { render json: @article_post.errors, status: :unprocessable_entity }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# DELETE /article/posts/1
|
62
|
+
def destroy
|
63
|
+
@article_post.destroy
|
64
|
+
respond_to do |format|
|
65
|
+
format.html { redirect_to article_posts_path, :flash => { :error => 'Article has been Removed.' }}
|
66
|
+
format.json { head :no_content }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
# Common Callbacks
|
73
|
+
def set_article_post
|
74
|
+
@article_post = Article::Post.friendly.find(params[:id])
|
75
|
+
end
|
76
|
+
|
77
|
+
# Whitelist
|
78
|
+
def article_post_params
|
79
|
+
params.require(:article_post).permit(:article_post_title, :article_post_text, :article_post_status, :article_post_image, :remove_article_post_image, :slug, :optimization_id, :link_id, :org_id, :user_id, category_ids: [])
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class Blog::ArticlesController < ApplicationController
|
5
|
-
|
6
|
-
# Filters
|
7
|
-
before_action :phc_blog_index_all
|
8
|
-
|
9
|
-
# Layout
|
10
|
-
layout "phcdevworks_press/frontend"
|
11
|
-
|
12
|
-
# INDEX
|
13
|
-
def index
|
14
|
-
end
|
15
|
-
|
16
|
-
# SHOW
|
17
|
-
def show
|
18
|
-
@phcdevworks_cms_press_article_single = Article::Post.friendly.find(params[:id])
|
19
|
-
end
|
20
|
-
|
21
|
-
# Index All for Blog
|
22
|
-
def phc_blog_index_all
|
23
|
-
@phcdevworks_cms_press_article_index = Article::Post.where(article_post_status: "published").order("created_at DESC")
|
24
|
-
@phcdevworks_cms_press_list_index = List::Post.where(list_post_status: "published").order("created_at DESC")
|
25
|
-
@phcdevworks_cms_press_review_index = Review::Post.where(review_post_status: "published").order("created_at DESC")
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
1
|
+
require_dependency "phcdevworks_press/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksPress
|
4
|
+
class Blog::ArticlesController < ApplicationController
|
5
|
+
|
6
|
+
# Filters
|
7
|
+
before_action :phc_blog_index_all
|
8
|
+
|
9
|
+
# Layout
|
10
|
+
layout "phcdevworks_press/frontend"
|
11
|
+
|
12
|
+
# INDEX
|
13
|
+
def index
|
14
|
+
end
|
15
|
+
|
16
|
+
# SHOW
|
17
|
+
def show
|
18
|
+
@phcdevworks_cms_press_article_single = Article::Post.friendly.find(params[:id])
|
19
|
+
end
|
20
|
+
|
21
|
+
# Index All for Blog
|
22
|
+
def phc_blog_index_all
|
23
|
+
@phcdevworks_cms_press_article_index = Article::Post.where(article_post_status: "published").order("created_at DESC")
|
24
|
+
@phcdevworks_cms_press_list_index = List::Post.where(list_post_status: "published").order("created_at DESC")
|
25
|
+
@phcdevworks_cms_press_review_index = Review::Post.where(review_post_status: "published").order("created_at DESC")
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class Blog::ListsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters
|
7
|
-
before_action :phc_blog_index_all
|
8
|
-
|
9
|
-
# Layout
|
10
|
-
layout "phcdevworks_press/frontend"
|
11
|
-
|
12
|
-
# INDEX
|
13
|
-
def index
|
14
|
-
end
|
15
|
-
|
16
|
-
# SHOW
|
17
|
-
def show
|
18
|
-
@phcdevworks_cms_press_list_single = List::Post.friendly.find(params[:id])
|
19
|
-
end
|
20
|
-
|
21
|
-
# Index All for Blog
|
22
|
-
def phc_blog_index_all
|
23
|
-
@phcdevworks_cms_press_article_index = Article::Post.where(article_post_status: "published").order("created_at DESC")
|
24
|
-
@phcdevworks_cms_press_list_index = List::Post.where(list_post_status: "published").order("created_at DESC")
|
25
|
-
@phcdevworks_cms_press_review_index = Review::Post.where(review_post_status: "published").order("created_at DESC")
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
1
|
+
require_dependency "phcdevworks_press/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksPress
|
4
|
+
class Blog::ListsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters
|
7
|
+
before_action :phc_blog_index_all
|
8
|
+
|
9
|
+
# Layout
|
10
|
+
layout "phcdevworks_press/frontend"
|
11
|
+
|
12
|
+
# INDEX
|
13
|
+
def index
|
14
|
+
end
|
15
|
+
|
16
|
+
# SHOW
|
17
|
+
def show
|
18
|
+
@phcdevworks_cms_press_list_single = List::Post.friendly.find(params[:id])
|
19
|
+
end
|
20
|
+
|
21
|
+
# Index All for Blog
|
22
|
+
def phc_blog_index_all
|
23
|
+
@phcdevworks_cms_press_article_index = Article::Post.where(article_post_status: "published").order("created_at DESC")
|
24
|
+
@phcdevworks_cms_press_list_index = List::Post.where(list_post_status: "published").order("created_at DESC")
|
25
|
+
@phcdevworks_cms_press_review_index = Review::Post.where(review_post_status: "published").order("created_at DESC")
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
require_dependency "phcdevworks_press/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksPress
|
4
|
-
class Blog::ReviewsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters
|
7
|
-
before_action :phc_blog_index_all
|
8
|
-
|
9
|
-
# Layout
|
10
|
-
layout "phcdevworks_press/frontend"
|
11
|
-
|
12
|
-
# INDEX
|
13
|
-
def index
|
14
|
-
end
|
15
|
-
|
16
|
-
# SHOW
|
17
|
-
def show
|
18
|
-
@phcdevworks_cms_press_review_single = Review::Post.friendly.find(params[:id])
|
19
|
-
end
|
20
|
-
|
21
|
-
# Index All for Blog
|
22
|
-
def phc_blog_index_all
|
23
|
-
@phcdevworks_cms_press_article_index = Article::Post.where(article_post_status: "published").order("created_at DESC")
|
24
|
-
@phcdevworks_cms_press_list_index = List::Post.where(list_post_status: "published").order("created_at DESC")
|
25
|
-
@phcdevworks_cms_press_review_index = Review::Post.where(review_post_status: "published").order("created_at DESC")
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
1
|
+
require_dependency "phcdevworks_press/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksPress
|
4
|
+
class Blog::ReviewsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters
|
7
|
+
before_action :phc_blog_index_all
|
8
|
+
|
9
|
+
# Layout
|
10
|
+
layout "phcdevworks_press/frontend"
|
11
|
+
|
12
|
+
# INDEX
|
13
|
+
def index
|
14
|
+
end
|
15
|
+
|
16
|
+
# SHOW
|
17
|
+
def show
|
18
|
+
@phcdevworks_cms_press_review_single = Review::Post.friendly.find(params[:id])
|
19
|
+
end
|
20
|
+
|
21
|
+
# Index All for Blog
|
22
|
+
def phc_blog_index_all
|
23
|
+
@phcdevworks_cms_press_article_index = Article::Post.where(article_post_status: "published").order("created_at DESC")
|
24
|
+
@phcdevworks_cms_press_list_index = List::Post.where(list_post_status: "published").order("created_at DESC")
|
25
|
+
@phcdevworks_cms_press_review_index = Review::Post.where(review_post_status: "published").order("created_at DESC")
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -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
|