comfy_blog 1.12.1 → 1.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +20 -5
- data/Gemfile +1 -1
- data/README.md +4 -4
- data/app/controllers/comfy/admin/blog/blogs_controller.rb +7 -7
- data/app/controllers/comfy/admin/blog/comments_controller.rb +7 -7
- data/app/controllers/comfy/admin/blog/posts_controller.rb +3 -3
- data/app/views/comfy/admin/blog/blogs/index.html.haml +5 -5
- data/app/views/comfy/admin/blog/comments/index.html.haml +5 -5
- data/app/views/comfy/admin/blog/posts/index.html.haml +6 -6
- data/app/views/comfy/blog/posts/index.html.haml +3 -3
- data/lib/comfy_blog/version.rb +1 -1
- data/test/controllers/comfy/admin/blog/blogs_controller_test.rb +12 -12
- data/test/gemfiles/Gemfile.rails.4.0 +10 -0
- data/test/gemfiles/Gemfile.rails.4.1 +10 -0
- data/test/gemfiles/Gemfile.rails.4.2 +10 -0
- data/test/gemfiles/Gemfile.rails.master +10 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74cd97579b4570e8cac85c457007e8eb2db33031
|
4
|
+
data.tar.gz: f5bcdabd960071e1be2a3191ef51033b460483d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5db4dde5c35dc687d4e496ccf5febd576ffe14ea20aefd93ee51f0311f366db10b61c241e1deb858ac0cdabe23c0b66c79e0447dd941a4b2f600da10011a93
|
7
|
+
data.tar.gz: 5669fe544894ed906cad147e0ca8b3e031c01718691656d959cf453f6bdab91909e566df951e18f30e83e308b766f758962dd0a2867f8bc857c4e03268e8205c
|
data/.travis.yml
CHANGED
@@ -1,11 +1,26 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
|
-
-
|
4
|
-
- 2.0.0
|
2
|
+
before_install:
|
3
|
+
- gem install bundler
|
5
4
|
before_script:
|
6
|
-
-
|
5
|
+
- rake db:migrate
|
7
6
|
script:
|
8
7
|
- rake test:all
|
8
|
+
rvm:
|
9
|
+
- 1.9.3
|
10
|
+
- 2.0.0
|
11
|
+
- 2.1.5
|
12
|
+
- 2.2.0
|
13
|
+
gemfile:
|
14
|
+
- test/gemfiles/Gemfile.rails.4.0
|
15
|
+
- test/gemfiles/Gemfile.rails.4.1
|
16
|
+
- test/gemfiles/Gemfile.rails.4.2
|
9
17
|
branches:
|
10
18
|
only:
|
11
|
-
- master
|
19
|
+
- master
|
20
|
+
matrix:
|
21
|
+
fast_finish: true
|
22
|
+
include:
|
23
|
+
- rvm: 2.2.0
|
24
|
+
gemfile: test/gemfiles/Gemfile.rails.master
|
25
|
+
allow_failures:
|
26
|
+
- gemfile: test/gemfiles/Gemfile.rails.master
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# ComfyBlog
|
2
|
-
[![Gem Version](https://
|
1
|
+
# ComfyBlog
|
2
|
+
[![Gem Version](https://img.shields.io/gem/v/comfy_blog.svg?style=flat)](http://rubygems.org/gems/comfy_blog) [![Gem Downloads](https://img.shields.io/gem/dt/comfy_blog.svg?style=flat)](http://rubygems.org/gems/comfy_blog) [![Build Status](https://img.shields.io/travis/comfy/comfy-blog.svg?style=flat)](https://travis-ci.org/comfy/comfy-blog) [![Dependency Status](https://img.shields.io/gemnasium/comfy/comfy-blog.svg?style=flat)](https://gemnasium.com/comfy/comfy-blog) [![Code Climate](https://img.shields.io/codeclimate/github/comfy/comfy-blog.svg?style=flat)](https://codeclimate.com/github/comfy/comfy-blog) [![Coverage Status](https://img.shields.io/coveralls/comfy/comfy-blog.svg?style=flat)](https://coveralls.io/r/comfy/comfy-blog?branch=master)
|
3
3
|
|
4
4
|
ComfyBlog is an simple blog management engine for [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa)
|
5
5
|
|
@@ -17,11 +17,11 @@ gem 'comfy_blog', '~> 1.12.0'
|
|
17
17
|
```
|
18
18
|
|
19
19
|
Then from the Rails project's root run:
|
20
|
-
|
20
|
+
|
21
21
|
bundle install
|
22
22
|
rails generate comfy:blog
|
23
23
|
rake db:migrate
|
24
|
-
|
24
|
+
|
25
25
|
Take a look inside your `config/routes.rb` file and you should see following lines there:
|
26
26
|
|
27
27
|
```ruby
|
@@ -1,16 +1,16 @@
|
|
1
1
|
class Comfy::Admin::Blog::BlogsController < Comfy::Admin::Blog::BaseController
|
2
|
-
|
2
|
+
|
3
3
|
before_action :build_blog, :only => [:new, :create]
|
4
4
|
before_action :load_blog, :only => [:edit, :update, :destroy]
|
5
|
-
|
5
|
+
|
6
6
|
def index
|
7
|
-
@blogs = @site.blogs
|
7
|
+
@blogs = comfy_paginate(@site.blogs)
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def new
|
11
11
|
render
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def edit
|
15
15
|
render
|
16
16
|
end
|
@@ -40,11 +40,11 @@ class Comfy::Admin::Blog::BlogsController < Comfy::Admin::Blog::BaseController
|
|
40
40
|
end
|
41
41
|
|
42
42
|
protected
|
43
|
-
|
43
|
+
|
44
44
|
def build_blog
|
45
45
|
@blog = @site.blogs.new(blog_params)
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
def blog_params
|
49
49
|
params.fetch(:blog, {}).permit!
|
50
50
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class Comfy::Admin::Blog::CommentsController < Comfy::Admin::Blog::BaseController
|
2
|
-
|
2
|
+
|
3
3
|
before_action :load_blog
|
4
4
|
before_action :load_comment, :only => [:destroy, :toggle_publish]
|
5
|
-
|
5
|
+
|
6
6
|
def index
|
7
7
|
@comments = if @post = @blog.posts.where(:id => params[:post_id]).first
|
8
|
-
@post.comments
|
8
|
+
comfy_paginate(@post.comments)
|
9
9
|
else
|
10
|
-
@blog.comments
|
10
|
+
comfy_paginate(@blog.comments)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -16,18 +16,18 @@ class Comfy::Admin::Blog::CommentsController < Comfy::Admin::Blog::BaseControlle
|
|
16
16
|
flash[:success] = 'Comment deleted'
|
17
17
|
redirect_to :action => :index
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def toggle_publish
|
21
21
|
@comment.update_attribute(:is_published, !@comment.is_published?)
|
22
22
|
end
|
23
23
|
|
24
24
|
protected
|
25
|
-
|
25
|
+
|
26
26
|
def load_comment
|
27
27
|
@comment = @blog.comments.find(params[:id])
|
28
28
|
rescue ActiveRecord::RecordNotFound
|
29
29
|
flash[:error] = 'Comment not found'
|
30
30
|
redirect_to :action => :index
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
class Comfy::Admin::Blog::PostsController < Comfy::Admin::Blog::BaseController
|
2
|
-
|
2
|
+
|
3
3
|
before_action :load_blog
|
4
4
|
before_action :build_post, :only => [:new, :create]
|
5
5
|
before_action :load_post, :only => [:edit, :update, :destroy]
|
6
6
|
|
7
7
|
def index
|
8
|
-
@posts = @blog.posts.order(:published_at)
|
8
|
+
@posts = comfy_paginate(@blog.posts.order(:published_at))
|
9
9
|
end
|
10
10
|
|
11
11
|
def new
|
@@ -56,7 +56,7 @@ protected
|
|
56
56
|
@post = @blog.posts.new(post_params)
|
57
57
|
@post.published_at ||= Time.zone.now
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
def post_params
|
61
61
|
params.fetch(:post, {}).permit!
|
62
62
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
.page-header
|
2
2
|
= link_to 'New Blog', new_comfy_admin_blog_path(@site), :class => 'btn btn-default pull-right'
|
3
3
|
%h2 Blogs
|
4
|
-
|
5
|
-
=
|
6
|
-
|
4
|
+
|
5
|
+
= comfy_paginate @blogs
|
6
|
+
|
7
7
|
%table.table.table-hover.table-bordered
|
8
8
|
- @blogs.each do |blog|
|
9
9
|
%tr
|
@@ -22,5 +22,5 @@
|
|
22
22
|
.btn-group.btn-group-sm
|
23
23
|
= link_to 'Edit', edit_comfy_admin_blog_path(@site, blog), :class => 'btn btn-default'
|
24
24
|
= link_to 'Delete', comfy_admin_blog_path(@site, blog), :method => :delete, :data => {:confirm => 'Are you sure?'}, :class => 'btn btn-danger'
|
25
|
-
|
26
|
-
=
|
25
|
+
|
26
|
+
= comfy_paginate @blogs
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.page-header
|
2
2
|
%h2 Blog Comments
|
3
|
-
|
4
|
-
=
|
3
|
+
|
4
|
+
= comfy_paginate @comments
|
5
5
|
|
6
6
|
%table.table.table-hover
|
7
7
|
%tr
|
@@ -10,8 +10,8 @@
|
|
10
10
|
%th Posted
|
11
11
|
%th Status
|
12
12
|
%th
|
13
|
-
|
13
|
+
|
14
14
|
- @comments.each do |comment|
|
15
15
|
= render :partial => 'comment', :object => comment
|
16
|
-
|
17
|
-
=
|
16
|
+
|
17
|
+
= comfy_paginate @comments
|
@@ -1,9 +1,9 @@
|
|
1
1
|
.page-header
|
2
2
|
= link_to 'New Blog Post', new_comfy_admin_blog_post_path(@site, @blog), :class => 'btn btn-default pull-right'
|
3
3
|
%h2 Blog Posts
|
4
|
-
|
5
|
-
=
|
6
|
-
|
4
|
+
|
5
|
+
= comfy_paginate @posts
|
6
|
+
|
7
7
|
%table.table.table-hover
|
8
8
|
%tr
|
9
9
|
%th.main Title
|
@@ -11,7 +11,7 @@
|
|
11
11
|
%th Published
|
12
12
|
%th Comments
|
13
13
|
%th
|
14
|
-
|
14
|
+
|
15
15
|
- @posts.each do |post|
|
16
16
|
%tr
|
17
17
|
%td.main
|
@@ -28,5 +28,5 @@
|
|
28
28
|
.btn-group.btn-group-sm
|
29
29
|
= link_to 'Edit', edit_comfy_admin_blog_post_path(@site, @blog, post), :class => 'btn btn-default'
|
30
30
|
= link_to 'Delete', comfy_admin_blog_post_path(@site, @blog, post), :method => :delete, :data => {:confirm => 'Are you sure?'}, :class => 'btn btn-danger'
|
31
|
-
|
32
|
-
=
|
31
|
+
|
32
|
+
= comfy_paginate @posts
|
@@ -1,7 +1,7 @@
|
|
1
1
|
%h1 Blog Posts
|
2
2
|
|
3
3
|
- @posts.each do |post|
|
4
|
-
|
4
|
+
|
5
5
|
%h1= link_to post.title, comfy_blog_post_path(@cms_site.path, @blog.path, post.slug)
|
6
6
|
.author
|
7
7
|
= post.author
|
@@ -9,5 +9,5 @@
|
|
9
9
|
= post.published_at.to_s(:db)
|
10
10
|
.content
|
11
11
|
= post.content.html_safe
|
12
|
-
|
13
|
-
=
|
12
|
+
|
13
|
+
= comfy_paginate @posts
|
data/lib/comfy_blog/version.rb
CHANGED
@@ -1,42 +1,42 @@
|
|
1
1
|
require_relative '../../../../test_helper'
|
2
2
|
|
3
3
|
class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
|
4
|
-
|
4
|
+
|
5
5
|
def setup
|
6
6
|
@site = comfy_cms_sites(:default)
|
7
7
|
@blog = comfy_blog_blogs(:default)
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def test_get_index
|
11
11
|
get :index, :site_id => @site
|
12
12
|
assert_response :success
|
13
13
|
assert assigns(:blogs)
|
14
14
|
assert_template :index
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def test_get_new
|
18
18
|
get :new, :site_id => @site
|
19
19
|
assert_response :success
|
20
20
|
assert assigns(:blog)
|
21
21
|
assert_template :new
|
22
|
-
assert_select "form[action
|
22
|
+
assert_select "form[action='/admin/sites/#{@site.id}/blogs']"
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def test_get_edit
|
26
26
|
get :edit, :site_id => @site, :id => @blog
|
27
27
|
assert_response :success
|
28
28
|
assert assigns(:blog)
|
29
29
|
assert_template :edit
|
30
|
-
assert_select "form[action
|
30
|
+
assert_select "form[action='/admin/sites/#{@site.id}/blogs/#{@blog.id}']"
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def test_get_edit_failure
|
34
34
|
get :edit, :site_id => @site, :id => 'invalid'
|
35
35
|
assert_response :redirect
|
36
36
|
assert_redirected_to :action => :index
|
37
37
|
assert_equal 'Blog not found', flash[:error]
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
def test_creation
|
41
41
|
assert_difference 'Comfy::Blog::Blog.count' do
|
42
42
|
post :create, :site_id => @site, :blog => {
|
@@ -51,7 +51,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
|
|
51
51
|
assert_equal 'Blog created', flash[:success]
|
52
52
|
end
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
def test_creation_failure
|
56
56
|
assert_no_difference 'Comfy::Blog::Blog.count' do
|
57
57
|
post :create, :site_id => @site, :blog => { }
|
@@ -60,7 +60,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
|
|
60
60
|
assert_equal 'Failed to create Blog', flash[:error]
|
61
61
|
end
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def test_update
|
65
65
|
put :update, :site_id => @site, :id => @blog, blog: {
|
66
66
|
:label => 'Updated'
|
@@ -71,7 +71,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
|
|
71
71
|
@blog.reload
|
72
72
|
assert_equal 'Updated', @blog.label
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def test_update_failure
|
76
76
|
put :update, :site_id => @site, :id => @blog, :blog => {
|
77
77
|
:label => ''
|
@@ -82,7 +82,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
|
|
82
82
|
@blog.reload
|
83
83
|
refute_equal '', @blog.label
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
def test_destroy
|
87
87
|
assert_difference 'Comfy::Blog::Blog.count', -1 do
|
88
88
|
delete :destroy, :site_id => @site, :id => @blog
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfy_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Khabarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: comfortable_mexican_sofa
|
@@ -97,6 +97,10 @@ files:
|
|
97
97
|
- test/fixtures/comfy/blog/posts.yml
|
98
98
|
- test/fixtures/comfy/cms/sites.yml
|
99
99
|
- test/fixtures/generators/blog/routes.rb
|
100
|
+
- test/gemfiles/Gemfile.rails.4.0
|
101
|
+
- test/gemfiles/Gemfile.rails.4.1
|
102
|
+
- test/gemfiles/Gemfile.rails.4.2
|
103
|
+
- test/gemfiles/Gemfile.rails.master
|
100
104
|
- test/generators/blog_generator_test.rb
|
101
105
|
- test/lib/configuration_test.rb
|
102
106
|
- test/models/blog_test.rb
|
@@ -123,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
127
|
version: '0'
|
124
128
|
requirements: []
|
125
129
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.4.5
|
127
131
|
signing_key:
|
128
132
|
specification_version: 4
|
129
133
|
summary: Simple Blog Engine for ComfortableMexicanSofa
|