refinerycms-blog 1.8.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +54 -0
- data/.rspec +3 -0
- data/.travis.yml +18 -0
- data/Gemfile +68 -5
- data/Guardfile +20 -0
- data/Rakefile +21 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/cog.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comment.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comment_cross.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comment_tick.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comments.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/down.gif +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/folder.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/folder_add.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/folder_edit.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/page.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/page_add.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/page_copy.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/up.gif +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/rss-feed.png +0 -0
- data/app/assets/images/refinerycms-blog/.gitkeep +0 -0
- data/{public/javascripts/refinery/refinerycms-blog.js → app/assets/javascripts/refinery/blog/backend.js} +66 -1
- data/{public/javascripts/refinerycms-blog.js → app/assets/javascripts/refinery/blog/frontend.js} +0 -0
- data/app/assets/javascripts/refinerycms-blog/.gitkeep +0 -0
- data/app/assets/stylesheets/refinery/blog/backend.css.scss +73 -0
- data/{public/stylesheets/refinerycms-blog.css → app/assets/stylesheets/refinery/blog/frontend.css.scss} +3 -3
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/{public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css → app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss} +0 -0
- data/app/assets/stylesheets/refinerycms-blog/.gitkeep +0 -0
- data/app/controllers/.gitkeep +0 -0
- data/app/controllers/refinery/blog/admin/categories_controller.rb +12 -0
- data/app/controllers/refinery/blog/admin/comments_controller.rb +49 -0
- data/app/controllers/refinery/blog/admin/posts_controller.rb +90 -0
- data/app/controllers/refinery/blog/admin/settings_controller.rb +55 -0
- data/app/controllers/refinery/blog/blog_controller.rb +17 -0
- data/app/controllers/refinery/blog/categories_controller.rb +12 -0
- data/app/controllers/refinery/blog/posts_controller.rb +84 -0
- data/app/helpers/.gitkeep +0 -0
- data/app/helpers/refinery/blog/controller_helper.rb +29 -0
- data/app/helpers/refinery/blog/posts_helper.rb +72 -0
- data/app/mailers/refinery/blog/comment_mailer.rb +14 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/refinery/blog/category.rb +23 -0
- data/app/models/refinery/blog/comment.rb +135 -0
- data/app/models/refinery/blog/comment_mailer.rb +1 -0
- data/app/models/refinery/blog/post.rb +115 -0
- data/app/models/refinery/categorization.rb +9 -0
- data/app/sweepers/refinery/blog_sweeper.rb +26 -0
- data/app/views/.gitkeep +0 -0
- data/app/views/{admin/blog → refinery/blog/admin}/_submenu.html.erb +21 -21
- data/app/views/{admin/blog → refinery/blog/admin}/categories/_category.html.erb +3 -3
- data/app/views/{admin/blog → refinery/blog/admin}/categories/_form.html.erb +4 -4
- data/app/views/{admin/blog/comments → refinery/blog/admin/categories}/_sortable_list.html.erb +2 -2
- data/app/views/{admin/blog → refinery/blog/admin}/categories/edit.html.erb +0 -0
- data/app/views/refinery/blog/admin/categories/index.html.erb +27 -0
- data/app/views/{admin/blog → refinery/blog/admin}/categories/new.html.erb +0 -0
- data/app/views/{admin/blog → refinery/blog/admin}/comments/_comment.html.erb +4 -4
- data/app/views/{admin/blog/categories → refinery/blog/admin/comments}/_sortable_list.html.erb +2 -2
- data/app/views/refinery/blog/admin/comments/index.html.erb +30 -0
- data/app/views/refinery/blog/admin/comments/show.html.erb +63 -0
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_form.html.erb +53 -39
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_form_part.html.erb +0 -0
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_post.html.erb +4 -7
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_sortable_list.html.erb +2 -2
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_teaser_part.html.erb +2 -2
- data/app/views/{admin/blog → refinery/blog/admin}/posts/edit.html.erb +0 -0
- data/app/views/refinery/blog/admin/posts/index.html.erb +27 -0
- data/app/views/{admin/blog → refinery/blog/admin}/posts/new.html.erb +0 -0
- data/app/views/refinery/blog/admin/posts/uncategorized.html.erb +27 -0
- data/app/views/{admin/blog → refinery/blog/admin}/settings/notification_recipients.html.erb +3 -3
- data/app/views/refinery/blog/categories/show.html.erb +21 -0
- data/app/views/{blog → refinery/blog}/comment_mailer/notification.html.erb +1 -1
- data/app/views/{blog → refinery/blog}/posts/_comment.html.erb +2 -2
- data/app/views/refinery/blog/posts/_comments.html.erb +40 -0
- data/app/views/refinery/blog/posts/_nav.html.erb +17 -0
- data/app/views/refinery/blog/posts/_post.html.erb +37 -0
- data/app/views/refinery/blog/posts/archive.html.erb +17 -0
- data/app/views/refinery/blog/posts/index.html.erb +20 -0
- data/app/views/refinery/blog/posts/index.rss.builder +17 -0
- data/app/views/refinery/blog/posts/show.html.erb +21 -0
- data/app/views/refinery/blog/posts/tagged.html.erb +19 -0
- data/app/views/refinery/blog/shared/_body_content_right.html.erb +9 -0
- data/app/views/{blog → refinery/blog}/shared/_categories.html.erb +3 -3
- data/app/views/{blog → refinery/blog}/shared/_post.html.erb +11 -11
- data/app/views/refinery/blog/shared/_posts.html.erb +10 -0
- data/app/views/refinery/blog/shared/_rss_feed.html.erb +2 -0
- data/app/views/{blog → refinery/blog}/shared/_tags.html.erb +1 -1
- data/app/views/refinery/blog/widgets/_blog_archive.html.erb +10 -0
- data/app/views/refinery/shared/admin/_autocomplete.html.erb +5 -0
- data/changelog.md +2 -18
- data/config/initializers/url_validator.rb +84 -0
- data/config/locales/bg.yml +139 -139
- data/config/locales/cs.yml +119 -119
- data/config/locales/de.yml +121 -121
- data/config/locales/en.yml +147 -140
- data/config/locales/es.yml +119 -150
- data/config/locales/fr.yml +136 -136
- data/config/locales/it.yml +139 -139
- data/config/locales/ja.yml +2 -3
- data/config/locales/nb.yml +28 -27
- data/config/locales/nl.yml +125 -125
- data/config/locales/pl.yml +125 -125
- data/config/locales/pt-BR.yml +129 -134
- data/config/locales/ru.yml +119 -126
- data/config/locales/sk.yml +119 -119
- data/config/locales/zh-CN.yml +119 -119
- data/config/routes.rb +37 -33
- data/db/migrate/20110803223522_create_blog_structure.rb +52 -0
- data/db/migrate/20110803223523_add_user_id_to_blog_posts.rb +7 -0
- data/db/migrate/{3_acts_as_taggable_on_migration.rb → 20110803223524_acts_as_taggable_on_migration.rb} +2 -2
- data/db/migrate/20110803223526_add_cached_slugs.rb +6 -0
- data/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb +5 -0
- data/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb +6 -0
- data/db/migrate/20110803223529_add_primary_key_to_categorizations.rb +14 -0
- data/db/migrate/20120103055909_add_source_url_to_blog_posts.rb +7 -0
- data/db/migrate/20120223022021_add_access_count_to_posts.rb +8 -0
- data/db/migrate/20120227022021_add_slug_to_posts_and_categories.rb +9 -0
- data/db/{seeds/refinerycms_blog.rb → seeds.rb} +6 -7
- data/lib/generators/refinery/blog/blog_generator.rb +27 -0
- data/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb +11 -0
- data/lib/refinery/blog.rb +37 -0
- data/lib/refinery/blog/configuration.rb +14 -0
- data/lib/refinery/blog/engine.rb +25 -0
- data/lib/refinery/blog/tabs.rb +5 -11
- data/lib/refinery/blog/version.rb +3 -3
- data/lib/refinerycms-blog.rb +1 -41
- data/readme.md +24 -15
- data/refinerycms-blog.gemspec +19 -196
- data/script/rails +6 -0
- data/spec/factories/blog_categories.rb +5 -0
- data/spec/factories/blog_comments.rb +19 -0
- data/spec/factories/blog_posts.rb +13 -0
- data/spec/helpers/refinery/blog/posts_helper_spec.rb +71 -0
- data/spec/lib/refinery/blog/engine_spec.rb +26 -0
- data/spec/models/refinery/blog/category_spec.rb +42 -0
- data/spec/models/refinery/blog/comment_spec.rb +19 -0
- data/spec/models/refinery/blog/post_spec.rb +233 -0
- data/spec/requests/refinery/blog/admin/categories_spec.rb +20 -0
- data/spec/requests/refinery/blog/admin/comments_spec.rb +121 -0
- data/spec/requests/refinery/blog/admin/menu_spec.rb +13 -0
- data/spec/requests/refinery/blog/admin/posts_spec.rb +175 -0
- data/spec/requests/refinery/blog/categories_spec.rb +24 -0
- data/spec/requests/refinery/blog/posts_spec.rb +160 -0
- data/spec/spec_helper.rb +56 -0
- data/tasks/rspec.rake +4 -0
- data/tasks/testing.rake +9 -0
- metadata +281 -170
- data/app/controllers/admin/blog/categories_controller.rb +0 -11
- data/app/controllers/admin/blog/comments_controller.rb +0 -40
- data/app/controllers/admin/blog/posts_controller.rb +0 -97
- data/app/controllers/admin/blog/settings_controller.rb +0 -53
- data/app/controllers/blog/categories_controller.rb +0 -13
- data/app/controllers/blog/posts_controller.rb +0 -109
- data/app/controllers/blog_controller.rb +0 -16
- data/app/helpers/blog_posts_helper.rb +0 -56
- data/app/mailers/blog/comment_mailer.rb +0 -13
- data/app/models/blog/comment_mailer.rb +0 -1
- data/app/models/blog_category.rb +0 -19
- data/app/models/blog_comment.rb +0 -137
- data/app/models/blog_post.rb +0 -114
- data/app/models/categorization.rb +0 -7
- data/app/views/admin/blog/categories/index.html.erb +0 -26
- data/app/views/admin/blog/comments/index.html.erb +0 -35
- data/app/views/admin/blog/comments/show.html.erb +0 -63
- data/app/views/admin/blog/posts/_form.css.erb +0 -20
- data/app/views/admin/blog/posts/_form.js.erb +0 -23
- data/app/views/admin/blog/posts/index.html.erb +0 -28
- data/app/views/admin/blog/posts/uncategorized.html.erb +0 -26
- data/app/views/blog/categories/show.html.erb +0 -21
- data/app/views/blog/posts/_nav.html.erb +0 -11
- data/app/views/blog/posts/archive.html.erb +0 -20
- data/app/views/blog/posts/index.html.erb +0 -24
- data/app/views/blog/posts/index.rss.builder +0 -17
- data/app/views/blog/posts/show.html.erb +0 -98
- data/app/views/blog/posts/tagged.html.erb +0 -22
- data/app/views/blog/shared/_archive_list.html.erb +0 -9
- data/app/views/blog/shared/_related_posts.html.erb +0 -10
- data/app/views/blog/shared/_rss_feed.html.erb +0 -2
- data/app/views/shared/admin/_autocomplete.html.erb +0 -55
- data/db/migrate/1_create_blog_structure.rb +0 -54
- data/db/migrate/2_add_user_id_to_blog_posts.rb +0 -11
- data/db/migrate/4_create_seo_meta_for_blog.rb +0 -25
- data/db/migrate/5_add_cached_slugs.rb +0 -11
- data/db/migrate/6_add_custom_url_field_to_blog_posts.rb +0 -9
- data/db/migrate/7_add_custom_teaser_field_to_blog_posts.rb +0 -10
- data/db/migrate/8_add_primary_key_to_categorizations.rb +0 -12
- data/features/authors.feature +0 -15
- data/features/category.feature +0 -23
- data/features/support/factories/blog_categories.rb +0 -5
- data/features/support/factories/blog_comments.rb +0 -8
- data/features/support/factories/blog_posts.rb +0 -9
- data/features/support/paths.rb +0 -24
- data/features/support/step_definitions/authors_steps.rb +0 -7
- data/features/support/step_definitions/category_steps.rb +0 -11
- data/features/support/step_definitions/tags_steps.rb +0 -13
- data/features/tags.feature +0 -26
- data/lib/gemspec.rb +0 -37
- data/lib/generators/refinerycms_blog_generator.rb +0 -8
- data/public/stylesheets/refinery/refinerycms-blog.css +0 -55
- data/spec/models/blog_category_spec.rb +0 -41
- data/spec/models/blog_comment_spec.rb +0 -21
- data/spec/models/blog_post_spec.rb +0 -217
@@ -0,0 +1,9 @@
|
|
1
|
+
class AddSlugToPostsAndCategories < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_column Refinery::Blog::Post.table_name, :slug, :string
|
4
|
+
add_index Refinery::Blog::Post.table_name, :slug
|
5
|
+
|
6
|
+
add_column Refinery::Blog::Category.table_name, :slug, :string
|
7
|
+
add_index Refinery::Blog::Category.table_name, :slug
|
8
|
+
end
|
9
|
+
end
|
@@ -1,20 +1,19 @@
|
|
1
|
-
::User.
|
1
|
+
Refinery::User.all.each do |user|
|
2
2
|
if user.plugins.where(:name => 'refinerycms_blog').blank?
|
3
3
|
user.plugins.create(:name => "refinerycms_blog",
|
4
4
|
:position => (user.plugins.maximum(:position) || -1) +1)
|
5
5
|
end
|
6
|
-
end if defined?(::User)
|
6
|
+
end if defined?(Refinery::User)
|
7
7
|
|
8
|
-
if defined?(::Page)
|
9
|
-
page = ::Page.create(
|
8
|
+
if defined?(Refinery::Page) and !Refinery::Page.exists?(:link_url => '/blog')
|
9
|
+
page = Refinery::Page.create(
|
10
10
|
:title => "Blog",
|
11
11
|
:link_url => "/blog",
|
12
12
|
:deletable => false,
|
13
|
-
:position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
|
14
13
|
:menu_match => "^/blogs?(\/|\/.+?|)$"
|
15
14
|
)
|
16
15
|
|
17
|
-
::
|
16
|
+
Refinery::Pages.default_parts.each do |default_page_part|
|
18
17
|
page.parts.create(:title => default_page_part, :body => nil)
|
19
18
|
end
|
20
|
-
end
|
19
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Refinery
|
2
|
+
class BlogGenerator < Rails::Generators::Base
|
3
|
+
|
4
|
+
source_root File.expand_path("../templates", __FILE__)
|
5
|
+
|
6
|
+
def generate_blog_initializer
|
7
|
+
template "config/initializers/refinery/blog.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "blog.rb")
|
8
|
+
end
|
9
|
+
|
10
|
+
def rake_db
|
11
|
+
rake("refinery_blog:install:migrations")
|
12
|
+
rake("refinery_settings:install:migrations")
|
13
|
+
end
|
14
|
+
|
15
|
+
def append_load_seed_data
|
16
|
+
create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
|
17
|
+
append_file 'db/seeds.rb', :verbose => true do
|
18
|
+
<<-EOH
|
19
|
+
|
20
|
+
# Added by Refinery CMS Blog engine
|
21
|
+
Refinery::Blog::Engine.load_seed
|
22
|
+
EOH
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Refinery::Blog.configure do |config|
|
2
|
+
# config.validate_source_url = <%= Refinery::Blog.validate_source_url.inspect %>
|
3
|
+
|
4
|
+
# config.comments_per_page = <%= Refinery::Blog.comments_per_page.inspect %>
|
5
|
+
|
6
|
+
# config.posts_per_page = <%= Refinery::Blog.posts_per_page.inspect %>
|
7
|
+
|
8
|
+
# config.post_teaser_length = <%= Refinery::Blog.post_teaser_length.inspect %>
|
9
|
+
|
10
|
+
# config.share_this_key = <%= Refinery::Blog.share_this_key.inspect %>
|
11
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'refinerycms-core'
|
2
|
+
require 'refinerycms-settings'
|
3
|
+
require 'filters_spam'
|
4
|
+
require 'rails_autolink'
|
5
|
+
|
6
|
+
module Refinery
|
7
|
+
autoload :BlogGenerator, 'generators/refinery/blog/blog_generator'
|
8
|
+
|
9
|
+
module Blog
|
10
|
+
require 'refinery/blog/engine'
|
11
|
+
require 'refinery/blog/configuration'
|
12
|
+
|
13
|
+
autoload :Version, 'refinery/blog/version'
|
14
|
+
autoload :Tab, 'refinery/blog/tabs'
|
15
|
+
|
16
|
+
class << self
|
17
|
+
attr_writer :root
|
18
|
+
attr_writer :tabs
|
19
|
+
|
20
|
+
def root
|
21
|
+
@root ||= Pathname.new(File.expand_path('../../../', __FILE__))
|
22
|
+
end
|
23
|
+
|
24
|
+
def tabs
|
25
|
+
@tabs ||= []
|
26
|
+
end
|
27
|
+
|
28
|
+
def version
|
29
|
+
::Refinery::Blog::Version.to_s
|
30
|
+
end
|
31
|
+
|
32
|
+
def factory_paths
|
33
|
+
@factory_paths ||= [ root.join("spec/factories").to_s ]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Blog
|
3
|
+
include ActiveSupport::Configurable
|
4
|
+
|
5
|
+
config_accessor :validate_source_url, :comments_per_page, :posts_per_page,
|
6
|
+
:post_teaser_length, :share_this_key
|
7
|
+
|
8
|
+
self.validate_source_url = false
|
9
|
+
self.comments_per_page = 10
|
10
|
+
self.posts_per_page = 10
|
11
|
+
self.post_teaser_length = 250
|
12
|
+
self.share_this_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Blog
|
3
|
+
class Engine < Rails::Engine
|
4
|
+
include Refinery::Engine
|
5
|
+
|
6
|
+
isolate_namespace Refinery::Blog
|
7
|
+
|
8
|
+
initializer "register refinerycms_blog plugin" do
|
9
|
+
Refinery::Plugin.register do |plugin|
|
10
|
+
plugin.pathname = root
|
11
|
+
plugin.name = "refinerycms_blog"
|
12
|
+
plugin.url = {:controller => 'refinery/blog/admin/posts'}
|
13
|
+
plugin.menu_match = /refinery\/blog\/?(posts|comments|categories)?/
|
14
|
+
plugin.activity = {
|
15
|
+
:class_name => :'refinery/blog/post'
|
16
|
+
}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
config.after_initialize do
|
21
|
+
Refinery.register_engine(Refinery::Blog)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/refinery/blog/tabs.rb
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
module Refinery
|
2
|
-
module Blog
|
3
|
-
attr_accessor :tabs
|
4
|
-
|
5
|
-
def self.tabs
|
6
|
-
@tabs ||= []
|
7
|
-
end
|
8
|
-
|
2
|
+
module Blog
|
9
3
|
class Tab
|
10
4
|
attr_accessor :name, :partial
|
11
5
|
|
@@ -18,11 +12,11 @@ module Refinery
|
|
18
12
|
raise "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank?
|
19
13
|
end
|
20
14
|
|
21
|
-
|
15
|
+
protected
|
22
16
|
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
def initialize
|
18
|
+
::Refinery::Blog.tabs << self # add me to the collection of registered page tabs
|
19
|
+
end
|
26
20
|
end
|
27
21
|
end
|
28
22
|
end
|
data/lib/refinerycms-blog.rb
CHANGED
@@ -1,41 +1 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
module Refinery
|
4
|
-
module Blog
|
5
|
-
autoload :Version, File.expand_path('../refinery/blog/version', __FILE__)
|
6
|
-
autoload :Tab, File.expand_path("../refinery/blog/tabs", __FILE__)
|
7
|
-
|
8
|
-
class << self
|
9
|
-
attr_accessor :root
|
10
|
-
def root
|
11
|
-
@root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
12
|
-
end
|
13
|
-
|
14
|
-
def version
|
15
|
-
::Refinery::Blog::Version.to_s
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class Engine < Rails::Engine
|
20
|
-
initializer 'blog serves assets' do |app|
|
21
|
-
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
22
|
-
end
|
23
|
-
|
24
|
-
config.to_prepare do
|
25
|
-
require File.expand_path('../refinery/blog/tabs', __FILE__)
|
26
|
-
end
|
27
|
-
|
28
|
-
config.after_initialize do
|
29
|
-
Refinery::Plugin.register do |plugin|
|
30
|
-
plugin.pathname = root
|
31
|
-
plugin.name = "refinerycms_blog"
|
32
|
-
plugin.url = {:controller => '/admin/blog/posts', :action => 'index'}
|
33
|
-
plugin.menu_match = /^\/?(admin|refinery)\/blog\/?(posts|comments|categories)?/
|
34
|
-
plugin.activity = {
|
35
|
-
:class => BlogPost
|
36
|
-
}
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end if defined?(Rails::Engine)
|
40
|
-
end
|
41
|
-
end
|
1
|
+
require 'refinery/blog'
|
data/readme.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Simple blog engine for [Refinery CMS](http://refinerycms.com). It supports posts, categories and comments.
|
4
4
|
|
5
|
-
This version of `refinerycms-blog` supports Rails 3.
|
5
|
+
This version of `refinerycms-blog` supports Rails 3.1.x. To use Rails 2.3.x use the [refinerycms-blog "Rails 2.3.x stable branch"](http://github.com/resolve/refinerycms-blog/tree/rails2-stable).
|
6
6
|
|
7
7
|
Options:
|
8
8
|
|
@@ -11,31 +11,40 @@ Options:
|
|
11
11
|
|
12
12
|
## Requirements
|
13
13
|
|
14
|
-
Refinery CMS version
|
15
|
-
Your Rails 3 application should not be called "blog"
|
14
|
+
Refinery CMS version 2.0.0 or above.
|
16
15
|
|
17
16
|
## Install
|
18
17
|
|
19
18
|
Open up your ``Gemfile`` and add at the bottom this line:
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
gem 'refinerycms-blog', '~> 1.7.0'
|
26
|
-
|
27
|
-
## Take the red pill and head up to 1.8.x
|
28
|
-
## Where the previous shared/_post.html.erb partial was moved directly into show.html.erb
|
29
|
-
## *MEANING:* If you depend on that partial, you'll have to check the changes and merge your customizations back in!
|
30
|
-
|
31
|
-
gem 'refinerycms-blog', '~> 1.8.0'
|
20
|
+
```ruby
|
21
|
+
gem 'refinerycms-blog', '~> 2.0.0'
|
22
|
+
```
|
32
23
|
|
33
24
|
Now, run ``bundle install``
|
34
25
|
|
35
26
|
Next, to install the blog plugin run:
|
36
27
|
|
37
|
-
rails generate
|
28
|
+
rails generate refinery:blog
|
38
29
|
|
39
30
|
Finally migrate your database and you're done.
|
40
31
|
|
41
32
|
rake db:migrate
|
33
|
+
|
34
|
+
## Developing & Contributing
|
35
|
+
|
36
|
+
The version of Refinery to develop this engine against is defined in the gemspec. To override the version of refinery to develop against, edit the project Gemfile to point to a local path containing a clone of refinerycms.
|
37
|
+
|
38
|
+
### Testing
|
39
|
+
|
40
|
+
Generate the dummy application to test against
|
41
|
+
|
42
|
+
$ bundle exec rake refinery:testing:dummy_app
|
43
|
+
|
44
|
+
Run the test suite with [Guard](https://github.com/guard/guard)
|
45
|
+
|
46
|
+
$ bundle exec guard start
|
47
|
+
|
48
|
+
Or just with rake spec
|
49
|
+
|
50
|
+
$ bundle exec rake spec
|
data/refinerycms-blog.gemspec
CHANGED
@@ -1,207 +1,30 @@
|
|
1
|
+
# Encoding: UTF-8
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'refinery/blog/version'
|
4
|
+
|
5
|
+
version = Refinery::Blog::Version.to_s
|
6
|
+
|
1
7
|
Gem::Specification.new do |s|
|
2
8
|
s.name = %q{refinerycms-blog}
|
3
|
-
s.version =
|
4
|
-
s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with
|
5
|
-
s.
|
6
|
-
s.summary = %q{Ruby on Rails blogging engine for RefineryCMS.}
|
9
|
+
s.version = version
|
10
|
+
s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with Refinery CMS.}
|
11
|
+
s.summary = %q{Ruby on Rails blogging engine for Refinery CMS.}
|
7
12
|
s.email = %q{info@refinerycms.com}
|
8
13
|
s.homepage = %q{http://refinerycms.com/blog}
|
9
14
|
s.authors = ['Resolve Digital', 'Neoteric Design']
|
10
15
|
s.require_paths = %w(lib)
|
11
16
|
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- spec/*`.split("\n")
|
19
|
+
|
12
20
|
# Runtime dependencies
|
13
|
-
s.add_dependency 'refinerycms-core',
|
14
|
-
s.add_dependency '
|
21
|
+
s.add_dependency 'refinerycms-core', '~> 2.0.0'
|
22
|
+
s.add_dependency 'refinerycms-settings', '~> 2.0.0'
|
23
|
+
s.add_dependency 'filters_spam', '~> 0.2'
|
15
24
|
s.add_dependency 'acts-as-taggable-on'
|
16
|
-
s.add_dependency 'seo_meta',
|
25
|
+
s.add_dependency 'seo_meta', '~> 1.2.0'
|
26
|
+
s.add_dependency 'rails_autolink'
|
17
27
|
|
18
28
|
# Development dependencies
|
19
|
-
s.add_development_dependency '
|
20
|
-
|
21
|
-
s.files = %w(
|
22
|
-
app
|
23
|
-
app/controllers
|
24
|
-
app/controllers/admin
|
25
|
-
app/controllers/admin/blog
|
26
|
-
app/controllers/admin/blog/categories_controller.rb
|
27
|
-
app/controllers/admin/blog/comments_controller.rb
|
28
|
-
app/controllers/admin/blog/posts_controller.rb
|
29
|
-
app/controllers/admin/blog/settings_controller.rb
|
30
|
-
app/controllers/blog
|
31
|
-
app/controllers/blog/categories_controller.rb
|
32
|
-
app/controllers/blog/posts_controller.rb
|
33
|
-
app/controllers/blog_controller.rb
|
34
|
-
app/helpers
|
35
|
-
app/helpers/blog_posts_helper.rb
|
36
|
-
app/mailers
|
37
|
-
app/mailers/blog
|
38
|
-
app/mailers/blog/comment_mailer.rb
|
39
|
-
app/models
|
40
|
-
app/models/blog
|
41
|
-
app/models/blog/comment_mailer.rb
|
42
|
-
app/models/blog_category.rb
|
43
|
-
app/models/blog_comment.rb
|
44
|
-
app/models/blog_post.rb
|
45
|
-
app/models/categorization.rb
|
46
|
-
app/views
|
47
|
-
app/views/admin
|
48
|
-
app/views/admin/blog
|
49
|
-
app/views/admin/blog/_submenu.html.erb
|
50
|
-
app/views/admin/blog/categories
|
51
|
-
app/views/admin/blog/categories/_category.html.erb
|
52
|
-
app/views/admin/blog/categories/_form.html.erb
|
53
|
-
app/views/admin/blog/categories/_sortable_list.html.erb
|
54
|
-
app/views/admin/blog/categories/edit.html.erb
|
55
|
-
app/views/admin/blog/categories/index.html.erb
|
56
|
-
app/views/admin/blog/categories/new.html.erb
|
57
|
-
app/views/admin/blog/comments
|
58
|
-
app/views/admin/blog/comments/_comment.html.erb
|
59
|
-
app/views/admin/blog/comments/_sortable_list.html.erb
|
60
|
-
app/views/admin/blog/comments/index.html.erb
|
61
|
-
app/views/admin/blog/comments/show.html.erb
|
62
|
-
app/views/admin/blog/posts
|
63
|
-
app/views/admin/blog/posts/_form.css.erb
|
64
|
-
app/views/admin/blog/posts/_form.html.erb
|
65
|
-
app/views/admin/blog/posts/_form.js.erb
|
66
|
-
app/views/admin/blog/posts/_form_part.html.erb
|
67
|
-
app/views/admin/blog/posts/_post.html.erb
|
68
|
-
app/views/admin/blog/posts/_sortable_list.html.erb
|
69
|
-
app/views/admin/blog/posts/_teaser_part.html.erb
|
70
|
-
app/views/admin/blog/posts/edit.html.erb
|
71
|
-
app/views/admin/blog/posts/index.html.erb
|
72
|
-
app/views/admin/blog/posts/new.html.erb
|
73
|
-
app/views/admin/blog/posts/uncategorized.html.erb
|
74
|
-
app/views/admin/blog/settings
|
75
|
-
app/views/admin/blog/settings/notification_recipients.html.erb
|
76
|
-
app/views/blog
|
77
|
-
app/views/blog/categories
|
78
|
-
app/views/blog/categories/show.html.erb
|
79
|
-
app/views/blog/comment_mailer
|
80
|
-
app/views/blog/comment_mailer/notification.html.erb
|
81
|
-
app/views/blog/posts
|
82
|
-
app/views/blog/posts/_comment.html.erb
|
83
|
-
app/views/blog/posts/_nav.html.erb
|
84
|
-
app/views/blog/posts/archive.html.erb
|
85
|
-
app/views/blog/posts/index.html.erb
|
86
|
-
app/views/blog/posts/index.rss.builder
|
87
|
-
app/views/blog/posts/show.html.erb
|
88
|
-
app/views/blog/posts/tagged.html.erb
|
89
|
-
app/views/blog/shared
|
90
|
-
app/views/blog/shared/_archive_list.html.erb
|
91
|
-
app/views/blog/shared/_categories.html.erb
|
92
|
-
app/views/blog/shared/_post.html.erb
|
93
|
-
app/views/blog/shared/_related_posts.html.erb
|
94
|
-
app/views/blog/shared/_rss_feed.html.erb
|
95
|
-
app/views/blog/shared/_tags.html.erb
|
96
|
-
app/views/shared
|
97
|
-
app/views/shared/admin
|
98
|
-
app/views/shared/admin/_autocomplete.html.erb
|
99
|
-
changelog.md
|
100
|
-
config
|
101
|
-
config/locales
|
102
|
-
config/locales/bg.yml
|
103
|
-
config/locales/cs.yml
|
104
|
-
config/locales/de.yml
|
105
|
-
config/locales/en.yml
|
106
|
-
config/locales/es.yml
|
107
|
-
config/locales/fr.yml
|
108
|
-
config/locales/it.yml
|
109
|
-
config/locales/ja.yml
|
110
|
-
config/locales/nb.yml
|
111
|
-
config/locales/nl.yml
|
112
|
-
config/locales/pl.yml
|
113
|
-
config/locales/pt-BR.yml
|
114
|
-
config/locales/ru.yml
|
115
|
-
config/locales/sk.yml
|
116
|
-
config/locales/zh-CN.yml
|
117
|
-
config/routes.rb
|
118
|
-
db
|
119
|
-
db/migrate
|
120
|
-
db/migrate/1_create_blog_structure.rb
|
121
|
-
db/migrate/2_add_user_id_to_blog_posts.rb
|
122
|
-
db/migrate/3_acts_as_taggable_on_migration.rb
|
123
|
-
db/migrate/4_create_seo_meta_for_blog.rb
|
124
|
-
db/migrate/5_add_cached_slugs.rb
|
125
|
-
db/migrate/6_add_custom_url_field_to_blog_posts.rb
|
126
|
-
db/migrate/7_add_custom_teaser_field_to_blog_posts.rb
|
127
|
-
db/migrate/8_add_primary_key_to_categorizations.rb
|
128
|
-
db/seeds
|
129
|
-
db/seeds/refinerycms_blog.rb
|
130
|
-
features
|
131
|
-
features/authors.feature
|
132
|
-
features/category.feature
|
133
|
-
features/support
|
134
|
-
features/support/factories
|
135
|
-
features/support/factories/blog_categories.rb
|
136
|
-
features/support/factories/blog_comments.rb
|
137
|
-
features/support/factories/blog_posts.rb
|
138
|
-
features/support/paths.rb
|
139
|
-
features/support/step_definitions
|
140
|
-
features/support/step_definitions/authors_steps.rb
|
141
|
-
features/support/step_definitions/category_steps.rb
|
142
|
-
features/support/step_definitions/tags_steps.rb
|
143
|
-
features/tags.feature
|
144
|
-
Gemfile
|
145
|
-
lib
|
146
|
-
lib/gemspec.rb
|
147
|
-
lib/generators
|
148
|
-
lib/generators/refinerycms_blog_generator.rb
|
149
|
-
lib/refinery
|
150
|
-
lib/refinery/blog
|
151
|
-
lib/refinery/blog/tabs.rb
|
152
|
-
lib/refinery/blog/version.rb
|
153
|
-
lib/refinerycms-blog.rb
|
154
|
-
public
|
155
|
-
public/images
|
156
|
-
public/images/refinerycms-blog
|
157
|
-
public/images/refinerycms-blog/icons
|
158
|
-
public/images/refinerycms-blog/icons/cog.png
|
159
|
-
public/images/refinerycms-blog/icons/comment.png
|
160
|
-
public/images/refinerycms-blog/icons/comment_cross.png
|
161
|
-
public/images/refinerycms-blog/icons/comment_tick.png
|
162
|
-
public/images/refinerycms-blog/icons/comments.png
|
163
|
-
public/images/refinerycms-blog/icons/down.gif
|
164
|
-
public/images/refinerycms-blog/icons/folder.png
|
165
|
-
public/images/refinerycms-blog/icons/folder_add.png
|
166
|
-
public/images/refinerycms-blog/icons/folder_edit.png
|
167
|
-
public/images/refinerycms-blog/icons/page.png
|
168
|
-
public/images/refinerycms-blog/icons/page_add.png
|
169
|
-
public/images/refinerycms-blog/icons/page_copy.png
|
170
|
-
public/images/refinerycms-blog/icons/up.gif
|
171
|
-
public/images/refinerycms-blog/rss-feed.png
|
172
|
-
public/javascripts
|
173
|
-
public/javascripts/refinery
|
174
|
-
public/javascripts/refinery/refinerycms-blog.js
|
175
|
-
public/javascripts/refinerycms-blog.js
|
176
|
-
public/stylesheets
|
177
|
-
public/stylesheets/refinery
|
178
|
-
public/stylesheets/refinery/refinerycms-blog.css
|
179
|
-
public/stylesheets/refinerycms-blog.css
|
180
|
-
public/stylesheets/ui-lightness
|
181
|
-
public/stylesheets/ui-lightness/images
|
182
|
-
public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
|
183
|
-
public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
|
184
|
-
public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
|
185
|
-
public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
|
186
|
-
public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
|
187
|
-
public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
|
188
|
-
public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
|
189
|
-
public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
|
190
|
-
public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
|
191
|
-
public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png
|
192
|
-
public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png
|
193
|
-
public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png
|
194
|
-
public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png
|
195
|
-
public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png
|
196
|
-
public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css
|
197
|
-
readme.md
|
198
|
-
refinerycms-blog.gemspec
|
199
|
-
spec
|
200
|
-
spec/models
|
201
|
-
spec/models/blog_category_spec.rb
|
202
|
-
spec/models/blog_comment_spec.rb
|
203
|
-
spec/models/blog_post_spec.rb
|
204
|
-
todo.md
|
205
|
-
)
|
206
|
-
|
207
|
-
end
|
29
|
+
s.add_development_dependency 'refinerycms-testing', '~> 2.0.0'
|
30
|
+
end
|