phcpress 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24739e23457ad085fc5e25f68605f883ace99108
4
- data.tar.gz: 0655bb4da83f0cc47490ff15ca9c75444a889aa6
3
+ metadata.gz: a977adfde08fe04db782145ef10c5d2e58ddfb71
4
+ data.tar.gz: 2d33a5f42c798b8d7afe41e799ef208538526c22
5
5
  SHA512:
6
- metadata.gz: 8ee6e205a80c7a1ac43f171a0ffb6d71e1c7850aa3995a0eb93b140fc49972794f0b92d652fca7a49ea4bd46aa4ae47da014ea433fa4d314a9dd0ebebf59d580
7
- data.tar.gz: 6715644c5807d9754f0089ec1ea434eb6fe0de9790a2025faa5876e809eb4ce7ded85aeb5cacad6bccfc90058ff763e3466d2c01f83e76f3a79ed1dacb689a75
6
+ metadata.gz: c3d05694eae8d01438112f8cb0afbfb9e4bcb6a4be35ba18754ec37461e62e169edaa0bf9372055612f5f14779bad54b0eb7be69732abdc482d0a6ed8310463d
7
+ data.tar.gz: ea546a1379b213d2942f57801cab95d7b153244ba391023118830667ef4763f1fbbea2d874abcdf10faca7b270b8345dacbb861d5709a0984374c4f7bd2912ea
@@ -1,3 +1,3 @@
1
- // Place all the styles related to the website/pages controller here.
1
+ // Place all the styles related to the website/presspages controller here.
2
2
  // They will automatically be included in application.css.
3
3
  // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -6,6 +6,8 @@ module Phcpress
6
6
  class Blog::PostsController < ApplicationController
7
7
 
8
8
  # Filters & Security
9
+ layout 'layouts/phcpress/blogpost/blog_layout'
10
+ before_action :authenticate_user!
9
11
  before_action :set_blog_post, only: [:edit, :update, :destroy]
10
12
 
11
13
  # Blog Post Index (/blog/posts)
@@ -6,7 +6,8 @@ module Phcpress
6
6
  class News::PostsController < ApplicationController
7
7
 
8
8
  # Filters & Security
9
- layout :layouts_resolver_application
9
+ layout 'layouts/phcpress/newspost/news_layout'
10
+ before_action :authenticate_user!
10
11
  before_action :set_news_post, only: [:edit, :update, :destroy]
11
12
 
12
13
  # News Post Index (/news/posts)
@@ -20,7 +21,7 @@ module Phcpress
20
21
 
21
22
  # Create a New News Post (/news/posts/new)
22
23
  def new
23
- @news_post = News::Post.new
24
+ @news_post = News::Post.scoped_to(current_account).new
24
25
  end
25
26
 
26
27
  # Edit News Post /news/posts/1/edit
@@ -29,7 +30,7 @@ module Phcpress
29
30
 
30
31
  # POST
31
32
  def create
32
- @news_post = News::Post.new(news_post_params)
33
+ @news_post = News::Post.current_user.(news_post_params)
33
34
 
34
35
  if @news_post.save
35
36
  redirect_to news_posts_path, notice: 'News post was successfully created.'
@@ -0,0 +1,6 @@
1
+ require_dependency "phcpress/application_controller"
2
+
3
+ module Phcpress
4
+ class Website::PresspagesController < ApplicationController
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ module Phcpress
2
+ module Website::PresspagesHelper
3
+ end
4
+ end
@@ -1,7 +1,16 @@
1
1
  module Phcpress
2
2
  class Blog::Post < ActiveRecord::Base
3
3
 
4
+ # Define scoped_to for Devise
5
+ def scoped_to(account)
6
+ where(:user_id => current_user.id)
7
+ end
8
+
9
+ # For Image Uploads
4
10
  mount_uploader :pstimage, Phcpress::PstimageUploader
5
11
 
12
+ # Associate Post Authour to User
13
+ belongs_to :user
14
+
6
15
  end
7
16
  end
@@ -1,7 +1,16 @@
1
1
  module Phcpress
2
2
  class News::Post < ActiveRecord::Base
3
3
 
4
+ # Define scoped_to for Devise
5
+ def scoped_to(account)
6
+ where(:user_id => current_user.id)
7
+ end
8
+
9
+ # For Image Uploads
4
10
  mount_uploader :pstimage, Phcpress::PstimageUploader
