aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-08-18 16:52:22 +1200
committerPhilip Arndt <parndt@gmail.com>2010-08-18 16:52:22 +1200
commit75b8f120473a4025a47078feb1a208b9e39f1b1b (patch)
tree108676de862be97c3ff09793677c2d8154330d35
parent6086ac36adf6f54a5d2957ffdf101e251edd553c (diff)
downloadrefinerycms-blog-75b8f120473a4025a47078feb1a208b9e39f1b1b.tar.gz
refinerycms-blog-75b8f120473a4025a47078feb1a208b9e39f1b1b.tar.bz2
refinerycms-blog-75b8f120473a4025a47078feb1a208b9e39f1b1b.zip
Added asset copying to the generator script for those systems that can't cope with rails3 coolness.
-rw-r--r--app/controllers/admin/blog/categories_controller.rb4
-rw-r--r--app/controllers/admin/blog/comments_controller.rb4
-rw-r--r--app/controllers/admin/blog/posts_controller.rb8
-rw-r--r--generators/refinery_blog/refinery_blog_generator.rb11
-rw-r--r--public/images/refinerycms-blog/icons/cog.pngbin0 -> 512 bytes
-rw-r--r--public/images/refinerycms-blog/icons/comment.pngbin0 -> 413 bytes
-rw-r--r--public/images/refinerycms-blog/icons/comment_cross.pngbin0 -> 1507 bytes
-rw-r--r--public/images/refinerycms-blog/icons/comment_tick.pngbin0 -> 1524 bytes
-rw-r--r--public/images/refinerycms-blog/icons/comments.pngbin0 -> 557 bytes
-rw-r--r--public/images/refinerycms-blog/icons/folder.pngbin0 -> 537 bytes
-rw-r--r--public/images/refinerycms-blog/icons/folder_add.pngbin0 -> 668 bytes
-rw-r--r--public/images/refinerycms-blog/icons/folder_edit.pngbin0 -> 733 bytes
-rw-r--r--public/images/refinerycms-blog/icons/page.pngbin0 -> 635 bytes
-rw-r--r--public/images/refinerycms-blog/icons/page_add.pngbin0 -> 739 bytes
-rw-r--r--public/images/refinerycms-blog/icons/page_copy.pngbin0 -> 663 bytes
-rw-r--r--public/stylesheets/refinerycms-blog.css22
16 files changed, 34 insertions, 15 deletions
diff --git a/app/controllers/admin/blog/categories_controller.rb b/app/controllers/admin/blog/categories_controller.rb
index ddce1c8..09fa802 100644
--- a/app/controllers/admin/blog/categories_controller.rb
+++ b/app/controllers/admin/blog/categories_controller.rb
@@ -1,5 +1,7 @@
class Admin::Blog::CategoriesController < Admin::BaseController
- crudify :blog_category, :title_attribute => :name, :order => 'created_at DESC'
+ crudify :blog_category,
+ :title_attribute => :name,
+ :order => 'created_at DESC'
end
diff --git a/app/controllers/admin/blog/comments_controller.rb b/app/controllers/admin/blog/comments_controller.rb
index ba9593a..33b3463 100644
--- a/app/controllers/admin/blog/comments_controller.rb
+++ b/app/controllers/admin/blog/comments_controller.rb
@@ -1,6 +1,8 @@
class Admin::Blog::CommentsController < Admin::BaseController
- crudify :blog_comment, :title_attribute => :name, :order => 'created_at DESC'
+ crudify :blog_comment,
+ :title_attribute => :name,
+ :order => 'created_at DESC'
def index
@blog_comments = BlogComment.unmoderated
diff --git a/app/controllers/admin/blog/posts_controller.rb b/app/controllers/admin/blog/posts_controller.rb
index 2acde56..402748e 100644
--- a/app/controllers/admin/blog/posts_controller.rb
+++ b/app/controllers/admin/blog/posts_controller.rb
@@ -1,7 +1,11 @@
class Admin::Blog::PostsController < Admin::BaseController
- crudify :blog_post, :title_attribute => :title, :order => 'created_at DESC'
- before_filter :find_all_categories, :only => [:new, :edit, :create, :update]
+ crudify :blog_post,
+ :title_attribute => :title,
+ :order => 'created_at DESC'
+
+ before_filter :find_all_categories,
+ :only => [:new, :edit, :create, :update]
protected
def find_all_categories
diff --git a/generators/refinery_blog/refinery_blog_generator.rb b/generators/refinery_blog/refinery_blog_generator.rb
index 304ea39..137ecab 100644
--- a/generators/refinery_blog/refinery_blog_generator.rb
+++ b/generators/refinery_blog/refinery_blog_generator.rb
@@ -12,6 +12,17 @@ class RefineryBlogGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
+ if Rails.version < 3
+ matches = Dir[File.expand_path('../../../public/images/**/*', __FILE__)]
+ matches.reject{|d| !File.directory?(d)}.each do |dir|
+ m.directory((%w(public) | dir.split('public/').last.split('/')).join('/'))
+ end
+ matches.reject{|f| File.directory?(f)}.each do |image|
+ path = (%w(public) | image.split('public/').last.split('/'))[0...-1].join('/')
+ m.template "../../../#{path}/#{image.split('/').last}", "#{path}/#{image.split('/').last}"
+ end
+ end
+
m.template('seed.rb', 'db/seeds/refinerycms_blog.rb')
m.migration_template('migration.rb', 'db/migrate',
diff --git a/public/images/refinerycms-blog/icons/cog.png b/public/images/refinerycms-blog/icons/cog.png
new file mode 100644
index 0000000..67de2c6
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/cog.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/comment.png b/public/images/refinerycms-blog/icons/comment.png
new file mode 100644
index 0000000..7bc9233
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/comment.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/comment_cross.png b/public/images/refinerycms-blog/icons/comment_cross.png
new file mode 100644
index 0000000..6f8102d
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/comment_cross.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/comment_tick.png b/public/images/refinerycms-blog/icons/comment_tick.png
new file mode 100644
index 0000000..bcb3ae4
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/comment_tick.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/comments.png b/public/images/refinerycms-blog/icons/comments.png
new file mode 100644
index 0000000..39433cf
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/comments.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/folder.png b/public/images/refinerycms-blog/icons/folder.png
new file mode 100644
index 0000000..784e8fa
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/folder.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/folder_add.png b/public/images/refinerycms-blog/icons/folder_add.png
new file mode 100644
index 0000000..529fe8f
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/folder_add.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/folder_edit.png b/public/images/refinerycms-blog/icons/folder_edit.png
new file mode 100644
index 0000000..ad669cc
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/folder_edit.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/page.png b/public/images/refinerycms-blog/icons/page.png
new file mode 100644
index 0000000..03ddd79
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/page.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/page_add.png b/public/images/refinerycms-blog/icons/page_add.png
new file mode 100644
index 0000000..d5bfa07
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/page_add.png
Binary files differ
diff --git a/public/images/refinerycms-blog/icons/page_copy.png b/public/images/refinerycms-blog/icons/page_copy.png
new file mode 100644
index 0000000..195dc6d
--- /dev/null
+++ b/public/images/refinerycms-blog/icons/page_copy.png
Binary files differ
diff --git a/public/stylesheets/refinerycms-blog.css b/public/stylesheets/refinerycms-blog.css
index 7068160..cc6f582 100644
--- a/public/stylesheets/refinerycms-blog.css
+++ b/public/stylesheets/refinerycms-blog.css
@@ -1,33 +1,33 @@
.comments_icon {
- background-image: url('/images/refinery/icons/comments.png');
+ background-image: url('/images/refinerycms-blog/icons/comments.png');
}
.comment_icon {
- background-image: url('/images/refinery/icons/comment.png');
+ background-image: url('/images/refinerycms-blog/icons/comment.png');
}
.comment_cross_icon {
- background-image: url('/images/refinery/icons/comment_cross.png');
+ background-image: url('/images/refinerycms-blog/icons/comment_cross.png');
}
.comment_tick_icon {
- background-image: url('/images/refinery/icons/comment_tick.png');
+ background-image: url('/images/refinerycms-blog/icons/comment_tick.png');
}
.folder_icon {
- background-image: url('/images/refinery/icons/folder.png');
+ background-image: url('/images/refinerycms-blog/icons/folder.png');
}
.folder_add_icon {
- background-image: url('/images/refinery/icons/folder_add.png');
+ background-image: url('/images/refinerycms-blog/icons/folder_add.png');
}
.folder_edit_icon {
- background-image: url('/images/refinery/icons/folder_edit.png');
+ background-image: url('/images/refinerycms-blog/icons/folder_edit.png');
}
.settings_icon {
- background-image: url('/images/refinery/icons/cog.png');
+ background-image: url('/images/refinerycms-blog/icons/cog.png');
}
.page_icon {
- background-image: url('/images/refinery/icons/page.png');
+ background-image: url('/images/refinerycms-blog/icons/page.png');
}
.page_copy_icon {
- background-image: url('/images/refinery/icons/page_copy.png');
+ background-image: url('/images/refinerycms-blog/icons/page_copy.png');
}
.page_add_icon {
- background-image: url('/images/refinery/icons/page_add.png');
+ background-image: url('/images/refinerycms-blog/icons/page_add.png');
} \ No newline at end of file