refinerycms-blog 1.6.2 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/Gemfile +7 -0
  2. data/Gemfile.lock +293 -0
  3. data/app/controllers/admin/blog/categories_controller.rb +8 -4
  4. data/app/controllers/admin/blog/comments_controller.rb +34 -30
  5. data/app/controllers/admin/blog/posts_controller.rb +81 -70
  6. data/app/controllers/admin/blog/settings_controller.rb +46 -32
  7. data/app/controllers/blog/categories_controller.rb +11 -9
  8. data/app/controllers/blog/posts_controller.rb +84 -76
  9. data/app/helpers/blog_posts_helper.rb +8 -4
  10. data/app/mailers/blog/comment_mailer.rb +11 -9
  11. data/app/models/blog_category.rb +1 -1
  12. data/app/models/blog_post.rb +15 -4
  13. data/app/views/admin/blog/_submenu.html.erb +4 -0
  14. data/app/views/admin/blog/categories/_category.html.erb +1 -1
  15. data/app/views/admin/blog/categories/_form.html.erb +1 -1
  16. data/app/views/admin/blog/categories/index.html.erb +3 -3
  17. data/app/views/admin/blog/comments/index.html.erb +3 -3
  18. data/app/views/admin/blog/posts/_form.css.erb +7 -2
  19. data/app/views/admin/blog/posts/_form.html.erb +5 -5
  20. data/app/views/admin/blog/posts/_post.html.erb +5 -2
  21. data/app/views/admin/blog/posts/_teaser_part.html.erb +2 -2
  22. data/app/views/admin/blog/posts/index.html.erb +3 -3
  23. data/app/views/admin/blog/posts/uncategorized.html.erb +3 -3
  24. data/app/views/blog/comment_mailer/notification.html.erb +11 -11
  25. data/app/views/blog/posts/_comment.html.erb +2 -2
  26. data/app/views/blog/posts/_nav.html.erb +1 -1
  27. data/app/views/blog/posts/_post.html.erb +4 -3
  28. data/app/views/blog/posts/show.html.erb +1 -1
  29. data/app/views/blog/shared/_post.html.erb +11 -6
  30. data/changelog.md +17 -4
  31. data/config/locales/bg.yml +158 -0
  32. data/config/locales/en.yml +3 -1
  33. data/config/locales/es.yml +31 -0
  34. data/config/locales/it.yml +68 -17
  35. data/config/locales/ja.yml +159 -0
  36. data/config/locales/nl.yml +1 -0
  37. data/config/locales/sk.yml +8 -8
  38. data/config/routes.rb +3 -2
  39. data/db/migrate/8_add_primary_key_to_categorizations.rb +12 -0
  40. data/lib/refinery/blog/version.rb +3 -3
  41. data/lib/refinerycms-blog.rb +6 -16
  42. data/public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css +1 -8
  43. data/readme.md +3 -2
  44. data/refinerycms-blog.gemspec +8 -2
  45. data/spec/models/blog_post_spec.rb +25 -1
  46. data/todo.md +5 -0
  47. metadata +62 -96
data/config/routes.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  ::Refinery::Application.routes.draw do
2
2
  scope(:path => 'blog', :module => 'blog') do
3
3
  root :to => 'posts#index', :as => 'blog_root'
4
- match 'feed.rss', :to => 'posts#index.rss', :as => 'blog_rss_feed'
4
+ match 'feed.rss', :to => 'posts#index', :as => 'blog_rss_feed', :defaults => {:format => "rss"}
5
5
  match ':id', :to => 'posts#show', :as => 'blog_post'
6
6
  match 'categories/:id', :to => 'categories#show', :as => 'blog_category'
7
7
  match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments'
8
8
  get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_blog_posts'
9
- get 'tagged/:tag_id/:tag_name' => 'posts#tagged', :as => 'tagged_posts'
9
+ get 'tagged/:tag_id(/:tag_name)' => 'posts#tagged', :as => 'tagged_posts'
10
10
  end
11
11
 
12
12
  scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
@@ -39,6 +39,7 @@
39
39
 
40
40
  get :moderation
41
41
  get :comments
42
+ get :teasers
42
43
  end
43
44
  end
44
45
  end
@@ -0,0 +1,12 @@
1
+ class AddPrimaryKeyToCategorizations < ActiveRecord::Migration
2
+ def self.up
3
+ unless ::Categorization.column_names.include?("id")
4
+ add_column :blog_categories_blog_posts, :id, :primary_key
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ remove_column :blog_categories_blog_posts, :id
10
+ end
11
+ end
12
+
@@ -2,8 +2,8 @@ module Refinery
2
2
  module Blog