11
+
12
+ # Associate Post Authour to User
13
+ belongs_to :user
5
14
 
6
15
  end
7
16
  end
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+
5
+ <title>PHCPress - News Post & Blogging System</title>
6
+
7
+ <%= stylesheet_link_tag "phcpress/application", media: "all" %>
8
+ <%= javascript_include_tag "phcpress/application" %>
9
+ <%= csrf_meta_tags %>
10
+
11
+ </head>
12
+
13
+ <body>
14
+ <%= render 'layouts/phcnotifi/components/notifications' %>
15
+ <div class="container">
16
+ <div class="row">
17
+ <%= yield %>
18
+ </div>
19
+ </div>
20
+ </body>
21
+
22
+ </html>
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+
5
+ <title>PHCPress - News Post & Blogging System</title>
6
+
7
+ <%= stylesheet_link_tag "phcpress/application", media: "all" %>
8
+ <%= javascript_include_tag "phcpress/application" %>
9
+ <%= csrf_meta_tags %>
10
+
11
+ </head>
12
+
13
+ <body>
14
+ <%= render 'layouts/phcnotifi/components/notifications' %>
15
+ <div class="container">
16
+ <div class="row">
17
+ <%= yield %>
18
+ </div>
19
+ </div>
20
+ </body>
21
+
22
+ </html>
@@ -1,3 +1,3 @@
1
1
  module Phcpress
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcpress
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2016-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 4.2.5.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '4.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 4.2.5.1
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: pg
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -25,25 +45,25 @@ dependencies:
25
45
  - !ruby/object:Gem::Version
26
46
  version: 0.18.4
27
47
  - !ruby/object:Gem::Dependency
28
- name: rails
48
+ name: devise
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
51
  - - "~>"
32
52
  - !ruby/object:Gem::Version
33
- version: '4.2'
53
+ version: '3.5'
34
54
  - - ">="
35
55
  - !ruby/object:Gem::Version
36
- version: 4.2.5.1
56
+ version: 3.5.6
37
57
  type: :runtime
38
58
  prerelease: false
39
59
  version_requirements: !ruby/object:Gem::Requirement
40
60
  requirements:
41
61
  - - "~>"
42
62
  - !ruby/object:Gem::Version
43
- version: '4.2'
63
+ version: '3.5'
44
64
  - - ">="
45
65
  - !ruby/object:Gem::Version
46
- version: 4.2.5.1
66
+ version: 3.5.6
47
67
  - !ruby/object:Gem::Dependency
48
68
  name: carrierwave
49
69
  requirement: !ruby/object:Gem::Requirement
@@ -250,8 +270,8 @@ dependencies:
250
270
  - - "~>"
251
271
  - !ruby/object:Gem::Version
252
272
  version: '2.52'
253
- description: PHC-Press is a simple news and blog posting engine for your ruby on rails
254
- powered site.
273
+ description: PHC-Press is a news and blog posting engine for ruby on rails apps setup
274
+ for use with Devise User.
255
275
  email:
256
276
  - brad.potts@phcnetworks.net
257
277
  executables: []
@@ -264,20 +284,20 @@ files:
264
284
  - app/assets/javascripts/phcpress/application.js
265
285
  - app/assets/javascripts/phcpress/blog/posts.js
266
286
  - app/assets/javascripts/phcpress/news/posts.js
267
- - app/assets/javascripts/phcpress/website/pages.js
287
+ - app/assets/javascripts/phcpress/website/presspages.js
268
288
  - app/assets/stylesheets/phcpress/application.css.scss
269
289
  - app/assets/stylesheets/phcpress/blog/posts.css
270
290
  - app/assets/stylesheets/phcpress/custom.css.scss
271
291
  - app/assets/stylesheets/phcpress/news/posts.css
272
- - app/assets/stylesheets/phcpress/website/pages.scss
292
+ - app/assets/stylesheets/phcpress/website/presspages.scss
273
293
  - app/controllers/phcpress/application_controller.rb
274
294
  - app/controllers/phcpress/blog/posts_controller.rb
275
295
  - app/controllers/phcpress/news/posts_controller.rb
276
- - app/controllers/phcpress/website/pages_controller.rb
296
+ - app/controllers/phcpress/website/presspages_controller.rb
277
297
  - app/helpers/phcpress/application_helper.rb
278
298
  - app/helpers/phcpress/blog/posts_helper.rb
279
299
  - app/helpers/phcpress/news/posts_helper.rb
