phcpresspro 2.2.5 → 3.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 +20 -0
- data/Rakefile +17 -10
- data/app/assets/config/phcpresspro_manifest.js +2 -0
- data/app/assets/javascripts/phcpresspro/application.js +13 -0
- data/app/assets/stylesheets/phcpresspro/_custom.scss +0 -0
- data/app/assets/stylesheets/phcpresspro/application.scss +17 -4
- data/app/controllers/phcpresspro/application_controller.rb +1 -2
- data/app/controllers/phcpresspro/blog/posts_controller.rb +23 -29
- data/app/controllers/phcpresspro/modules/categories_controller.rb +67 -0
- data/app/controllers/phcpresspro/news/posts_controller.rb +1 -1
- data/app/helpers/phcpresspro/application_helper.rb +2 -2
- data/app/jobs/phcpresspro/application_job.rb +4 -0
- data/app/mailers/phcpresspro/application_mailer.rb +6 -0
- data/app/models/phcpresspro/application_record.rb +5 -0
- data/app/models/phcpresspro/blog/post.rb +5 -2
- data/app/models/phcpresspro/modules/category.rb +4 -0
- data/app/models/phcpresspro/modules.rb +7 -0
- data/app/models/phcpresspro/news/post.rb +5 -2
- data/app/uploaders/phcpresspro/pstimage_uploader.rb +9 -24
- data/app/views/phcpresspro/blog/posts/_form.html.erb +12 -2
- data/app/views/phcpresspro/{categories → modules/categories}/_form.html.erb +1 -4
- data/app/views/phcpresspro/{categories → modules/categories}/edit.html.erb +0 -0
- data/app/views/phcpresspro/{categories → modules/categories}/index.html.erb +4 -4
- data/app/views/phcpresspro/{categories → modules/categories}/new.html.erb +0 -0
- data/app/views/phcpresspro/news/posts/_form.html.erb +7 -3
- data/config/routes.rb +9 -14
- data/db/migrate/{20160316131626_create_phcpresspro_news_posts.rb → 20160716182409_create_phcpresspro_news_posts.rb} +5 -2
- data/db/migrate/{20160316131650_create_phcpresspro_blog_posts.rb → 20160716182518_create_phcpresspro_blog_posts.rb} +4 -1
- data/db/migrate/20160716182936_create_phcpresspro_modules_categories.rb +15 -0
- data/lib/phcpresspro/engine.rb +1 -1
- data/lib/phcpresspro/version.rb +1 -1
- metadata +144 -101
- data/LICENSE +0 -238
- data/app/assets/stylesheets/phcpresspro/custom.scss +0 -4
- data/app/controllers/phcpresspro/categories_controller.rb +0 -63
- data/app/models/phcpresspro/category.rb +0 -4
- data/db/migrate/20160424211134_create_phcpresspro_categories.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cbaf20f2d62b8938bd8f4d78daa59399fc48bb8
|
4
|
+
data.tar.gz: 1614697c03e4a4bcc201725744c092ec2be9657d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fe2dea34889665649b4ae38730859a56417faaacf88bb94e8dc074cebc8170e23eff20328c0caa2d599687853b0d9853b7ded758e6e25d7d88569997025abb4
|
7
|
+
data.tar.gz: ade10837d57d1fde4f547885e1e6d4b43060cc14a47c54859b1eac418a716070499c9709241fab014904fae38671135c703f4a1492d980f38533788e1def6bea
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 BradPotts - PHCNetworks
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,26 +1,33 @@
|
|
1
1
|
begin
|
2
|
-
|
2
|
+
require 'bundler/setup'
|
3
3
|
rescue LoadError
|
4
|
-
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
5
|
end
|
6
6
|
|
7
7
|
require 'rdoc/task'
|
8
8
|
|
9
9
|
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Phcpresspro'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
17
|
-
APP_RAKEFILE = File.expand_path("../spec/
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/testapp/Rakefile", __FILE__)
|
18
18
|
load 'rails/tasks/engine.rake'
|
19
19
|
|
20
|
-
|
21
20
|
load 'rails/tasks/statistics.rake'
|
22
21
|
|
22
|
+
require 'bundler/gem_tasks'
|
23
23
|
|
24
|
+
require 'rake/testtask'
|
24
25
|
|
25
|
-
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'lib'
|
28
|
+
t.libs << 'test'
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
30
|
+
t.verbose = false
|
31
|
+
end
|
26
32
|
|
33
|
+
task default: :test
|
@@ -1,3 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
1
13
|
//= require jquery
|
2
14
|
//= require jquery_ujs
|
3
15
|
//= require bootstrap-sprockets
|
16
|
+
//= require_tree .
|
File without changes
|
@@ -1,10 +1,23 @@
|
|
1
1
|
/*
|
2
|
-
|
3
|
-
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
4
16
|
|
5
|
-
//
|
17
|
+
// Bootstrap & Font Awesome
|
18
|
+
@import "bootstrap-sprockets";
|
6
19
|
@import "bootstrap";
|
7
20
|
@import "font-awesome";
|
8
21
|
|
9
|
-
//
|
22
|
+
// Custom Alterations
|
10
23
|
@import "custom";
|
@@ -2,7 +2,6 @@ module Phcpresspro
|
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
|
4
4
|
# Prevent CSRF attacks by raising an exception.
|
5
|
-
# For APIs, you may want to use :null_session instead.
|
6
5
|
before_filter :require_user
|
7
6
|
protect_from_forgery with: :exception
|
8
7
|
|
@@ -30,4 +29,4 @@ module Phcpresspro
|
|
30
29
|
helper Phcnotifi::Engine.helpers
|
31
30
|
|
32
31
|
end
|
33
|
-
end
|
32
|
+
end
|
@@ -1,57 +1,51 @@
|
|
1
|
-
# Load General Controller for Engine
|
2
1
|
require_dependency "phcpresspro/application_controller"
|
3
2
|
|
4
|
-
# Code for Blog Posting
|
5
3
|
module Phcpresspro
|
6
4
|
class Blog::PostsController < ApplicationController
|
7
5
|
|
8
6
|
# Filters & Security
|
9
|
-
layout 'layouts/phcpresspro/
|
7
|
+
layout 'layouts/phcpresspro/newspost/news_layout'
|
10
8
|
before_action :require_user
|
11
|
-
before_action :
|
9
|
+
before_action :set_news_post, only: [:edit, :update, :destroy]
|
12
10
|
|
13
|
-
#
|
11
|
+
# News Post Index
|
14
12
|
def index
|
15
|
-
@
|
13
|
+
@news_posts = News::Post.all
|
16
14
|
end
|
17
15
|
|
18
|
-
#
|
19
|
-
#def show
|
20
|
-
#end
|
21
|
-
|
22
|
-
# Create a New Blog Post (/blog/posts/new)
|
16
|
+
# New News Article
|
23
17
|
def new
|
24
|
-
@
|
18
|
+
@news_post = News::Post.new
|
25
19
|
end
|
26
20
|
|
27
|
-
# Edit
|
21
|
+
# Edit News Article
|
28
22
|
def edit
|
29
23
|
end
|
30
24
|
|
31
|
-
# Create News
|
25
|
+
# Create News Article
|
32
26
|
def create
|
33
|
-
@
|
34
|
-
@
|
35
|
-
if @
|
36
|
-
redirect_to
|
27
|
+
@news_post = News::Post.new(news_post_params)
|
28
|
+
@news_post.user_id = current_user.id
|
29
|
+
if @news_post.save
|
30
|
+
redirect_to news_posts_path, notice: 'News Article was Successfully Created.'
|
37
31
|
else
|
38
32
|
render 'new'
|
39
33
|
end
|
40
34
|
end
|
41
35
|
|
42
|
-
#
|
36
|
+
# Update News Article
|
43
37
|
def update
|
44
|
-
if @
|
45
|
-
redirect_to
|
38
|
+
if @news_post.update(news_post_params)
|
39
|
+
redirect_to news_posts_path, notice: 'News Article was Successfully Updated.'
|
46
40
|
else
|
47
41
|
render :edit
|
48
42
|
end
|
49
43
|
end
|
50
44
|
|
51
|
-
#
|
45
|
+
# Delete News Destroy
|
52
46
|
def destroy
|
53
|
-
@
|
54
|
-
redirect_to
|
47
|
+
@news_post.destroy
|
48
|
+
redirect_to news_posts_path, notice: 'News Article was Successfully Destroyed.'
|
55
49
|
end
|
56
50
|
|
57
51
|
private
|
@@ -62,13 +56,13 @@ module Phcpresspro
|
|
62
56
|
end
|
63
57
|
|
64
58
|
# Common Callbacks
|
65
|
-
def
|
66
|
-
@
|
59
|
+
def set_news_post
|
60
|
+
@news_post = News::Post.find(params[:id])
|
67
61
|
end
|
68
62
|
|
69
|
-
# Whitelist
|
70
|
-
def
|
71
|
-
params.require(:
|
63
|
+
# Whitelist
|
64
|
+
def news_post_params
|
65
|
+
params.require(:news_post).permit(:newspsttitle, :newspsttext, :newspstexcerpts, :pststatus, :pstimage, :user_id, :category_id)
|
72
66
|
end
|
73
67
|
|
74
68
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require_dependency "phcpresspro/application_controller"
|
2
|
+
|
3
|
+
module Phcpresspro
|
4
|
+
class Modules::CategoriesController < ApplicationController
|
5
|
+
|
6
|
+
# Security and Filters
|
7
|
+
before_action :authenticate_user!
|
8
|
+
before_action :set_modules_category, only: [:show, :edit, :update, :destroy]
|
9
|
+
|
10
|
+
# Categories Index
|
11
|
+
def index
|
12
|
+
@modules_categories = Modules::Category.all
|
13
|
+
end
|
14
|
+
|
15
|
+
# Detail News/Blog Category
|
16
|
+
def show
|
17
|
+
end
|
18
|
+
|
19
|
+
# New News/Blog Category
|
20
|
+
def new
|
21
|
+
@modules_category = Modules::Category.new
|
22
|
+
end
|
23
|
+
|
24
|
+
# Edit News/Blog Category
|
25
|
+
def edit
|
26
|
+
end
|
27
|
+
|
28
|
+
# Create News/Blog Category
|
29
|
+
def create
|
30
|
+
@modules_category = Modules::Category.new(modules_category_params)
|
31
|
+
|
32
|
+
if @modules_category.save
|
33
|
+
redirect_to @modules_category, notice: 'Category was successfully created.'
|
34
|
+
else
|
35
|
+
render :new
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Update News/Blog Category
|
40
|
+
def update
|
41
|
+
if @modules_category.update(modules_category_params)
|
42
|
+
redirect_to @modules_category, notice: 'Category was successfully updated.'
|
43
|
+
else
|
44
|
+
render :edit
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Delete News/Blog Category
|
49
|
+
def destroy
|
50
|
+
@modules_category.destroy
|
51
|
+
redirect_to modules_categories_url, notice: 'Category was successfully destroyed.'
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
# Common Callbacks
|
57
|
+
def set_modules_category
|
58
|
+
@modules_category = Modules::Category.find(params[:id])
|
59
|
+
end
|
60
|
+
|
61
|
+
# Whitelist
|
62
|
+
def modules_category_params
|
63
|
+
params.fetch(:modules_category, {:catname})
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
@@ -1,8 +1,11 @@
|
|
1
1
|
module Phcpresspro
|
2
|
-
class Blog::Post <
|
2
|
+
class Blog::Post < ApplicationRecord
|
3
3
|
|
4
4
|
# For Image Uploads
|
5
|
-
mount_uploader :pstimage,
|
5
|
+
mount_uploader :pstimage, Phcpress::PstimageUploader
|
6
|
+
|
7
|
+
# Associate Post Authour to User
|
8
|
+
belongs_to :user, class_name: 'Phcengine::User'
|
6
9
|
|
7
10
|
end
|
8
11
|
end
|
@@ -1,8 +1,11 @@
|
|
1
1
|
module Phcpresspro
|
2
|
-
class News::Post <
|
2
|
+
class News::Post < ApplicationRecord
|
3
3
|
|
4
4
|
# For Image Uploads
|
5
|
-
mount_uploader :pstimage,
|
5
|
+
mount_uploader :pstimage, Phcpress::PstimageUploader
|
6
|
+
|
7
|
+
# Associate Post Authour to User
|
8
|
+
belongs_to :user, class_name: 'Phcengine::User'
|
6
9
|
|
7
10
|
end
|
8
11
|
end
|
@@ -1,30 +1,15 @@
|
|
1
1
|
class Phcpresspro::PstimageUploader < CarrierWave::Uploader::Base
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
# storage :fog
|
3
|
+
# Include Cloudinary (Install Cloudinary Gem in Gemfile)
|
4
|
+
include Cloudinary::CarrierWave
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
# Image Version
|
7
|
+
version :standard do
|
8
|
+
process :resize_to_fill => [100, 150, :north]
|
9
|
+
end
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
# Hash filenames
|
18
|
-
def filename
|
19
|
-
"#{secure_token}.#{file.extension}" if original_filename.present?
|
20
|
-
end
|
21
|
-
|
22
|
-
protected
|
23
|
-
|
24
|
-
# Secure Token for File Hashing
|
25
|
-
def secure_token
|
26
|
-
var = :"@#{mounted_as}_secure_token"
|
27
|
-
model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
|
28
|
-
end
|
11
|
+
version :thumbnail do
|
12
|
+
resize_to_fit(50, 50)
|
13
|
+
end
|
29
14
|
|
30
15
|
end
|
@@ -5,6 +5,7 @@
|
|
5
5
|
<%= render 'phcnotifi/validations', :object => @blog_post %>
|
6
6
|
|
7
7
|
<div class="col-md-3">
|
8
|
+
|
8
9
|
<div class="panel panel-primary">
|
9
10
|
<div class="panel-heading">
|
10
11
|
<i class="fa fa-paper-plane-o"></i> Publish Panel
|
@@ -16,13 +17,14 @@
|
|
16
17
|
</div>
|
17
18
|
<div class="form-group">
|
18
19
|
<%= f.label :pstcategory, "Post Category" %>
|
19
|
-
<%= collection_select(:pstcategory, :pstcategory_id,
|
20
|
+
<%= collection_select(:pstcategory, :pstcategory_id, Phcpress::Modules::Category.order('catname'), :id, :catname, {}, {class: "form-control form-control-sm"}) %>
|
20
21
|
</div>
|
21
22
|
<div class="actions">
|
22
23
|
<%= f.submit "Publish Blog Article", class: "btn btn-primary btn-sm" %>
|
23
24
|
</div>
|
24
25
|
</div>
|
25
26
|
</div>
|
27
|
+
|
26
28
|
<div class="panel panel-primary">
|
27
29
|
<div class="panel-heading">
|
28
30
|
<i class="fa fa-camera-retro"></i> Post Images
|
@@ -32,11 +34,18 @@
|
|
32
34
|
<label><%= f.label :pstimage, "Featured Image" %></label>
|
33
35
|
<%= f.file_field :pstimage, class: "form-control" %>
|
34
36
|
</div>
|
35
|
-
|
37
|
+
<% if f.object.pstimage? %>
|
38
|
+
<%= image_tag f.object.pstimage, class: "img-responsive img-thumbnail" %>
|
39
|
+
<%= f.label :remove_pstimage %>
|
40
|
+
<%= f.check_box :remove_pstimage %>
|
41
|
+
<% end %>
|
36
42
|
</div>
|
37
43
|
</div>
|
44
|
+
|
38
45
|
</div>
|
46
|
+
|
39
47
|
<div class="col-md-9 ">
|
48
|
+
|
40
49
|
<div class="panel panel-primary">
|
41
50
|
<div class="panel-heading">
|
42
51
|
<i class="fa fa-pencil-square-o"></i> Blog Post Publisher
|
@@ -56,6 +65,7 @@
|
|
56
65
|
</div>
|
57
66
|
</div>
|
58
67
|
</div>
|
68
|
+
|
59
69
|
</div>
|
60
70
|
|
61
71
|
<% end %>
|
@@ -1,9 +1,6 @@
|
|
1
1
|
<div class="row">
|
2
2
|
<div class="col-lg-12">
|
3
|
-
<%= form_for(@
|
4
|
-
|
5
|
-
<!-- PHC-Notifi Render Validation -->
|
6
|
-
<%= render 'phcnotifi/validations', :object => @category %>
|
3
|
+
<%= form_for(@modules_category) do |f| %>
|
7
4
|
|
8
5
|
<div class="form-group">
|
9
6
|
<label><%= f.label :catname, "Category Name" %></label>
|
File without changes
|
@@ -17,12 +17,12 @@
|
|
17
17
|
</thead>
|
18
18
|
|
19
19
|
<tbody>
|
20
|
-
<% @
|
20
|
+
<% @modules_categories.each do |modules_category| %>
|
21
21
|
<tr>
|
22
|
-
<td><%=
|
22
|
+
<td><%= modules_category.catname %></td>
|
23
23
|
<td><div class="btn-group" role="group" aria-label="Blog Articles">
|
24
|
-
<%= link_to 'Edit',
|
25
|
-
<%= link_to 'Trash',
|
24
|
+
<%= link_to 'Edit', edit_modules_category_path(category) , class: "btn btn-primary btn-xs" %>
|
25
|
+
<%= link_to 'Trash', modules_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
|
26
26
|
</div>
|
27
27
|
</td>
|
28
28
|
</tr>
|
File without changes
|
@@ -17,7 +17,7 @@
|
|
17
17
|
</div>
|
18
18
|
<div class="form-group">
|
19
19
|
<%= f.label :pstcategory, "Post Category" %>
|
20
|
-
<%= collection_select(:pstcategory, :pstcategory_id,
|
20
|
+
<%= collection_select(:pstcategory, :pstcategory_id, Phcpress::Modules::Category.order('catname'), :id, :catname, {}, {class: "form-control form-control-sm"}) %>
|
21
21
|
</div>
|
22
22
|
<div class="actions">
|
23
23
|
<%= f.submit "Publish News Article", class: "btn btn-primary btn-sm" %>
|
@@ -31,10 +31,14 @@
|
|
31
31
|
</div>
|
32
32
|
<div class="panel-body">
|
33
33
|
<div class="form-group">
|
34
|
-
|
34
|
+
<label><%= f.label :pstimage, "Featured Image" %></label>
|
35
35
|
<%= f.file_field :pstimage, class: "form-control" %>
|
36
36
|
</div>
|
37
|
-
|
37
|
+
<% if f.object.pstimage? %>
|
38
|
+
<%= image_tag f.object.pstimage, class: "img-responsive img-thumbnail" %>
|
39
|
+
<%= f.label :remove_pstimage %>
|
40
|
+
<%= f.check_box :remove_pstimage %>
|
41
|
+
<% end %>
|
38
42
|
</div>
|
39
43
|
</div>
|
40
44
|
|
data/config/routes.rb
CHANGED
@@ -1,16 +1,11 @@
|
|
1
1
|
Phcpresspro::Engine.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
# Categories
|
14
|
-
resources :categories, class_name: 'Phcpresspro::Category'
|
15
|
-
|
2
|
+
namespace :modules do
|
3
|
+
resources :categories
|
4
|
+
end
|
5
|
+
namespace :blog do
|
6
|
+
resources :posts
|
7
|
+
end
|
8
|
+
namespace :news do
|
9
|
+
resources :posts
|
10
|
+
end
|
16
11
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreatePhcpressproNewsPosts < ActiveRecord::Migration
|
1
|
+
class CreatePhcpressproNewsPosts < ActiveRecord::Migration[5.0]
|
2
2
|
def change
|
3
3
|
create_table :phcpresspro_news_posts do |t|
|
4
4
|
|
@@ -9,9 +9,12 @@ class CreatePhcpressproNewsPosts < ActiveRecord::Migration
|
|
9
9
|
t.string :pstimage
|
10
10
|
|
11
11
|
t.integer :pstcategory_id
|
12
|
+
|
12
13
|
t.string :user_id
|
14
|
+
t.string :membership_id
|
15
|
+
t.string :oganization_id
|
13
16
|
|
14
|
-
t.timestamps
|
17
|
+
t.timestamps
|
15
18
|
|
16
19
|
end
|
17
20
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreatePhcpressproBlogPosts < ActiveRecord::Migration
|
1
|
+
class CreatePhcpressproBlogPosts < ActiveRecord::Migration[5.0]
|
2
2
|
def change
|
3
3
|
create_table :phcpresspro_blog_posts do |t|
|
4
4
|
|
@@ -9,7 +9,10 @@ class CreatePhcpressproBlogPosts < ActiveRecord::Migration
|
|
9
9
|
t.string :pstimage
|
10
10
|
|
11
11
|
t.integer :pstcategory_id
|
12
|
+
|
12
13
|
t.string :user_id
|
14
|
+
t.string :membership_id
|
15
|
+
t.string :oganization_id
|
13
16
|
|
14
17
|
t.timestamps null: false
|
15
18
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreatePhcpressproModulesCategories < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
create_table :phcpresspro_modules_categories do |t|
|
4
|
+
|
5
|
+
t.string :catname
|
6
|
+
|
7
|
+
t.string :user_id
|
8
|
+
t.string :membership_id
|
9
|
+
t.string :oganization_id
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/phcpresspro/engine.rb
CHANGED
@@ -12,6 +12,7 @@ module Phcpresspro
|
|
12
12
|
|
13
13
|
# Load Image Processing
|
14
14
|
require 'carrierwave'
|
15
|
+
require 'cloudinary'
|
15
16
|
|
16
17
|
# Give Everything a Namespace
|
17
18
|
isolate_namespace Phcpresspro
|
@@ -42,6 +43,5 @@ module Phcpresspro
|
|
42
43
|
g.fixture_replacement :factory_girl, dir: "spec/factories"
|
43
44
|
end
|
44
45
|
|
45
|
-
|
46
46
|
end
|
47
47
|
end
|
data/lib/phcpresspro/version.rb
CHANGED