3
3
  class Version
4
4
  @major = 1
5
- @minor = 6
6
- @tiny = 2
5
+ @minor = 7
6
+ @tiny = 0
7
7
 
8
8
  class << self
9
9
  attr_reader :major, :minor, :tiny
@@ -14,4 +14,4 @@ module Refinery
14
14
  end
15
15
  end
16
16
  end
17
- end
17
+ end
@@ -6,6 +6,11 @@ module Refinery
6
6
  autoload :Tab, File.expand_path("../refinery/blog/tabs", __FILE__)
7
7
 
8
8
  class << self
9
+ attr_accessor :root
10
+ def root
11
+ @root ||= Pathname.new(File.expand_path('../../', __FILE__))
12
+ end
13
+
9
14
  def version
10
15
  ::Refinery::Blog::Version.to_s
11
16
  end
@@ -22,6 +27,7 @@ module Refinery
22
27
 
23
28
  config.after_initialize do
24
29
  Refinery::Plugin.register do |plugin|
30
+ plugin.pathname = root
25
31
  plugin.name = "refinerycms_blog"
26
32
  plugin.url = {:controller => '/admin/blog/posts', :action => 'index'}
27
33
  plugin.menu_match = /^\/?(admin|refinery)\/blog\/?(posts|comments|categories)?/
@@ -29,22 +35,6 @@ module Refinery
29
35
  :class => BlogPost
30
36
  }
31
37
  end
32
-
33
- # refinery 0.9.8 had a bug that we later found through using this engine.
34
- # the bug was that the plugin urls were not :controller => '/admin/whatever'
35
- if Refinery.version == '0.9.8'
36
- ::Refinery::Plugin.class_eval do
37
- alias_method :old_url, :url
38
-
39
- def url
40
- if (plugin_url = self.old_url).is_a?(Hash) and plugin_url[:controller] =~ %r{^admin}
41
- plugin_url[:controller] = "/#{plugin_url[:controller]}"
42
- end
43
-
44
- plugin_url
45
- end
46
- end
47
- end
48
38
  end
49
39
  end if defined?(Rails::Engine)
50
40
  end
@@ -56,13 +56,6 @@
56
56
 
57
57
  /* Interaction states
58
58
  ----------------------------------*/
59
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
60
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
61
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; }
62
- .ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
63
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
64
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
65
- .ui-widget :active { outline: none; }
66
59
 
67
60
  /* Interaction Cues
68
61
  ----------------------------------*/
@@ -274,7 +267,6 @@
274
267
  .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
275
268
  .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
276
269
  .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
277
- .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
278
270
  .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
279
271
  .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
280
272
  .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
@@ -335,3 +327,4 @@
335
327
  font-weight: normal;
336
328
  margin: -1px;
337
329
  }
330
+
data/readme.md CHANGED
@@ -12,12 +12,13 @@ Options:
12
12
  ## Requirements
13
13
 
14
14
  Refinery CMS version 1.0.0 or above.
15
+ Your Rails 3 application should not be called "blog"
15
16
 
16
17
  ## Install
17
18
 
18
19
  Open up your ``Gemfile`` and add at the bottom this line:
19
20
 
20
- gem 'refinerycms-blog', '~> 1.6.1'
21
+ gem 'refinerycms-blog', '~> 1.7.0'
21
22
 
22
23
  Now, run ``bundle install``
23
24
 
@@ -27,4 +28,4 @@ Next, to install the blog plugin run:
27
28
 
28
29
  Finally migrate your database and you're done.
29
30
 
30
- rake db:migrate
31
+ rake db:migrate
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{refinerycms-blog}
3
- s.version = %q{1.6.2}
3
+ s.version = %q{1.7.0}
4
4
  s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with RefineryCMS.}
5
- s.date = %q{2011-06-29}
5
+ s.date = %q{2011-12-05}
6
6
  s.summary = %q{Ruby on Rails blogging engine for RefineryCMS.}
7
7
  s.email = %q{info@refinerycms.com}