280
- - app/helpers/phcpress/website/pages_helper.rb
300
+ - app/helpers/phcpress/website/presspages_helper.rb
281
301
  - app/models/phcpress/blog.rb
282
302
  - app/models/phcpress/blog/post.rb
283
303
  - app/models/phcpress/news.rb
@@ -286,7 +306,9 @@ files:
286
306
  - app/views/layouts/phcnotifi/components/_notifications.html.erb
287
307
  - app/views/layouts/phcnotifi/components/_validations.html.erb
288
308
  - app/views/layouts/phcpress/application.html.erb
289
- - app/views/layouts/phcpress/pagelayout.html.erb
309
+ - app/views/layouts/phcpress/blogpost/blog_layout.html.erb
310
+ - app/views/layouts/phcpress/newspost/news_layout.html.erb
311
+ - app/views/layouts/phcpress/website/page_layout.erb
290
312
  - app/views/phcpress/blog/posts/_form.html.erb
291
313
  - app/views/phcpress/blog/posts/edit.html.erb
292
314
  - app/views/phcpress/blog/posts/index.html.erb
@@ -295,8 +317,6 @@ files:
295
317
  - app/views/phcpress/news/posts/edit.html.erb
296
318
  - app/views/phcpress/news/posts/index.html.erb
297
319
  - app/views/phcpress/news/posts/new.html.erb
298
- - app/views/phcpress/website/pages/blogpage.html.erb
299
- - app/views/phcpress/website/pages/newspage.html.erb
300
320
  - config/routes.rb
301
321
  - db/migrate/20160219213259_create_phcpress_news_posts.rb
302
322
  - db/migrate/20160219213313_create_phcpress_blog_posts.rb
@@ -329,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
349
  version: '0'
330
350
  requirements: []
331
351
  rubyforge_project:
332
- rubygems_version: 2.4.3
352
+ rubygems_version: 2.5.1
333
353
  signing_key:
334
354
  specification_version: 4
335
355
  summary: News & Blog Posts Engine for Ruby on Rails
@@ -1,20 +0,0 @@
1
- require_dependency "phcpress/application_controller"
2
-
3
- module Phcpress
4
- class Website::PagesController < ApplicationController
5
-
6
- # Resolve Layout for Web Pages
7
- layout :layouts_resolver_webpages
8
-
9
- # Retrieve News Posts for News Page
10
- def newspage
11
- @news_posts = News::Post.all
12
- end
13
-
14
- # Retrieve Blog Posts for Blog Page
15
- def blogpage
16
- @blog_posts = Blog::Post.all
17
- end
18
-
19
- end
20
- end
@@ -1,4 +0,0 @@
1
- module Phcpress
2
- module Website::PagesHelper
3
- end
4
- end
@@ -1,25 +0,0 @@
1
- <% @blog_posts.each do |blog_post| %>
2
- <div class="row">
3
- <div class="col-lg-12">
4
- <article>
5
- <!-- Title -->
6
- <h1><%= blog_post.blogpsttitle %></h1>
7
-
8
- <!-- Author (Next Release)
9
- <p class="lead">
10
- by <a href="#">Authour</a>
11
- </p>
12
- -->
13
-
14
- <!-- Date -->
15
- <hr>
16
- <p>
17
- <span class="fa fa-calendar"></span> Posted on <%= blog_post.created_at %>
18
- </p>
19
- <hr>
20
- <p class="lead"><%= blog_post.blogpstexcerpts %></p>
21
- <p><%= blog_post.blogpsttext %></p>
22
- </article>
23
- </div>
24
- </div>
25
- <% end %>
@@ -1,25 +0,0 @@
1
- <% @news_posts.each do |news_post| %>
2
- <div class="row">
3
- <div class="col-lg-12">
4
- <article>
5
- <!-- Title -->
6
- <h1><%= news_post.newspsttitle %></h1>
7
-
8
- <!-- Author (Next Release)
9
- <p class="lead">
10
- by <a href="#">Authour</a>
11
- </p>
12
- -->
13
-
14
- <!-- Date -->
15
- <hr>
16
- <p>
17
- <span class="fa fa-calendar"></span> Posted on <%= news_post.created_at %>
18
- </p>
19
- <hr>
20
- <p class="lead"><%= news_post.newspstexcerpts %></p>
21
- <p><%= news_post.newspsttext %></p>
22
- </article>
23
- </div>
24
- </div>
25
- <% end %>