refinerycms-blog 2.0.5 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -1
  3. data/.travis.yml +3 -9
  4. data/Gemfile +10 -11
  5. data/app/assets/images/refinery/blog/icons/add.png +0 -0
  6. data/app/assets/stylesheets/refinery/blog/backend.css.scss +25 -25
  7. data/app/assets/stylesheets/refinery/blog/frontend.css.scss +87 -76
  8. data/app/controllers/refinery/blog/admin/comments_controller.rb +19 -19
  9. data/app/controllers/refinery/blog/admin/posts_controller.rb +9 -4
  10. data/app/controllers/refinery/blog/categories_controller.rb +1 -1
  11. data/app/controllers/refinery/blog/posts_controller.rb +12 -11
  12. data/app/helpers/refinery/blog/controller_helper.rb +7 -7
  13. data/app/helpers/refinery/blog/posts_helper.rb +5 -0
  14. data/app/models/refinery/blog/categorization.rb +12 -0
  15. data/app/models/refinery/blog/category.rb +14 -4
  16. data/app/models/refinery/blog/comment.rb +0 -9
  17. data/app/models/refinery/blog/post.rb +55 -13
  18. data/app/views/refinery/blog/admin/_submenu.html.erb +1 -4
  19. data/app/views/refinery/blog/admin/categories/_category.html.erb +11 -3
  20. data/app/views/refinery/blog/admin/categories/_form.html.erb +10 -11
  21. data/app/views/refinery/blog/admin/categories/_sortable_list.html.erb +2 -4
  22. data/app/views/refinery/blog/admin/categories/edit.html.erb +1 -1
  23. data/app/views/refinery/blog/admin/categories/index.html.erb +9 -15
  24. data/app/views/refinery/blog/admin/categories/new.html.erb +1 -1
  25. data/app/views/refinery/blog/admin/comments/_comment.html.erb +4 -2
  26. data/app/views/refinery/blog/admin/comments/_sortable_list.html.erb +2 -4
  27. data/app/views/refinery/blog/admin/comments/index.html.erb +14 -23
  28. data/app/views/refinery/blog/admin/comments/show.html.erb +6 -4
  29. data/app/views/refinery/blog/admin/posts/_form.html.erb +18 -26
  30. data/app/views/refinery/blog/admin/posts/_post.html.erb +14 -1
  31. data/app/views/refinery/blog/admin/posts/_sortable_list.html.erb +2 -4
  32. data/app/views/refinery/blog/admin/posts/edit.html.erb +1 -1
  33. data/app/views/refinery/blog/admin/posts/index.html.erb +9 -15
  34. data/app/views/refinery/blog/admin/posts/new.html.erb +1 -1
  35. data/app/views/refinery/blog/admin/posts/uncategorized.html.erb +2 -2
  36. data/app/views/refinery/blog/admin/settings/notification_recipients.html.erb +5 -7
  37. data/app/views/refinery/blog/categories/show.html.erb +2 -2
  38. data/app/views/refinery/blog/comment_mailer/notification.html.erb +5 -0
  39. data/app/views/refinery/blog/posts/_comment.html.erb +1 -1
  40. data/app/views/refinery/blog/posts/_comments.html.erb +28 -31
  41. data/app/views/refinery/blog/posts/_post.html.erb +3 -3
  42. data/app/views/refinery/blog/posts/archive.html.erb +6 -5
  43. data/app/views/refinery/blog/posts/index.html.erb +3 -3
  44. data/app/views/refinery/blog/posts/show.html.erb +4 -6
  45. data/app/views/refinery/blog/posts/tagged.html.erb +4 -4
  46. data/app/views/refinery/blog/shared/_body_content_right.html.erb +6 -6
  47. data/app/views/refinery/blog/shared/_post.html.erb +11 -13
  48. data/app/views/refinery/blog/shared/_rss_feed.html.erb +2 -0
  49. data/config/initializers/url_validator.rb +15 -11
  50. data/config/locales/bg.yml +2 -4
  51. data/config/locales/cs.yml +6 -8
  52. data/config/locales/de.yml +27 -8
  53. data/config/locales/en.yml +9 -6
  54. data/config/locales/es.yml +2 -4
  55. data/config/locales/fr.yml +23 -7
  56. data/config/locales/it.yml +2 -4
  57. data/config/locales/ja.yml +16 -5
  58. data/config/locales/nb.yml +0 -2
  59. data/config/locales/nl.yml +21 -7
  60. data/config/locales/pl.yml +3 -5
  61. data/config/locales/pt-BR.yml +38 -7
  62. data/config/locales/ru.yml +35 -2
  63. data/config/locales/sk.yml +4 -6
  64. data/config/locales/sv.yml +2 -4
  65. data/config/locales/zh-CN.yml +2 -4
  66. data/config/routes.rb +3 -3
  67. data/db/migrate/20110803223522_create_blog_structure.rb +15 -14
  68. data/db/migrate/20110803223523_add_user_id_to_blog_posts.rb +2 -2
  69. data/db/migrate/20110803223526_add_cached_slugs.rb +2 -2
  70. data/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb +1 -1
  71. data/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb +1 -1
  72. data/db/migrate/20110803223529_add_primary_key_to_categorizations.rb +4 -4
  73. data/db/migrate/20120530102901_create_blog_translations.rb +17 -0
  74. data/db/migrate/20120531113632_delete_cached_slugs.rb +6 -0
  75. data/db/migrate/20120601151114_create_category_translations.rb +14 -0
  76. data/db/seeds.rb +2 -2
  77. data/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb +3 -0
  78. data/lib/refinery/blog.rb +1 -0
  79. data/lib/refinery/blog/configuration.rb +23 -0
  80. data/readme.md +3 -3
  81. data/refinerycms-blog.gemspec +8 -14
  82. data/spec/controllers/refinery/blog/admin/comments_controller_spec.rb +84 -0
  83. data/spec/controllers/refinery/blog/posts_controller_spec.rb +0 -2
  84. data/spec/factories/blog_posts.rb +2 -2
  85. data/spec/features/refinery/blog/admin/categories_spec.rb +119 -0
  86. data/spec/{requests → features}/refinery/blog/admin/comments_spec.rb +9 -9
  87. data/spec/{requests → features}/refinery/blog/admin/menu_spec.rb +2 -2
  88. data/spec/features/refinery/blog/admin/posts_spec.rb +338 -0
  89. data/spec/features/refinery/blog/categories_spec.rb +28 -0
  90. data/spec/{requests → features}/refinery/blog/posts_spec.rb +62 -42
  91. data/spec/helpers/refinery/blog/controller_helper_spec.rb +27 -0
  92. data/spec/helpers/refinery/blog/posts_helper_spec.rb +12 -0
  93. data/spec/models/refinery/blog/category_spec.rb +10 -2
  94. data/spec/models/refinery/blog/post_spec.rb +21 -17
  95. data/spec/spec_helper.rb +20 -46
  96. metadata +41 -38
  97. data/Guardfile +0 -20
  98. data/app/assets/images/refinerycms-blog/.gitkeep +0 -0
  99. data/app/assets/javascripts/refinerycms-blog/.gitkeep +0 -0
  100. data/app/assets/stylesheets/refinerycms-blog/.gitkeep +0 -0
  101. data/app/models/refinery/categorization.rb +0 -10
  102. data/app/views/refinery/blog/admin/comments/approve.html.erb +0 -0
  103. data/lib/refinery/blog/version.rb +0 -17
  104. data/spec/requests/refinery/blog/admin/categories_spec.rb +0 -20
  105. data/spec/requests/refinery/blog/admin/posts_spec.rb +0 -175
  106. data/spec/requests/refinery/blog/categories_spec.rb +0 -24