8
8
  s.homepage = %q{http://refinerycms.com/blog}
@@ -99,12 +99,14 @@ Gem::Specification.new do |s|
99
99
  changelog.md
100
100
  config
101
101
  config/locales
102
+ config/locales/bg.yml
102
103
  config/locales/cs.yml
103
104
  config/locales/de.yml
104
105
  config/locales/en.yml
105
106
  config/locales/es.yml
106
107
  config/locales/fr.yml
107
108
  config/locales/it.yml
109
+ config/locales/ja.yml
108
110
  config/locales/nb.yml
109
111
  config/locales/nl.yml
110
112
  config/locales/pl.yml
@@ -122,6 +124,7 @@ Gem::Specification.new do |s|
122
124
  db/migrate/5_add_cached_slugs.rb
123
125
  db/migrate/6_add_custom_url_field_to_blog_posts.rb
124
126
  db/migrate/7_add_custom_teaser_field_to_blog_posts.rb
127
+ db/migrate/8_add_primary_key_to_categorizations.rb
125
128
  db/seeds
126
129
  db/seeds/refinerycms_blog.rb
127
130
  features
@@ -138,6 +141,8 @@ Gem::Specification.new do |s|
138
141
  features/support/step_definitions/category_steps.rb
139
142
  features/support/step_definitions/tags_steps.rb
140
143
  features/tags.feature
144
+ Gemfile
145
+ Gemfile.lock
141
146
  lib
142
147
  lib/gemspec.rb
143
148
  lib/generators
@@ -197,6 +202,7 @@ Gem::Specification.new do |s|
197
202
  spec/models/blog_category_spec.rb
198
203
  spec/models/blog_comment_spec.rb
199
204
  spec/models/blog_post_spec.rb
205
+ todo.md
200
206
  )
201
207
 
202
208
  end
@@ -174,7 +174,7 @@ describe BlogPost do
174
174
  end
175
175
  end
176
176
 
177
- context "with RefinerySetting comments_allowed set to true" do
177
+ context "with RefinerySetting comments_allowed set to false" do
178
178
  before do
179
179
  RefinerySetting.set(:comments_allowed, { :scoping => 'blog', :value => false })
180
180
  end
@@ -190,4 +190,28 @@ describe BlogPost do
190
190
  Factory.create(:blog_post, :custom_teaser => 'This is some custom content').should be_valid
191
191
  end
192
192
  end
193
+
194
+ describe ".teasers_enabled?" do
195
+ context "with RefinerySetting teasers_enabled set to true" do
196
+ before do
197
+ RefinerySetting.set(:teasers_enabled, { :scoping => 'blog', :value => true })
198
+ end
199
+
200
+ it "should be true" do
201
+ BlogPost.teasers_enabled?.should be_true
202
+ end
203
+ end
204
+
205
+ context "with RefinerySetting teasers_enabled set to false" do
206
+ before do
207
+ RefinerySetting.set(:teasers_enabled, { :scoping => 'blog', :value => false })
208
+ end
209
+
210
+ it "should be false" do
211
+ BlogPost.teasers_enabled?.should be_false
212
+ end
213
+ end
214
+
215
+ end
216
+
193
217
  end
data/todo.md ADDED
@@ -0,0 +1,5 @@
1
+ ## Why not, let's get this list going, eh?
2
+
3
+ * Replace comments with disqus?
4
+ * Facebook/twitter login for comments?
5
+ * What else? Add your ideas...
metadata CHANGED
@@ -1,108 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-blog
3
- version: !ruby/object:Gem::Version
4
- hash: 11
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.7.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 6
9
- - 2
10
- version: 1.6.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Resolve Digital
14
9
  - Neoteric Design
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-06-29 00:00:00 +12:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2011-12-05 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: refinerycms-core
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70357228144960 !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
19
+ requirements:
28
20
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 17
31
- segments:
32
- - 1
33
- - 0
34
- - 3
21
+ - !ruby/object:Gem::Version
35
22
  version: 1.0.3
36
23
  type: :runtime
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: filters_spam
40
24
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70357228144960
26
+ - !ruby/object:Gem::Dependency
27
+ name: filters_spam
28
+ requirement: &70357228144480 !ruby/object:Gem::Requirement
42
29
  none: false
43
- requirements:
30
+ requirements:
44
31
  - - ~>
45
- - !ruby/object:Gem::Version
46
- hash: 15
47
- segments:
48
- - 0
49
- - 2
50
- version: "0.2"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.2'
51
34
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: acts-as-taggable-on
55
35
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *70357228144480
37
+ - !ruby/object:Gem::Dependency
38
+ name: acts-as-taggable-on
39
+ requirement: &70357228144100 !ruby/object:Gem::Requirement
57
40
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 3
62
- segments:
63
- - 0
64
- version: "0"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
65
45
  type: :runtime
66
- version_requirements: *id003
67
- - !ruby/object:Gem::Dependency
68
- name: seo_meta
69
46
  prerelease: false
70
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *70357228144100
48
+ - !ruby/object:Gem::Dependency
49
+ name: seo_meta
50
+ requirement: &70357228143560 !ruby/object:Gem::Requirement
71
51
  none: false
72
- requirements:
52
+ requirements:
73
53
  - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 19
76
- segments:
77
- - 1
78
- - 1
79
- - 0
54
+ - !ruby/object:Gem::Version
80
55
  version: 1.1.0
81
56
  type: :runtime
82
- version_requirements: *id004
83
- - !ruby/object:Gem::Dependency
84
- name: factory_girl
85
57
  prerelease: false
86
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *70357228143560
59
+ - !ruby/object:Gem::Dependency
60
+ name: factory_girl
61
+ requirement: &70357228143140 !ruby/object:Gem::Requirement
87
62
  none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- hash: 3
92
- segments:
93
- - 0
94
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
95
67
  type: :development
96
- version_requirements: *id005
97
- description: A really straightforward open source Ruby on Rails blog engine designed for integration with RefineryCMS.
68
+ prerelease: false
69
+ version_requirements: *70357228143140
70
+ description: A really straightforward open source Ruby on Rails blog engine designed
71
+ for integration with RefineryCMS.
98
72
  email: info@refinerycms.com
99
73
  executables: []
100
-
101
74
  extensions: []
102
-
103
75
  extra_rdoc_files: []
104
-
105
- files:
76
+ files:
106
77
  - app/controllers/admin/blog/categories_controller.rb
107
78
  - app/controllers/admin/blog/comments_controller.rb
108
79
  - app/controllers/admin/blog/posts_controller.rb
@@ -157,12 +128,14 @@ files:
157
128
  - app/views/blog/shared/_tags.html.erb
158
129
  - app/views/shared/admin/_autocomplete.html.erb
159
130
  - changelog.md
131
+ - config/locales/bg.yml
160
132
  - config/locales/cs.yml
161
133
  - config/locales/de.yml
162
134
  - config/locales/en.yml
163
135
  - config/locales/es.yml
164
136
  - config/locales/fr.yml
165
137
  - config/locales/it.yml
138
+ - config/locales/ja.yml
166
139
  - config/locales/nb.yml
167
140
  - config/locales/nl.yml
168
141
  - config/locales/pl.yml
@@ -178,6 +151,7 @@ files:
178
151
  - db/migrate/5_add_cached_slugs.rb
179
152
  - db/migrate/6_add_custom_url_field_to_blog_posts.rb
180
153
  - db/migrate/7_add_custom_teaser_field_to_blog_posts.rb
154
+ - db/migrate/8_add_primary_key_to_categorizations.rb
181
155
  - db/seeds/refinerycms_blog.rb
182
156
  - features/authors.feature
183
157
  - features/category.feature
@@ -189,6 +163,8 @@ files:
189
163
  - features/support/step_definitions/category_steps.rb
190
164
  - features/support/step_definitions/tags_steps.rb
191
165
  - features/tags.feature
166
+ - Gemfile
167
+ - Gemfile.lock
192
168
  - lib/gemspec.rb
193
169
  - lib/generators/refinerycms_blog_generator.rb
194
170
  - lib/refinery/blog/tabs.rb
@@ -232,39 +208,29 @@ files:
232
208
  - spec/models/blog_category_spec.rb
233
209
  - spec/models/blog_comment_spec.rb
234
210
  - spec/models/blog_post_spec.rb
235
- has_rdoc: true
211
+ - todo.md
236
212
  homepage: http://refinerycms.com/blog
237
213
  licenses: []
238
-
239
214
  post_install_message:
240
215
  rdoc_options: []
241
-
242
- require_paths:
216
+ require_paths:
243
217
  - lib
244
- required_ruby_version: !ruby/object:Gem::Requirement
218
+ required_ruby_version: !ruby/object:Gem::Requirement
245
219
  none: false
246
- requirements:
247
- - - ">="
248
- - !ruby/object:Gem::Version
249
- hash: 3
250
- segments:
251
- - 0
252
- version: "0"
253
- required_rubygems_version: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ! '>='
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ required_rubygems_version: !ruby/object:Gem::Requirement
254
225
  none: false
255
- requirements:
256
- - - ">="
257
- - !ruby/object:Gem::Version
258
- hash: 3
259
- segments:
260
- - 0
261
- version: "0"
226
+ requirements:
227
+ - - ! '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
262
230
  requirements: []
263
-
264
231
  rubyforge_project:
265
- rubygems_version: 1.6.2
232
+ rubygems_version: 1.8.10
266
233
  signing_key:
267
234
  specification_version: 3
268
235
  summary: Ruby on Rails blogging engine for RefineryCMS.
269
236
  test_files: []
270
-