data/Guardfile DELETED
@@ -1,20 +0,0 @@
1
- guard 'rspec', :version => 2, :cli => "--format Fuubar --color --drb" do
2
- watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
5
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/controllers/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
6
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
7
- watch('spec/spec_helper.rb') { "spec" }
8
- watch('config/routes.rb') { "spec/routing" }
9
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
10
- # Capybara request specs
11
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
12
- end
13
-
14
- guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
15
- watch('config/application.rb')
16
- watch('config/environment.rb')
17
- watch(%r{^config/environments/.+\.rb$})
18
- watch(%r{^config/initializers/.+\.rb$})
19
- watch('spec/spec_helper.rb')
20
- end
@@ -1,10 +0,0 @@
1
- module Refinery
2
- class Categorization < ActiveRecord::Base
3
-
4
- self.table_name = 'refinery_blog_categories_blog_posts'
5
- belongs_to :blog_post, :class_name => 'Refinery::Blog::Post', :foreign_key => :blog_post_id
6
- belongs_to :blog_category, :class_name => 'Refinery::Blog::Category', :foreign_key => :blog_category_id
7
-
8
- attr_accessible :blog_category_id, :blog_post_id
9
- end
10
- end
@@ -1,17 +0,0 @@
1
- module Refinery
2
- module Blog
3
- class Version
4
- @major = 2
5
- @minor = 0
6
- @tiny = 5
7
-
8
- class << self
9
- attr_reader :major, :minor, :tiny
10
-
11
- def to_s
12
- [@major, @minor, @tiny].compact.join('.')
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,20 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Categories admin" do
4
- login_refinery_user
5
-
6
- let(:title) { "lol" }
7
-
8
- it "can create categories" do
9
- visit refinery.admin_root_path
10
-
11
- within("nav#menu") { click_link "Blog" }
12
- within("nav.multilist") { click_link "Create new category" }
13
-
14
- fill_in "Title", :with => title
15
- click_button "Save"
16
-
17
- category = Refinery::Blog::Category.first
18
- category.title.should eq(title)
19
- end
20
- end
@@ -1,175 +0,0 @@
1
- require "spec_helper"
2
-
3
- module Refinery
4
- module Blog
5
- module Admin
6
- describe Post do
7
- login_refinery_user
8
-
9
- let!(:blog_category) { FactoryGirl.create(:blog_category, :title => "Video Games") }
10
-
11
- context "when no blog posts" do
12
- before(:each) { subject.class.destroy_all }
13
-
14
- describe "blog post listing" do
15
- before(:each) { visit refinery.blog_admin_posts_path }
16
-
17
- it "invites to create new post" do
18
- page.should have_content("There are no Blog Posts yet. Click \"Create new post\" to add your first blog post.")
19
- end
20
- end
21
-
22
- describe "new blog post form" do
23
- before(:each) do
24
- visit refinery.blog_admin_posts_path
25
- click_link "Create new post"
26
- end
27
-
28
- it "should have Tags" do
29
- page.should have_content("Tags")
30
- end
31
-
32
- it "should have Video Games" do
33
- page.should have_content(blog_category.title)
34
- end
35
-
36
- describe "create blog post" do
37
- before(:each) do
38
- fill_in "Title", :with => "This is my blog post"
39
- fill_in "post_body", :with => "And I love it"
40
- check blog_category.title
41
- click_button "Save"
42
- end
43
-
44
- it "should succeed" do
45
- page.should have_content("was successfully added.")
46
- end
47
-
48
- it "should be the only blog post" do
49
- subject.class.all.size.should eq(1)
50
- end
51
-
52
- it "should belong to me" do
53
- subject.class.first.author.should eq(::Refinery::User.last)
54
- end
55
-
56
- it "should save categories" do
57
- subject.class.last.categories.count.should eq(1)
58
- subject.class.last.categories.first.title.should eq(blog_category.title)
59
- end
60
- end
61
-
62
- describe "create blog post with tags" do
63
- before(:each) do
64
- @tag_list = "chicago, bikes, beers, babes"
65
- fill_in "Title", :with => "This is a tagged blog post"
66
- fill_in "post_body", :with => "And I also love it"
67
- fill_in "Tags", :with => @tag_list
68
- click_button "Save"
69
- end
70
-
71
- it "should succeed" do
72
- page.should have_content("was successfully added.")
73
- end
74
-
75
- it "should be the only blog post" do
76
- subject.class.all.size.should eq(1)
77
- end
78
-
79
- it "should have the specified tags" do
80
- subject.class.last.tag_list.sort.should eq(@tag_list.split(', ').sort)
81
- end
82
- end
83
- end
84
- end
85
-
86
- context "when has blog posts" do
87
- let!(:blog_post) { FactoryGirl.create(:blog_post) }
88
-
89
- describe "blog post listing" do
90
- before(:each) { visit refinery.blog_admin_posts_path }
91
-
92
- describe "edit blog post" do
93
- it "should succeed" do
94
- page.should have_content(blog_post.title)
95
-
96
- click_link("Edit this blog post")
97
- current_path.should == refinery.edit_blog_admin_post_path(blog_post)
98
-
99
- fill_in "Title", :with => "hax0r"
100
- click_button "Save"
101
-
102
- page.should_not have_content(blog_post.title)
103
- page.should have_content("'hax0r' was successfully updated.")
104
- end
105
- end
106
-
107
- describe "deleting blog post" do
108
- it "should succeed" do
109
- page.should have_content(blog_post.title)
110
-
111
- click_link "Remove this blog post forever"
112
-
113
- page.should have_content("'#{blog_post.title}' was successfully removed.")
114
- end
115
- end
116
-
117
- describe "view live" do
118
- it "redirects to blog post in the frontend" do
119
- click_link "View this blog post live"
120
-
121
- current_path.should == refinery.blog_post_path(blog_post)
122
- page.should have_content(blog_post.title)
123
- end
124
- end
125
- end
126
-
127
- context "when uncategorized post" do
128
- it "shows up in the list" do
129
- visit refinery.uncategorized_blog_admin_posts_path
130
- page.should have_content(blog_post.title)
131
- end
132
- end
133
-
134
- context "when categorized post" do
135
- it "won't show up in the list" do
136
- blog_post.categories << blog_category
137
- blog_post.save!
138
-
139
- visit refinery.uncategorized_blog_admin_posts_path
140
- page.should_not have_content(blog_post.title)
141
- end
142
- end
143
- end
144
-
145
- context "with multiple users" do
146
- let!(:other_guy) { Factory(:refinery_user, :username => "Other Guy") }
147
-
148
- describe "create blog post with alternate author" do
149
- before(:each) do
150
- visit refinery.blog_admin_posts_path
151
- click_link "Create new post"
152
-
153
- fill_in "Title", :with => "This is some other guy's blog post"
154
- fill_in "post_body", :with => "I totally didn't write it."
155
-
156
- click_link "Advanced Options"
157
-
158
- select other_guy.username, :from => "Author"
159
-
160
- click_button "Save"
161
- end
162
-
163
- it "should succeed" do
164
- page.should have_content("was successfully added.")
165
- end
166
-
167
- it "belongs to another user" do
168
- subject.class.last.author.should eq(other_guy)
169
- end
170
- end
171
- end
172
- end
173
- end
174
- end
175
- end
@@ -1,24 +0,0 @@
1
- require "spec_helper"
2
-
3
- module Refinery
4
- describe "BlogCategories" do
5
- login_refinery_user
6
-
7
- context "has one category and post" do
8
- before(:each) do
9
- @post = FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post")
10
- @category = FactoryGirl.create(:blog_category, :title => "Video Games")
11
- @post.categories << @category
12
- @post.save!
13
- end
14
-
15
- describe "show categories blog posts" do
16
- before(:each) { visit refinery.blog_category_path(@category) }
17
- it "should displays categories blog posts" do
18
- page.should have_content("Refinery CMS blog post")
19
- page.should have_content("Video Games")
20
- end
21
- end
22
- end
23
- end
24
- end