diff options
199 files changed, 4325 insertions, 3745 deletions
@@ -14,6 +14,7 @@ doc/* *.autobackupbyrefinery.* /refinerycms-blog*.gem .autotest +spec/dummy # Mac .DS_Store @@ -42,3 +43,11 @@ nbproject # Capybara Bug capybara-*html + +# rvm +.rvmrc + +#rbenv +.rbenv-version + +Gemfile.lock @@ -0,0 +1,3 @@ +--color spec +--drb +--format Fuubar diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cccb3ec --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +before_script: + - "bundle exec rake refinery:testing:dummy_app" +script: "bundle exec rake spec" +notifications: + email: + - parndt@gmail.com + - ugis.ozolss@gmail.com + - joe@joesak.com + - jamie@enmasse.com +env: + - DB=postgres + - DB=mysql + - DB=sqlite3 +rvm: + - 1.8.7 + - 1.9.2 + - 1.9.3 + - rbx + - rbx-2.0 + - ree + - jruby @@ -1,7 +1,59 @@ -source 'http://rubygems.org' +source "http://rubygems.org" + +gemspec + +## Uncomment the following lines to develop against edge refinery +gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git' +gem 'awesome_nested_set', :git => 'git://github.com/collectiveidea/awesome_nested_set.git' group :development, :test do + require 'rbconfig' + gem 'sqlite3' gem 'mysql2' gem 'pg' -end
\ No newline at end of file + + platforms :mswin, :mingw do + gem 'win32console' + gem 'rb-fchange', '~> 0.0.5' + gem 'rb-notifu', '~> 0.0.4' + end + + platforms :ruby do + gem 'spork', '0.9.0.rc9' + gem 'guard-spork' + + unless ENV['TRAVIS'] + if RbConfig::CONFIG['target_os'] =~ /darwin/i + gem 'rb-fsevent', '>= 0.3.9' + gem 'growl', '~> 1.0.3' + end + if RbConfig::CONFIG['target_os'] =~ /linux/i + gem 'rb-inotify', '>= 0.5.1' + gem 'libnotify', '~> 0.1.3' + end + end + end + + platforms :jruby do + unless ENV['TRAVIS'] + if RbConfig::CONFIG['target_os'] =~ /darwin/i + gem 'growl', '~> 1.0.3' + end + if RbConfig::CONFIG['target_os'] =~ /linux/i + gem 'rb-inotify', '>= 0.5.1' + gem 'libnotify', '~> 0.1.3' + end + end + end +end + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.1.0' + gem 'coffee-rails', '~> 3.1.0' + gem 'uglifier' +end + +gem 'jquery-rails' diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..0de2882 --- /dev/null +++ b/Guardfile @@ -0,0 +1,20 @@ +guard 'rspec', :version => 2, :cli => "--format Fuubar --color --drb" do + watch(%r{^spec/.+_spec\.rb$}) + watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } + watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } + 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"] } + watch(%r{^spec/support/(.+)\.rb$}) { "spec" } + watch('spec/spec_helper.rb') { "spec" } + watch('config/routes.rb') { "spec/routing" } + watch('app/controllers/application_controller.rb') { "spec/controllers" } + # Capybara request specs + watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } +end + +guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do + watch('config/application.rb') + watch('config/environment.rb') + watch(%r{^config/environments/.+\.rb$}) + watch(%r{^config/initializers/.+\.rb$}) + watch('spec/spec_helper.rb') +end diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..320b14a --- /dev/null +++ b/Rakefile @@ -0,0 +1,18 @@ +#!/usr/bin/env rake +begin + require 'bundler/setup' +rescue LoadError + puts 'You must `gem install bundler` and `bundle install` to run rake tasks' +end + +ENGINE_PATH = File.dirname(__FILE__) +APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) + +if File.exists?(APP_RAKEFILE) + load 'rails/tasks/engine.rake' +end + +require "refinerycms-testing" +Refinery::Testing::Railtie.load_tasks + +load File.expand_path('../tasks/rspec.rake', __FILE__) diff --git a/public/images/refinerycms-blog/icons/cog.png b/app/assets/images/refinery/blog/icons/cog.png Binary files differindex 67de2c6..67de2c6 100644 --- a/public/images/refinerycms-blog/icons/cog.png +++ b/app/assets/images/refinery/blog/icons/cog.png diff --git a/public/images/refinerycms-blog/icons/comment.png b/app/assets/images/refinery/blog/icons/comment.png Binary files differindex 7bc9233..7bc9233 100644 --- a/public/images/refinerycms-blog/icons/comment.png +++ b/app/assets/images/refinery/blog/icons/comment.png diff --git a/public/images/refinerycms-blog/icons/comment_cross.png b/app/assets/images/refinery/blog/icons/comment_cross.png Binary files differindex 6f8102d..6f8102d 100644 --- a/public/images/refinerycms-blog/icons/comment_cross.png +++ b/app/assets/images/refinery/blog/icons/comment_cross.png diff --git a/public/images/refinerycms-blog/icons/comment_tick.png b/app/assets/images/refinery/blog/icons/comment_tick.png Binary files differindex bcb3ae4..bcb3ae4 100644 --- a/public/images/refinerycms-blog/icons/comment_tick.png +++ b/app/assets/images/refinery/blog/icons/comment_tick.png diff --git a/public/images/refinerycms-blog/icons/comments.png b/app/assets/images/refinery/blog/icons/comments.png Binary files differindex 39433cf..39433cf 100644 --- a/public/images/refinerycms-blog/icons/comments.png +++ b/app/assets/images/refinery/blog/icons/comments.png diff --git a/public/images/refinerycms-blog/icons/down.gif b/app/assets/images/refinery/blog/icons/down.gif Binary files differindex 990bd87..990bd87 100644 --- a/public/images/refinerycms-blog/icons/down.gif +++ b/app/assets/images/refinery/blog/icons/down.gif diff --git a/public/images/refinerycms-blog/icons/folder.png b/app/assets/images/refinery/blog/icons/folder.png Binary files differindex 784e8fa..784e8fa 100644 --- a/public/images/refinerycms-blog/icons/folder.png +++ b/app/assets/images/refinery/blog/icons/folder.png diff --git a/public/images/refinerycms-blog/icons/folder_add.png b/app/assets/images/refinery/blog/icons/folder_add.png Binary files differindex 529fe8f..529fe8f 100644 --- a/public/images/refinerycms-blog/icons/folder_add.png +++ b/app/assets/images/refinery/blog/icons/folder_add.png diff --git a/public/images/refinerycms-blog/icons/folder_edit.png b/app/assets/images/refinery/blog/icons/folder_edit.png Binary files differindex ad669cc..ad669cc 100644 --- a/public/images/refinerycms-blog/icons/folder_edit.png +++ b/app/assets/images/refinery/blog/icons/folder_edit.png diff --git a/public/images/refinerycms-blog/icons/page.png b/app/assets/images/refinery/blog/icons/page.png Binary files differindex 03ddd79..03ddd79 100644 --- a/public/images/refinerycms-blog/icons/page.png +++ b/app/assets/images/refinery/blog/icons/page.png diff --git a/public/images/refinerycms-blog/icons/page_add.png b/app/assets/images/refinery/blog/icons/page_add.png Binary files differindex d5bfa07..d5bfa07 100644 --- a/public/images/refinerycms-blog/icons/page_add.png +++ b/app/assets/images/refinery/blog/icons/page_add.png diff --git a/public/images/refinerycms-blog/icons/page_copy.png b/app/assets/images/refinery/blog/icons/page_copy.png Binary files differindex 195dc6d..195dc6d 100644 --- a/public/images/refinerycms-blog/icons/page_copy.png +++ b/app/assets/images/refinery/blog/icons/page_copy.png diff --git a/public/images/refinerycms-blog/icons/up.gif b/app/assets/images/refinery/blog/icons/up.gif Binary files differindex 1edf617..1edf617 100644 --- a/public/images/refinerycms-blog/icons/up.gif +++ b/app/assets/images/refinery/blog/icons/up.gif diff --git a/public/images/refinerycms-blog/rss-feed.png b/app/assets/images/refinery/blog/rss-feed.png Binary files differindex b3c949d..b3c949d 100755 --- a/public/images/refinerycms-blog/rss-feed.png +++ b/app/assets/images/refinery/blog/rss-feed.png diff --git a/app/assets/images/refinerycms-blog/.gitkeep b/app/assets/images/refinerycms-blog/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/assets/images/refinerycms-blog/.gitkeep diff --git a/public/javascripts/refinery/refinerycms-blog.js b/app/assets/javascripts/refinery/blog/backend.js index e730c6f..695cdb7 100644 --- a/public/javascripts/refinery/refinerycms-blog.js +++ b/app/assets/javascripts/refinery/blog/backend.js @@ -47,4 +47,69 @@ $(document).ready(function(){ }, $(this))); e.preventDefault(); }); -});
\ No newline at end of file + + + $(function() { + $('#page-tabs').tabs(); + $('#copy_body_link').click(function(event) { + // Find the WYMEditor that maps to the custom_teaser field + var teaserTextArea = $('#blog_post_custom_teaser')[0]; + var teaserEditor = null; + $.each(WYMeditor.INSTANCES, function(index, editor) { + if (editor._element[0] == teaserTextArea) { + teaserEditor = editor; + } + }); + + if (teaserEditor) { + teaserEditor.html($('#blog_post_body').attr('value')); + } + + event.preventDefault(); + }); + }); + + + function split( val ) { + return val.split( /,\s*/ ); + } + function extractLast( term ) { + return split( term ).pop(); + } + + page_options.init(false, '', '') + + $('<%= dom_id %>').bind( "keydown", function( event ) { + if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { + event.preventDefault() + } + }).autocomplete({ + source: function( request, response ) { + $.getJSON( "<%= url %>", { + term: extractLast( request.term ) + }, response ); + }, + search: function() { + // custom minLength + var term = extractLast( this.value ); + if ( term.length < 2 ) { + return false; + } + }, + focus: function() { + // prevent value inserted on focus + return false; + }, + select: function( event, ui ) { + var terms = split( this.value ); + // remove the current input + terms.pop(); + // add the selected item + terms.push( ui.item.value ); + // add placeholder to get the comma-and-space at the end + terms.push( "" ); + this.value = terms.join( ", " ); + return false; + } + }) +}); diff --git a/public/javascripts/refinerycms-blog.js b/app/assets/javascripts/refinery/blog/frontend.js index 269f70f..269f70f 100644 --- a/public/javascripts/refinerycms-blog.js +++ b/app/assets/javascripts/refinery/blog/frontend.js diff --git a/app/assets/javascripts/refinerycms-blog/.gitkeep b/app/assets/javascripts/refinerycms-blog/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/assets/javascripts/refinerycms-blog/.gitkeep diff --git a/app/assets/stylesheets/refinery/blog/backend.css.scss b/app/assets/stylesheets/refinery/blog/backend.css.scss new file mode 100644 index 0000000..7e2a841 --- /dev/null +++ b/app/assets/stylesheets/refinery/blog/backend.css.scss @@ -0,0 +1,73 @@ +.comments_icon { + background-image: image_url('refinery/blog/icons/comments.png'); +} +.comment_icon { + background-image: image_url('refinery/blog/icons/comment.png'); +} +.comment_cross_icon { + background-image: image_url('refinery/blog/icons/comment_cross.png'); +} +.comment_tick_icon { + background-image: image_url('refinery/blog/icons/comment_tick.png'); +} +.folder_icon { + background-image: image_url('refinery/blog/icons/folder.png'); +} +.folder_add_icon { + background-image: image_url('refinery/blog/icons/folder_add.png'); +} +.folder_edit_icon { + background-image: image_url('refinery/blog/icons/folder_edit.png'); +} +.settings_icon { + background-image: image_url('refinery/blog/icons/cog.png'); +} +.page_icon { + background-image: image_url('refinery/blog/icons/page.png'); +} +.page_copy_icon { + background-image: image_url('refinery/blog/icons/page_copy.png'); +} +.page_add_icon { + background-image: image_url('refinery/blog/icons/page_add.png'); +} +ul.collapsible_menu li { + position: relative; +} +ul.collapsible_menu li span.arrow { + background-repeat: no-repeat; + position: absolute; + right: 10px; + top: 13px; + width: 11px; + height: 7px; + cursor: pointer; +} +ul.collapsible_menu li span.arrow { + background-image: image_url('refinery/blog/icons/up.gif'); +} +ul.collapsible_menu li.closed span.arrow { + background-image: image_url('refinery/blog/icons/down.gif'); +} +ul.collapsible_menu > div { + width: 93%; + margin: 0px auto; +} +ul.blog_categories{ + height:200px; + overflow:auto; + border:1px solid #ccc; + padding:5px; +} +ul.blog_categories, ul.blog_categories li { + list-style: none; + margin:5px 0; +} +a#copy_body_link { + background: image_url('refinery/blog/icons/add.png') no-repeat scroll 0 6px transparent; + border-bottom: 0 none; + display: inline; + line-height: 29px; + margin-top: 0; + padding-left: 20px; +} diff --git a/public/stylesheets/refinerycms-blog.css b/app/assets/stylesheets/refinery/blog/frontend.css.scss index ef6f224..65cecd0 100644 --- a/public/stylesheets/refinerycms-blog.css +++ b/app/assets/stylesheets/refinery/blog/frontend.css.scss @@ -22,7 +22,7 @@ #rss_feed_subscribe { display: block; padding-left: 25px; - background: url('/images/refinerycms-blog/rss-feed.png') no-repeat; + background: image_url('refinery/blog/rss-feed.png') no-repeat; } #next_prev_article{ overflow:hidden; @@ -58,7 +58,7 @@ .flash_notice, .flash_message { border: 1px solid #00A017; color: #00A017; - background: 7px 7px no-repeat url('/images/refinery/icons/accept.png') #E0F5E0; + background: 7px 7px no-repeat image_url('refinery/blog/icons/accept.png') #E0F5E0; } .flash_notice, .flash_notice * { color: #00A017; @@ -66,7 +66,7 @@ .flash_error { border: 1px solid #A00027; color: #A00027; - background: 7px 7px no-repeat url('/images/refinery/icons/cancel.png') #FFB1B1; + background: 7px 7px no-repeat image_url('refinery/blog/icons/cancel.png') #FFB1B1; } .flash.flash_notice #flash_close, .flash.flash_error #flash_close { text-transform: lowercase; diff --git a/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png Binary files differindex 954e22d..954e22d 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png Binary files differindex 64ece57..64ece57 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_flat_10_000000_40x100.png Binary files differindex abdc010..abdc010 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_flat_10_000000_40x100.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png Binary files differindex 9b383f4..9b383f4 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png Binary files differindex a23baad..a23baad 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png Binary files differindex 42ccba2..42ccba2 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png Binary files differindex 39d5824..39d5824 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png Binary files differindex f127367..f127367 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png diff --git a/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png Binary files differindex 359397a..359397a 100755 --- a/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png diff --git a/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_222222_256x240.png Binary files differindex b273ff1..b273ff1 100755 --- a/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_222222_256x240.png diff --git a/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_228ef1_256x240.png Binary files differindex a641a37..a641a37 100755 --- a/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_228ef1_256x240.png diff --git a/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ef8c08_256x240.png Binary files differindex 85e63e9..85e63e9 100755 --- a/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ef8c08_256x240.png diff --git a/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffd27a_256x240.png Binary files differindex e117eff..e117eff 100755 --- a/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffd27a_256x240.png diff --git a/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffffff_256x240.png Binary files differindex 42f8f99..42f8f99 100755 --- a/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffffff_256x240.png diff --git a/public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css b/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss index f9a1401..f9a1401 100755 --- a/public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss diff --git a/app/assets/stylesheets/refinerycms-blog/.gitkeep b/app/assets/stylesheets/refinerycms-blog/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/assets/stylesheets/refinerycms-blog/.gitkeep diff --git a/app/controllers/.gitkeep b/app/controllers/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/controllers/.gitkeep diff --git a/app/controllers/admin/blog/categories_controller.rb b/app/controllers/admin/blog/categories_controller.rb deleted file mode 100644 index 6933c44..0000000 --- a/app/controllers/admin/blog/categories_controller.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Admin - module Blog - class CategoriesController < Admin::BaseController - - crudify :blog_category, - :title_attribute => :title, - :order => 'title ASC' - - end - end -end diff --git a/app/controllers/admin/blog/comments_controller.rb b/app/controllers/admin/blog/comments_controller.rb deleted file mode 100644 index 1868206..0000000 --- a/app/controllers/admin/blog/comments_controller.rb +++ /dev/null @@ -1,40 +0,0 @@ -module Admin - module Blog - class CommentsController < Admin::BaseController - - crudify :blog_comment, - :title_attribute => :name, - :order => 'published_at DESC' - - def index - @blog_comments = BlogComment.unmoderated - render :action => 'index' - end - - def approved - unless params[:id].present? - @blog_comments = BlogComment.approved - render :action => 'index' - else - @blog_comment = BlogComment.find(params[:id]) - @blog_comment.approve! - flash[:notice] = t('approved', :scope => 'admin.blog.comments', :author => @blog_comment.name) - redirect_to :action => params[:return_to] || 'index' - end - end - - def rejected - unless params[:id].present? - @blog_comments = BlogComment.rejected - render :action => 'index' - else - @blog_comment = BlogComment.find(params[:id]) - @blog_comment.reject! - flash[:notice] = t('rejected', :scope => 'admin.blog.comments', :author => @blog_comment.name) - redirect_to :action => params[:return_to] || 'index' - end - end - - end - end -end
\ No newline at end of file diff --git a/app/controllers/admin/blog/posts_controller.rb b/app/controllers/admin/blog/posts_controller.rb deleted file mode 100644 index b2f2a79..0000000 --- a/app/controllers/admin/blog/posts_controller.rb +++ /dev/null @@ -1,97 +0,0 @@ -module Admin - module Blog - class PostsController < Admin::BaseController - require 'will_paginate/array' - - crudify :blog_post, - :title_attribute => :title, - :order => 'published_at DESC' - - def uncategorized - @blog_posts = BlogPost.uncategorized.paginate({ - :page => params[:page], - :per_page => BlogPost.per_page - }) - end - - def tags - op = case ActiveRecord::Base.connection.adapter_name.downcase - when 'postgresql' - '~*' - else - 'LIKE' - end - wildcard = case ActiveRecord::Base.connection.adapter_name.downcase - when 'postgresql' - '.*' - else - '%' - end - @tags = BlogPost.tag_counts_on(:tags).where( - ["tags.name #{op} ?", "#{wildcard}#{params[:term].to_s.downcase}#{wildcard}"] - ).map { |tag| {:id => tag.id, :value => tag.name}} - render :json => @tags.flatten - end - - def create - # if the position field exists, set this object as last object, given the conditions of this class. - if BlogPost.column_names.include?("position") - params[:blog_post].merge!({ - :position => ((BlogPost.maximum(:position, :conditions => "")||-1) + 1) - }) - end - - if BlogPost.column_names.include?("user_id") - params[:blog_post].merge!({ - :user_id => current_user.id - }) - end - - if (@blog_post = BlogPost.create(params[:blog_post])).valid? - (request.xhr? ? flash.now : flash).notice = t( - 'refinery.crudify.created', - :what => "'#{@blog_post.title}'" - ) - - unless from_dialog? - unless params[:continue_editing] =~ /true|on|1/ - redirect_back_or_default(admin_blog_posts_url) - else - unless request.xhr? - redirect_to :back - else - render :partial => "/shared/message" - end - end - else - render :text => "<script>parent.window.location = '#{admin_blog_posts_url}';</script>" - end - else - unless request.xhr? - render :action => 'new' - else - render :partial => "/shared/admin/error_messages", - :locals => { - :object => @blog_post, - :include_object_name => true - } - end - end - end - - before_filter :find_all_categories, - :only => [:new, :edit, :create, :update] - - before_filter :check_category_ids, :only => :update - - protected - def find_all_categories - @blog_categories = BlogCategory.find(:all) - end - - def check_category_ids - params[:blog_post][:category_ids] ||= [] - end - end - end -end diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb deleted file mode 100644 index 5f2b3be..0000000 --- a/app/controllers/admin/blog/settings_controller.rb +++ /dev/null @@ -1,53 +0,0 @@ -module Admin - module Blog - class SettingsController < Admin::BaseController - - def notification_recipients - @recipients = BlogComment::Notification.recipients - - if request.post? - BlogComment::Notification.recipients = params[:recipients] - flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients', - :recipients => BlogComment::Notification.recipients) - unless request.xhr? or from_dialog? - redirect_back_or_default(admin_blog_posts_path) - else - render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_posts_path}';</script>", - :layout => false - end - end - end - - def moderation - enabled = BlogComment::Moderation.toggle! - unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) - else - render :json => {:enabled => enabled}, - :layout => false - end - end - - def comments - enabled = BlogComment.toggle! - unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) - else - render :json => {:enabled => enabled}, - :layout => false - end - end - - def teasers - enabled = BlogPost.teaser_enabled_toggle! - unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) - else - render :json => {:enabled => enabled}, - :layout => false - end - end - - end - end -end
\ No newline at end of file diff --git a/app/controllers/blog/categories_controller.rb b/app/controllers/blog/categories_controller.rb deleted file mode 100644 index efda778..0000000 --- a/app/controllers/blog/categories_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Blog - class CategoriesController < BlogController - - def show - @category = BlogCategory.find(params[:id]) - @blog_posts = @category.posts.live.includes(:comments, :categories).paginate({ - :page => params[:page], - :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) - }) - end - - end -end
\ No newline at end of file diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb deleted file mode 100644 index 7eb167d..0000000 --- a/app/controllers/blog/posts_controller.rb +++ /dev/null @@ -1,109 +0,0 @@ -module Blog - class PostsController < BlogController - - before_filter :find_all_blog_posts, :except => [:archive] - before_filter :find_blog_post, :only => [:show, :comment, :update_nav] - before_filter :find_tags - - respond_to :html, :js, :rss - - def index - # Rss feeders are greedy. Let's give them every blog post instead of paginating. - (@blog_posts = BlogPost.live.includes(:comments, :categories).all) if request.format.rss? - respond_with (@blog_posts) do |format| - format.html - format.rss - end - end - - def show - @blog_comment = BlogComment.new - @canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical? - - respond_with (@blog_post) do |format| - format.html { present(@blog_post) } - format.js { render :partial => 'post', :layout => false } - end - end - - def comment - if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid? - if BlogComment::Moderation.enabled? or @blog_comment.ham? - begin - Blog::CommentMailer.notification(@blog_comment, request).deliver - rescue - logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" - end - end - - if BlogComment::Moderation.enabled? - flash[:notice] = t('thank_you_moderated', :scope => 'blog.posts.comments') - redirect_to blog_post_url(params[:id]) - else - flash[:notice] = t('thank_you', :scope => 'blog.posts.comments') - redirect_to blog_post_url(params[:id], - :anchor => "comment-#{@blog_comment.to_param}") - end - else - render :action => 'show' - end - end - - def archive - if params[:month].present? - date = "#{params[:month]}/#{params[:year]}" - @archive_date = Time.parse(date) - @date_title = @archive_date.strftime('%B %Y') - @blog_posts = BlogPost.live.by_archive(@archive_date).paginate({ - :page => params[:page], - :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) - }) - else - date = "01/#{params[:year]}" - @archive_date = Time.parse(date) - @date_title = @archive_date.strftime('%Y') - @blog_posts = BlogPost.live.by_year(@archive_date).paginate({ - :page => params[:page], - :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) - }) - end - respond_with (@blog_posts) - end - - def tagged - @tag = ActsAsTaggableOn::Tag.find(params[:tag_id]) - @tag_name = @tag.name - @blog_posts = BlogPost.tagged_with(@tag_name).paginate({ - :page => params[:page], - :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) - }) - end - - protected - - def find_blog_post - unless (@blog_post = BlogPost.find(params[:id])).try(:live?) - if refinery_user? and current_user.authorized_plugins.include?("refinerycms_blog") - @blog_post = BlogPost.find(params[:id]) - else - error_404 - end - end - end - - def find_all_blog_posts - @blog_posts = BlogPost.live.includes(:comments, :categories).paginate({ - :page => params[:page], - :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) - }) - end - - def find_tags - @tags = BlogPost.tag_counts_on(:tags) - end - - def canonical? - ::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale - end - end -end
\ No newline at end of file diff --git a/app/controllers/blog_controller.rb b/app/controllers/blog_controller.rb deleted file mode 100644 index f51d5bb..0000000 --- a/app/controllers/blog_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class BlogController < ApplicationController - - helper :blog_posts - before_filter :find_page, :find_all_blog_categories - -protected - - def find_page - @page = Page.find_by_link_url("/blog") - end - - def find_all_blog_categories - @blog_categories = BlogCategory.all - end - -end diff --git a/app/controllers/refinery/admin/blog/categories_controller.rb b/app/controllers/refinery/admin/blog/categories_controller.rb new file mode 100644 index 0000000..0fe4eec --- /dev/null +++ b/app/controllers/refinery/admin/blog/categories_controller.rb @@ -0,0 +1,13 @@ +module Refinery + module Admin + module Blog + class CategoriesController < ::Refinery::AdminController + + crudify :'refinery/blog/category', + :title_attribute => :title, + :order => 'title ASC' + + end + end + end +end diff --git a/app/controllers/refinery/admin/blog/comments_controller.rb b/app/controllers/refinery/admin/blog/comments_controller.rb new file mode 100644 index 0000000..6c1417e --- /dev/null +++ b/app/controllers/refinery/admin/blog/comments_controller.rb @@ -0,0 +1,49 @@ +module Refinery + module Admin + module Blog + class CommentsController < ::Refinery::AdminController + + cache_sweeper Refinery::BlogSweeper + + crudify :'refinery/blog/comment', + :title_attribute => :name, + :order => 'published_at DESC' + + def index + @blog_comments = Refinery::Blog::Comment.unmoderated.page(params[:page]) + + render :action => 'index' + end + + def approved + unless params[:id].present? + @blog_comments = Refinery::Blog::Comment.approved.page(params[:page]) + + render :action => 'index' + else + @blog_comment = Refinery::Blog::Comment.find(params[:id]) + @blog_comment.approve! + flash[:notice] = t('approved', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name) + + redirect_to main_app.url_for(:action => params[:return_to] || 'index') + end + end + + def rejected + unless params[:id].present? + @blog_comments = Refinery::Blog::Comment.rejected.page(params[:page]) + + render :action => 'index' + else + @blog_comment = Refinery::Blog::Comment.find(params[:id]) + @blog_comment.reject! + flash[:notice] = t('rejected', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name) + + redirect_to main_app.url_for(:action => params[:return_to] || 'index') + end + end + + end + end + end +end diff --git a/app/controllers/refinery/admin/blog/posts_controller.rb b/app/controllers/refinery/admin/blog/posts_controller.rb new file mode 100644 index 0000000..8b3816d --- /dev/null +++ b/app/controllers/refinery/admin/blog/posts_controller.rb @@ -0,0 +1,94 @@ +module Refinery + module Admin + module Blog + class PostsController < ::Refinery::AdminController + + cache_sweeper Refinery::BlogSweeper + + crudify :'refinery/blog/post', + :title_attribute => :title, + :order => 'published_at DESC', + :redirect_to_url => "main_app.refinery_admin_blog_posts_path" + + before_filter :find_all_categories, + :only => [:new, :edit, :create, :update] + + before_filter :check_category_ids, :only => :update + + def uncategorized + @blog_posts = Refinery::Blog::Post.uncategorized.page(params[:page]) + end + + def tags + if ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql' + op = '~*' + wildcard = '.*' + else + op = 'LIKE' + wildcard = '%' + end + + @tags = Refinery::Blog::Post.tag_counts_on(:tags).where( + ["tags.name #{op} ?", "#{wildcard}#{params[:term].to_s.downcase}#{wildcard}"] + ).map { |tag| {:id => tag.id, :value => tag.name}} + render :json => @tags.flatten + end + + def create + # if the position field exists, set this object as last object, given the conditions of this class. + if Refinery::Blog::Post.column_names.include?("position") + params[:blog_post].merge!({ + :position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1) + }) + end + + if Refinery::Blog::Post.column_names.include?("user_id") + params[:blog_post].merge!({ + :user_id => current_refinery_user.id + }) + end + + if (@blog_post = Refinery::Blog::Post.create(params[:blog_post])).valid? + (request.xhr? ? flash.now : flash).notice = t( + 'refinery.crudify.created', + :what => "'#{@blog_post.title}'" + ) + + unless from_dialog? + unless params[:continue_editing] =~ /true|on|1/ + redirect_back_or_default(main_app.refinery_admin_blog_posts_path) + else + unless request.xhr? + redirect_to :back + else + render :partial => "/shared/message" + end + end + else + render :text => "<script>parent.window.location = '#{admin_blog_posts_url}';</script>" + end + else + unless request.xhr? + render :action => 'new' + else + render :partial => "/refinery/admin/error_messages", + :locals => { + :object => @blog_post, + :include_object_name => true + } + end + end + end + + protected + def find_all_categories + @blog_categories = Refinery::Blog::Category.find(:all) + end + + def check_category_ids + params[:blog_post][:category_ids] ||= [] + end + end + end + end +end diff --git a/app/controllers/refinery/admin/blog/settings_controller.rb b/app/controllers/refinery/admin/blog/settings_controller.rb new file mode 100644 index 0000000..ee71393 --- /dev/null +++ b/app/controllers/refinery/admin/blog/settings_controller.rb @@ -0,0 +1,55 @@ +module Refinery + module Admin + module Blog + class SettingsController < ::Refinery::AdminController + + def notification_recipients + @recipients = Refinery::Blog::Comment::Notification.recipients + + if request.post? + Refinery::Blog::Comment::Notification.recipients = params[:recipients] + flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients', + :recipients => Refinery::Blog::Comment::Notification.recipients) + unless request.xhr? or from_dialog? + redirect_back_or_default(admin_blog_posts_path) + else + render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_posts_path}';</script>", + :layout => false + end + end + end + + def moderation + enabled = Refinery::Blog::Comment::Moderation.toggle! + unless request.xhr? + redirect_back_or_default(admin_blog_posts_path) + else + render :json => {:enabled => enabled}, + :layout => false + end + end + + def comments + enabled = Refinery::Blog::Comment.toggle! + unless request.xhr? + redirect_back_or_default(admin_blog_posts_path) + else + render :json => {:enabled => enabled}, + :layout => false + end + end + + def teasers + enabled = Refinery::Blog::Post.teaser_enabled_toggle! + unless request.xhr? + redirect_back_or_default(admin_blog_posts_path) + else + render :json => {:enabled => enabled}, + :layout => false + end + end + + end + end + end +end diff --git a/app/controllers/refinery/blog/base_controller.rb b/app/controllers/refinery/blog/base_controller.rb new file mode 100644 index 0000000..919c180 --- /dev/null +++ b/app/controllers/refinery/blog/base_controller.rb @@ -0,0 +1,17 @@ +module Refinery + module Blog + class BaseController < ::ApplicationController + + include ControllerHelper + + helper :'refinery/blog/posts' + before_filter :find_page, :find_all_blog_categories + + protected + + def find_page + @page = Refinery::Page.find_by_link_url("/blog") + end + end + end +end diff --git a/app/controllers/refinery/blog/categories_controller.rb b/app/controllers/refinery/blog/categories_controller.rb new file mode 100644 index 0000000..60c8346 --- /dev/null +++ b/app/controllers/refinery/blog/categories_controller.rb @@ -0,0 +1,12 @@ +module Refinery + module Blog + class CategoriesController < BaseController + + def show + @blog_category = Refinery::Blog::Category.find(params[:id]) + @blog_posts = @blog_category.posts.live.includes(:comments, :categories).page(params[:page]) + end + + end + end +end diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb new file mode 100644 index 0000000..1c8cffd --- /dev/null +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -0,0 +1,82 @@ +module Refinery + module Blog + class PostsController < BaseController + + caches_page :index + + before_filter :find_all_blog_posts, :except => [:archive] + before_filter :find_blog_post, :only => [:show, :comment, :update_nav] + before_filter :find_tags + + respond_to :html, :js, :rss + + def index + # Rss feeders are greedy. Let's give them every blog post instead of paginating. + (@blog_posts = Refinery::Blog::Post.live.includes(:comments, :categories).all) if request.format.rss? + respond_with (@blog_posts) do |format| + format.html + format.rss + end + end + + def show + @blog_comment = Refinery::Blog::Comment.new + + @canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical? + + respond_with (@blog_post) do |format| + format.html { present(@blog_post) } + format.js { render :partial => 'post', :layout => false } + end + end + + def comment + if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid? + if Refinery::Blog::Comment::Moderation.enabled? or @blog_comment.ham? + begin + Refinery::Blog::CommentMailer.notification(@blog_comment, request).deliver + rescue + logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" + end + end + + if Refinery::Blog::Comment::Moderation.enabled? + flash[:notice] = t('thank_you_moderated', :scope => 'refinery.blog.posts.comments') + redirect_to main_app.blog_post_url(params[:id]) + else + flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments') + redirect_to main_app.blog_post_url(params[:id], + :anchor => "comment-#{@blog_comment.to_param}") + end + else + render :action => 'show' + end + end + + def archive + if params[:month].present? + date = "#{params[:month]}/#{params[:year]}" + @archive_date = Time.parse(date) + @date_title = @archive_date.strftime('%B %Y') + @blog_posts = Refinery::Blog::Post.live.by_archive(@archive_date).page(params[:page]) + else + date = "01/#{params[:year]}" + @archive_date = Time.parse(date) + @date_title = @archive_date.strftime('%Y') + @blog_posts = Refinery::Blog::Post.live.by_year(@archive_date).page(params[:page]) + end + respond_with (@blog_posts) + end + + def tagged + @tag = ActsAsTaggableOn::Tag.find(params[:tag_id]) + @tag_name = @tag.name + @blog_posts = Refinery::Blog::Post.tagged_with(@tag_name).page(params[:page]) + end + + def canonical? + ::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale + end + end + end +end diff --git a/app/helpers/.gitkeep b/app/helpers/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/helpers/.gitkeep diff --git a/app/helpers/blog_posts_helper.rb b/app/helpers/blog_posts_helper.rb deleted file mode 100644 index 0848632..0000000 --- a/app/helpers/blog_posts_helper.rb +++ /dev/null @@ -1,59 +0,0 @@ -module BlogPostsHelper - def blog_archive_list - posts = BlogPost.select('published_at').all_previous - return nil if posts.blank? - html = '<section id="blog_archive_list"><h2>' - html << t('archives', :scope => 'blog.shared') - html << '</h2><nav><ul>' - links = [] - super_old_links = [] - - posts.each do |e| - if e.published_at >= Time.now.end_of_year.advance(:years => -3) - links << e.published_at.strftime('%m/%Y') - else - super_old_links << e.published_at.strftime('01/%Y') - end - end - links.uniq! - super_old_links.uniq! - links.each do |l| - year = l.split('/')[1] - month = l.split('/')[0] - count = BlogPost.by_archive(Time.parse(l)).size - text = t("date.month_names")[month.to_i] + " #{year} (#{count})" - html << "<li>" - html << link_to(text, archive_blog_posts_path(:year => year, :month => month)) - html << "</li>" - end - super_old_links.each do |l| - year = l.split('/')[1] - count = BlogPost.by_year(Time.parse(l)).size - text = "#{year} (#{count})" - html << "<li>" - html << link_to(text, archive_blog_posts_path(:year => year)) - html << "</li>" - end - html << '</ul></nav></section>' - html.html_safe - end - - def next_or_previous?(post) - post.next.present? or post.prev.present? - end - - def blog_post_teaser_enabled? - BlogPost.teasers_enabled? - end - - def blog_post_teaser(post) - if post.respond_to?(:custom_teaser) && post.custom_teaser.present? - post.custom_teaser.html_safe - else - truncate(post.body, { - :length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250), - :preserve_html_tags => true - }).html_safe - end - end -end diff --git a/app/helpers/refinery/blog/controller_helper.rb b/app/helpers/refinery/blog/controller_helper.rb new file mode 100644 index 0000000..035275c --- /dev/null +++ b/app/helpers/refinery/blog/controller_helper.rb @@ -0,0 +1,30 @@ +module Refinery + module Blog + module ControllerHelper + + protected + + def find_blog_post + unless (@blog_post = Refinery::Blog::Post.find(params[:id])).try(:live?) + if refinery_user? and current_refinery_user.authorized_plugins.include?("refinerycms_blog") + @blog_post = Refinery::Blog::Post.find(params[:id]) + else + error_404 + end + end + end + + def find_all_blog_posts + @blog_posts = Refinery::Blog::Post.live.includes(:comments, :categories).page(params[:page]) + end + + def find_tags + @tags = Refinery::Blog::Post.tag_counts_on(:tags) + end + + def find_all_blog_categories + @blog_categories = Refinery::Blog::Category.all + end + end + end +end diff --git a/app/helpers/refinery/blog/posts_helper.rb b/app/helpers/refinery/blog/posts_helper.rb new file mode 100644 index 0000000..418f360 --- /dev/null +++ b/app/helpers/refinery/blog/posts_helper.rb @@ -0,0 +1,51 @@ +module Refinery + module Blog + module PostsHelper + def blog_archive_widget + posts = Refinery::Blog::Post.select('published_at').all_previous + return nil if posts.blank? + + render :partial => "/refinery/blog/widgets/blog_archive", :locals => { :posts => posts } + end + alias_method :blog_archive_list, :blog_archive_widget + + def next_or_previous?(post) + post.next.present? or post.prev.present? + end + + def blog_post_teaser_enabled? + Refinery::Blog::Post.teasers_enabled? + end + + def blog_post_teaser(post) + if post.respond_to?(:custom_teaser) && post.custom_teaser.present? + post.custom_teaser.html_safe + else + truncate(post.body, { + :length => Refinery::Setting.find_or_set(:blog_post_teaser_length, 250), + :preserve_html_tags => true + }).html_safe + end + end + + def archive_link(post) + if post.published_at >= Time.now.end_of_year.advance(:years => -3) + post_date = post.published_at.strftime('%m/%Y') + year = post_date.split('/')[1] + month = post_date.split('/')[0] + count = Blog::Post.by_archive(Time.parse(post_date)).size + text = t("date.month_names")[month.to_i] + " #{year} (#{count})" + + link_to(text, main_app.archive_blog_posts_path(:year => year, :month => month)) + else + post_date = post.published_at.strftime('01/%Y') + year = post_date.split('/')[1] + count = Refinery::Blog::Post.by_year(Time.parse(post_date)).size + text = "#{year} (#{count})" + + link_to(text, main_app.archive_blog_posts_path(:year => year)) + end + end + end + end +end
\ No newline at end of file diff --git a/app/mailers/blog/comment_mailer.rb b/app/mailers/blog/comment_mailer.rb deleted file mode 100644 index 3710ea1..0000000 --- a/app/mailers/blog/comment_mailer.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Blog - class CommentMailer < ActionMailer::Base - - def notification(comment, request) - subject BlogComment::Notification.subject - recipients BlogComment::Notification.recipients - from "\"#{RefinerySetting[:site_name]}\" <no-reply@#{request.domain(RefinerySetting.find_or_set(:tld_length, 1))}>" - sent_on Time.now - @comment = comment - end - - end -end
\ No newline at end of file diff --git a/app/mailers/refinery/blog/comment_mailer.rb b/app/mailers/refinery/blog/comment_mailer.rb new file mode 100644 index 0000000..dabc9e6 --- /dev/null +++ b/app/mailers/refinery/blog/comment_mailer.rb @@ -0,0 +1,15 @@ +module Refinery + module Blog + class CommentMailer < ActionMailer::Base + + def notification(comment, request) + subject Blog::Comment::Notification.subject + recipients Blog::Comment::Notification.recipients + from "\"#{RefinerySetting[:site_name]}\" <no-reply@#{request.domain(RefinerySetting.find_or_set(:tld_length, 1))}>" + sent_on Time.now + @blog_comment = comment + end + + end + end +end diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/models/.gitkeep diff --git a/app/models/blog/comment_mailer.rb b/app/models/blog/comment_mailer.rb deleted file mode 100644 index acef313..0000000 --- a/app/models/blog/comment_mailer.rb +++ /dev/null @@ -1 +0,0 @@ -require File.expand_path('../../../mailers/blog/comment_mailer', __FILE__) diff --git a/app/models/blog_category.rb b/app/models/blog_category.rb deleted file mode 100644 index b66a94d..0000000 --- a/app/models/blog_category.rb +++ /dev/null @@ -1,19 +0,0 @@ -class BlogCategory < ActiveRecord::Base - - has_many :categorizations, :dependent => :destroy - has_many :posts, :through => :categorizations, :source => :blog_post - - acts_as_indexed :fields => [:title] - - validates :title, :presence => true, :uniqueness => true - - has_friendly_id :title, :use_slug => true, - :default_locale => (::Refinery::I18n.default_frontend_locale rescue :en), - :approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => 'blog'), - :strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, false, :scoping => 'blog') - - def post_count - posts.select(&:live?).count - end - -end diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb deleted file mode 100644 index 6216cc2..0000000 --- a/app/models/blog_comment.rb +++ /dev/null @@ -1,131 +0,0 @@ -class BlogComment < ActiveRecord::Base - - attr_accessible :name, :email, :message - - filters_spam :author_field => :name, - :email_field => :email, - :message_field => :body - - belongs_to :post, :class_name => 'BlogPost', :foreign_key => 'blog_post_id' - - acts_as_indexed :fields => [:name, :email, :message] - - alias_attribute :message, :body - - validates :name, :message, :presence => true - validates :email, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i } - - scope :unmoderated, :conditions => {:state => nil} - scope :approved, :conditions => {:state => 'approved'} - scope :rejected, :conditions => {:state => 'rejected'} - - def avatar_url(options = {}) - options = {:size => 60} - require 'digest/md5' - size = ("?s=#{options[:size]}" if options[:size]) - "http://gravatar.com/avatar/#{Digest::MD5.hexdigest(self.email.to_s.strip.downcase)}#{size}.jpg" - end - - def approve! - self.update_attribute(:state, 'approved') - end - - def reject! - self.update_attribute(:state, 'rejected') - end - - def rejected? - self.state == 'rejected' - end - - def approved? - self.state == 'approved' - end - - def unmoderated? - self.state.nil? - end - - def self.toggle! - currently = RefinerySetting.find_or_set(:comments_allowed, true, { - :scoping => 'blog' - }) - RefinerySetting.set(:comments_allowed, {:value => !currently, :scoping => 'blog'}) - end - - before_create do |comment| - unless BlogComment::Moderation.enabled? - comment.state = comment.ham? ? 'approved' : 'rejected' - end - end - - module Moderation - class << self - def enabled? - RefinerySetting.find_or_set(:comment_moderation, true, { - :scoping => 'blog', - :restricted => false - }) - end - - def toggle! - new_value = { - :value => !BlogComment::Moderation.enabled?, - :scoping => 'blog', - :restricted => false - } - if RefinerySetting.respond_to?(:set) - RefinerySetting.set(:comment_moderation, new_value) - else - RefinerySetting[:comment_moderation] = new_value - end - end - end - end - - module Notification - class << self - def recipients - RefinerySetting.find_or_set(:comment_notification_recipients, (Role[:refinery].users.first.email rescue ''), - { - :scoping => 'blog', - :restricted => false - }) - end - - def recipients=(emails) - new_value = { - :value => emails, - :scoping => 'blog', - :restricted => false - } - if RefinerySetting.respond_to?(:set) - RefinerySetting.set(:comment_notification_recipients, new_value) - else - RefinerySetting[:comment_notification_recipients] = new_value - end - end - - def subject - RefinerySetting.find_or_set(:comment_notification_subject, "New inquiry from your website", { - :scoping => 'blog', - :restricted => false - }) - end - - def subject=(subject_line) - new_value = { - :value => subject_line, - :scoping => 'blog', - :restricted => false - } - if RefinerySetting.respond_to?(:set) - RefinerySetting.set(:comment_notification_subject, new_value) - else - RefinerySetting[:comment_notification_subject] = new_value - end - end - end - end - -end diff --git a/app/models/blog_post.rb b/app/models/blog_post.rb deleted file mode 100644 index e03be99..0000000 --- a/app/models/blog_post.rb +++ /dev/null @@ -1,114 +0,0 @@ -require 'acts-as-taggable-on' -require 'seo_meta' - -class BlogPost < ActiveRecord::Base - - is_seo_meta if self.table_exists? - - default_scope :order => 'published_at DESC' - #.first & .last will be reversed -- consider a with_exclusive_scope on these? - - belongs_to :author, :class_name => 'User', :foreign_key => :user_id, :readonly => true - - has_many :comments, :class_name => 'BlogComment', :dependent => :destroy - acts_as_taggable - - has_many :categorizations, :dependent => :destroy - has_many :categories, :through => :categorizations, :source => :blog_category - - acts_as_indexed :fields => [:title, :body] - - validates :title, :presence => true, :uniqueness => true - validates :body, :presence => true - - has_friendly_id :friendly_id_source, :use_slug => true, - :default_locale => (::Refinery::I18n.default_frontend_locale rescue :en), - :approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => 'blog'), - :strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, false, :scoping => 'blog') - - scope :by_archive, lambda { |archive_date| - where(['published_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month]) - } - - scope :by_year, lambda { |archive_year| - where(['published_at between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year]) - } - - scope :all_previous, lambda { where(['published_at <= ?', Time.now.beginning_of_month]) } - - scope :live, lambda { where( "published_at <= ? and draft = ?", Time.now, false) } - - scope :previous, lambda { |i| where(["published_at < ? and draft = ?", i.published_at, false]).limit(1) } - # next is now in << self - - def next - BlogPost.next(self).first - end - - def prev - BlogPost.previous(self).first - end - - def live? - !draft and published_at <= Time.now - end - - def category_ids=(ids) - self.categories = ids.reject{|id| id.blank?}.collect {|c_id| - BlogCategory.find(c_id.to_i) rescue nil - }.compact - end - - def friendly_id_source - custom_url.present? ? custom_url : title - end - - class << self - def next current_record - self.send(:with_exclusive_scope) do - where(["published_at > ? and draft = ?", current_record.published_at, false]).order("published_at ASC") - end - end - - def comments_allowed? - RefinerySetting.find_or_set(:comments_allowed, true, { - :scoping => 'blog' - }) - end - - def teasers_enabled? - RefinerySetting.find_or_set(:teasers_enabled, true, { - :scoping => 'blog' - }) - end - - def teaser_enabled_toggle! - currently = RefinerySetting.find_or_set(:teasers_enabled, true, { - :scoping => 'blog' - }) - RefinerySetting.set(:teasers_enabled, {:value => !currently, :scoping => 'blog'}) - end - - def uncategorized - BlogPost.live.reject { |p| p.categories.any? } - end - end - - module ShareThis - DEFAULT_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - - class << self - def key - RefinerySetting.find_or_set(:share_this_key, BlogPost::ShareThis::DEFAULT_KEY, { - :scoping => 'blog' - }) - end - - def enabled? - key = BlogPost::ShareThis.key - key.present? and key != BlogPost::ShareThis::DEFAULT_KEY - end - end - end - -end diff --git a/app/models/categorization.rb b/app/models/categorization.rb deleted file mode 100644 index 1735ea9..0000000 --- a/app/models/categorization.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Categorization < ActiveRecord::Base - - set_table_name 'blog_categories_blog_posts' - belongs_to :blog_post - belongs_to :blog_category - -end
\ No newline at end of file diff --git a/app/models/refinery/blog/category.rb b/app/models/refinery/blog/category.rb new file mode 100644 index 0000000..dc85b50 --- /dev/null +++ b/app/models/refinery/blog/category.rb @@ -0,0 +1,26 @@ +module Refinery + module Blog + class Category < ActiveRecord::Base + + has_many :categorizations, :dependent => :destroy, :foreign_key => :blog_category_id + has_many :posts, :through => :categorizations, :source => :blog_post + + acts_as_indexed :fields => [:title] + + validates :title, :presence => true, :uniqueness => true + + has_friendly_id :title, :use_slug => true, + :default_locale => (::Refinery::I18n.default_frontend_locale rescue :en), + :approximate_ascii => Refinery::Setting.find_or_set(:approximate_ascii, false, :scoping => 'blog'), + :strip_non_ascii => Refinery::Setting.find_or_set(:strip_non_ascii, false, :scoping => 'blog') + + def post_count + posts.select(&:live?).count + end + + # how many items to show per page + self.per_page = Refinery::Setting.find_or_set(:blog_posts_per_page, 10) + + end + end +end
\ No newline at end of file diff --git a/app/models/refinery/blog/comment.rb b/app/models/refinery/blog/comment.rb new file mode 100644 index 0000000..55a67ba --- /dev/null +++ b/app/models/refinery/blog/comment.rb @@ -0,0 +1,125 @@ +module Refinery + module Blog + class Comment < ActiveRecord::Base + + attr_accessible :name, :email, :message + + filters_spam :author_field => :name, + :email_field => :email, + :message_field => :body + + belongs_to :post, :class_name => 'Refinery::Blog::Post', :foreign_key => 'blog_post_id' + + acts_as_indexed :fields => [:name, :email, :message] + + alias_attribute :message, :body + + validates :name, :message, :presence => true + validates :email, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i } + + scope :unmoderated, :conditions => {:state => nil} + scope :approved, :conditions => {:state => 'approved'} + scope :rejected, :conditions => {:state => 'rejected'} + + self.per_page = Refinery::Setting.find_or_set(:blog_comments_per_page, 10) + + def avatar_url(options = {}) + options = {:size => 60} + require 'digest/md5' + size = ("?s=#{options[:size]}" if options[:size]) + "http://gravatar.com/avatar/#{Digest::MD5.hexdigest(self.email.to_s.strip.downcase)}#{size}.jpg" + end + + def approve! + self.update_attribute(:state, 'approved') + end + + def reject! + self.update_attribute(:state, 'rejected') + end + + def rejected? + self.state == 'rejected' + end + + def approved? + self.state == 'approved' + end + + def unmoderated? + self.state.nil? + end + + def self.toggle! + currently = Refinery::Setting.find_or_set(:comments_allowed, true, { + :scoping => 'blog' + }) + Refinery::Setting.set(:comments_allowed, {:value => !currently, :scoping => 'blog'}) + end + + before_create do |comment| + unless Moderation.enabled? + comment.state = comment.ham? ? 'approved' : 'rejected' + end + end + + module Moderation + class << self + def enabled? + Refinery::Setting.find_or_set(:comment_moderation, true, { + :scoping => 'blog', + :restricted => false + }) + end + + def toggle! + new_value = { + :value => !Blog::Comment::Moderation.enabled?, + :scoping => 'blog', + :restricted => false + } + Refinery::Setting.set(:comment_moderation, new_value) + end + end + end + + module Notification + class << self + def recipients + Refinery::Setting.find_or_set(:comment_notification_recipients, (Refinery::Role[:refinery].users.first.email rescue ''), + { + :scoping => 'blog', + :restricted => false + }) + end + + def recipients=(emails) + new_value = { + :value => emails, + :scoping => 'blog', + :restricted => false + } + Refinery::Setting.set(:comment_notification_recipients, new_value) + end + + def subject + Refinery::Setting.find_or_set(:comment_notification_subject, "New inquiry from your website", { + :scoping => 'blog', + :restricted => false + }) + end + + def subject=(subject_line) + new_value = { + :value => subject_line, + :scoping => 'blog', + :restricted => false + } + Refinery::Setting.set(:comment_notification_subject, new_value) + end + end + end + + end + end +end
\ No newline at end of file diff --git a/app/models/refinery/blog/comment_mailer.rb b/app/models/refinery/blog/comment_mailer.rb new file mode 100644 index 0000000..7013355 --- /dev/null +++ b/app/models/refinery/blog/comment_mailer.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../mailers/refinery/blog/comment_mailer', __FILE__) diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb new file mode 100644 index 0000000..883f4fc --- /dev/null +++ b/app/models/refinery/blog/post.rb @@ -0,0 +1,114 @@ +require 'acts-as-taggable-on' +require 'seo_meta' + +module Refinery + module Blog + class Post < ActiveRecord::Base + + is_seo_meta if self.table_exists? + + default_scope :order => 'published_at DESC' + #.first & .last will be reversed -- consider a with_exclusive_scope on these? + + belongs_to :author, :class_name => 'Refinery::User', :foreign_key => :user_id, :readonly => true + + has_many :comments, :class_name => 'Refinery::Blog::Comment', :dependent => :destroy, :foreign_key => :blog_post_id + acts_as_taggable + + has_many :categorizations, :dependent => :destroy, :foreign_key => :blog_post_id + has_many :categories, :through => :categorizations, :source => :blog_category + + acts_as_indexed :fields => [:title, :body] + + validates :title, :presence => true, :uniqueness => true + validates :body, :presence => true + + has_friendly_id :friendly_id_source, :use_slug => true, + :default_locale => (::Refinery::I18n.default_frontend_locale rescue :en), + :approximate_ascii => Refinery::Setting.find_or_set(:approximate_ascii, false, :scoping => 'blog'), + :strip_non_ascii => Refinery::Setting.find_or_set(:strip_non_ascii, false, :scoping => 'blog') + + scope :by_archive, lambda { |archive_date| + where(['published_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month]) + } + + scope :by_year, lambda { |archive_year| + where(['published_at between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year]) + } + + scope :all_previous, lambda { where(['published_at <= ?', Time.now.beginning_of_month]) } + + scope :live, lambda { where( "published_at <= ? and draft = ?", Time.now, false) } + + scope :previous, lambda { |i| where(["published_at < ? and draft = ?", i.published_at, false]).limit(1) } + + scope :uncategorized, lambda { + live.includes(:categories).where(:categories => { Refinery::Categorization.table_name => { :blog_category_id => nil } }) + } + + attr_accessible :title, :body, :custom_teaser, :tag_list, :draft, :published_at, :custom_url + attr_accessible :browser_title, :meta_keywords, :meta_description, :user_id, :category_ids + + self.per_page = Refinery::Setting.find_or_set(:blog_posts_per_page, 10) + + def next + self.class.next(self).first + end + + def prev + self.class.previous(self).first + end + + def live? + !draft and published_at <= Time.now + end + + def category_ids=(ids) + self.categories = ids.reject{|id| id.blank?}.collect {|c_id| + Refinery::Blog::Category.find(c_id.to_i) rescue nil + }.compact + end + + def friendly_id_source + custom_url.present? ? custom_url : title + end + + class << self + def next(current_record) + self.send(:with_exclusive_scope) do + where(["published_at > ? and draft = ?", current_record.published_at, false]).order("published_at ASC") + end + end + + def comments_allowed? + Refinery::Setting.find_or_set(:comments_allowed, true, :scoping => 'blog') + end + + def teasers_enabled? + Refinery::Setting.find_or_set(:teasers_enabled, true, :scoping => 'blog') + end + + def teaser_enabled_toggle! + currently = Refinery::Setting.find_or_set(:teasers_enabled, true, :scoping => 'blog') + Refinery::Setting.set(:teasers_enabled, :value => !currently, :scoping => 'blog') + end + end + + module ShareThis + DEFAULT_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + + class << self + def key + Refinery::Setting.find_or_set(:share_this_key, Blog::Post::ShareThis::DEFAULT_KEY, :scoping => 'blog') + end + + def enabled? + key = Blog::Post::ShareThis.key + key.present? and key != Blog::Post::ShareThis::DEFAULT_KEY + end + end + end + + end + end +end
\ No newline at end of file diff --git a/app/models/refinery/categorization.rb b/app/models/refinery/categorization.rb new file mode 100644 index 0000000..97f0928 --- /dev/null +++ b/app/models/refinery/categorization.rb @@ -0,0 +1,9 @@ +module Refinery + class Categorization < ActiveRecord::Base + + set_table_name 'refinery_blog_categories_blog_posts' + belongs_to :blog_post, :class_name => 'Refinery::Blog::Post', :foreign_key => :blog_post_id + belongs_to :blog_category, :class_name => 'Refinery::Blog::Category', :foreign_key => :blog_category_id + + end +end
\ No newline at end of file diff --git a/app/sweepers/refinery/blog_sweeper.rb b/app/sweepers/refinery/blog_sweeper.rb new file mode 100644 index 0000000..a58ac7e --- /dev/null +++ b/app/sweepers/refinery/blog_sweeper.rb @@ -0,0 +1,26 @@ +module Refinery + class BlogSweeper < ActionController::Caching::Sweeper + observe Blog::Post, Blog::Comment + + def after_create(record) + expire_cache_for(record) + end + + def after_update(record) + expire_cache_for(record) + end + + def after_destroy(record) + expire_cache_for(record) + end + + private + + def expire_cache_for(record) + # TODO: Convert these to url helpers + expire_page '/blog' + expire_page '/blog/feed.rss' + end + + end +end diff --git a/app/views/.gitkeep b/app/views/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/views/.gitkeep diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb deleted file mode 100644 index 25f437b..0000000 --- a/app/views/admin/blog/_submenu.html.erb +++ /dev/null @@ -1,96 +0,0 @@ -<nav id='actions' class='multilist'> - <ul class='search_list'> - <li class='not_a_link'> - <%= render :partial => "/shared/admin/search", - :locals => { - :url => admin_blog_posts_url - } %> - </li> - </ul> - - <ul class='collapsible_menu'> - <li class='not_a_link'> - <%= link_to t('.posts.title'), '#', - :class => 'page_copy_icon' %> - </li> - <li> - <%= link_to t('.posts.manage'), admin_blog_posts_path, - :class => 'page_icon' %> - </li> - <li> - <%= link_to t('.posts.uncategorized'), uncategorized_admin_blog_posts_url, - :class => 'page_icon' %> - </li> - <li> - <%= link_to t('.posts.new'), new_admin_blog_post_url, - :class => 'page_add_icon' %> - </li> - </ul> - <% if BlogPost.comments_allowed? %> - <ul class='collapsible_menu'> - <li class='not_a_link'> - <% if BlogComment.unmoderated.any? %> - <% title = t('.comments.title_with_count', :new_count => BlogComment.unmoderated.size) %> - <% else %> - <% title = t('.comments.title') %> - <% end %> - <%= link_to title, '#', - :class => 'comments_icon' %> - </li> - <li> - <%= link_to t('.comments.new'), admin_blog_comments_path, - :class => 'comment_icon' %> - </li> - <li> - <%= link_to t('.comments.approved'), approved_admin_blog_comments_path, - :class => 'comment_tick_icon' %> - </li> - <li> - <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path, - :class => 'comment_cross_icon' %> - </li> - </ul> - <% end %> - - <ul class='collapsible_menu'> - <li class='not_a_link'> - <%= link_to t('.categories.title'), '#', - :class => 'folder_icon' %> - </li> - <li> - <%= link_to t('.categories.manage'), admin_blog_categories_url, - :class => 'folder_edit_icon' %> - </li> - <li> - <%= link_to t('.categories.new'), new_admin_blog_category_url(:dialog => true, :height => 325), - :class => 'folder_add_icon' %> - </li> - </ul> - - <ul class='collapsible_menu'> - <li class='not_a_link'> - <%= link_to t('.settings.title'), admin_blog_settings_path, - :class => 'settings_icon' %> - </li> - <li> - <%= link_to t('.settings.comments'), comments_admin_blog_settings_url, - :class => "#{BlogPost.comments_allowed? ? 'success' : 'failure'}_icon" %> - </li> - <li> - <%= link_to t('.settings.moderation'), moderation_admin_blog_settings_url, - :class => "#{BlogComment::Moderation.enabled? ? 'success' : 'failure'}_icon" %> - </li> - <li> - <%= link_to t('.settings.update_notified'), - notification_recipients_admin_blog_settings_url(:dialog => true, :height => 400), - :class => 'user_comment_icon' %> - </li> - <li> - <%= link_to t('.settings.teasers'), - teasers_admin_blog_settings_url, :class => "#{BlogPost.teasers_enabled? ? 'success' : 'failure'}_icon" %> - </li> - </ul> - -</nav> - -<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog')%> diff --git a/app/views/admin/blog/posts/_form.css.erb b/app/views/admin/blog/posts/_form.css.erb deleted file mode 100644 index 869ab9b..0000000 --- a/app/views/admin/blog/posts/_form.css.erb +++ /dev/null @@ -1,20 +0,0 @@ -<style type='text/css'> - ul.blog_categories{ - height:200px; - overflow:auto; - border:1px solid #ccc; - padding:5px; - } - ul.blog_categories, ul.blog_categories li { - list-style: none; - margin:5px 0; - } - a#copy_body_link { - background: url("/images/refinery/icons/add.png") no-repeat scroll 0 6px transparent; - border-bottom: 0 none; - display: inline; - line-height: 29px; - margin-top: 0; - padding-left: 20px; - } -</style> diff --git a/app/views/admin/blog/posts/_form.js.erb b/app/views/admin/blog/posts/_form.js.erb deleted file mode 100644 index 87ad23f..0000000 --- a/app/views/admin/blog/posts/_form.js.erb +++ /dev/null @@ -1,23 +0,0 @@ -<script> - (function($) { - $(function() { - $('#page-tabs').tabs(); - $('#copy_body_link').click(function(event) { - // Find the WYMEditor that maps to the custom_teaser field - var teaserTextArea = $('#blog_post_custom_teaser')[0]; - var teaserEditor = null; - $.each(WYMeditor.INSTANCES, function(index, editor) { - if (editor._element[0] == teaserTextArea) { - teaserEditor = editor; - } - }); - - if (teaserEditor) { - teaserEditor.html($('#blog_post_body').attr('value')); - } - - event.preventDefault(); - }); - }); - })(jQuery); -</script> diff --git a/app/views/blog/categories/show.html.erb b/app/views/blog/categories/show.html.erb deleted file mode 100644 index 40444ec..0000000 --- a/app/views/blog/categories/show.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<% content_for :body_content_title, @category.title %> - -<% content_for :body_content_left do %> - <% if @blog_posts.any? %> - <section id="blog_posts"> - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> - </section> - <% else %> - <p> - <%= t('.no_posts') %> - </p> - <% end %> -<% end %> - -<% content_for :body_content_right do %> - <%= render :partial => "/blog/shared/categories" %> -<% end %> - -<%= render :partial => "/shared/content_page" %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/posts/_nav.html.erb b/app/views/blog/posts/_nav.html.erb deleted file mode 100644 index df4b435..0000000 --- a/app/views/blog/posts/_nav.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<nav id="next_prev_article"> - <% if @blog_post.next.present? -%> - <%= link_to (truncate(@blog_post.next.title) + " »").html_safe, @blog_post.next, :class => 'next' %> - <% end -%> - - <%= link_to t('blog_home', :scope => 'blog.posts.show'), blog_root_path, :class => 'home' %> - - <% if @blog_post.prev.present? -%> - <%= link_to ("« " + truncate(@blog_post.prev.title)).html_safe, @blog_post.prev, :class => 'prev' %> - <% end -%> -</nav><!-- /next_prev_article --> diff --git a/app/views/blog/posts/archive.html.erb b/app/views/blog/posts/archive.html.erb deleted file mode 100644 index a2044e8..0000000 --- a/app/views/blog/posts/archive.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<% content_for :body_content_left do %> - <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1> - <% if @blog_posts.any? %> - <section id="blog_posts"> - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> - </section> - <% else %> - <p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p> - <% end %> -<% end %> - -<% content_for :body_content_right do %> - <%= render :partial => "/blog/shared/categories" %> - <%= render :partial => "/blog/shared/tags" %> - <%= render :partial => "/blog/shared/rss_feed" %> - <%= blog_archive_list %> -<% end %> - -<%= render :partial => "/shared/content_page" %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/posts/index.html.erb b/app/views/blog/posts/index.html.erb deleted file mode 100644 index 8c3801a..0000000 --- a/app/views/blog/posts/index.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<% content_for :body_content_left do %> - <%=raw @page[Page.default_parts.first.to_sym] if Page.default_parts.any? %> - - <% if @blog_posts.any? %> - <section id="blog_posts"> - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> - </section> - <% else %> - <p><%= t('.no_blog_articles_yet') %></p> - <% end %> -<% end %> - -<% content_for :body_content_right do %> - <%=raw @page[Page.default_parts.second.to_sym] if Page.default_parts.many? %> - - <%= render :partial => "/blog/shared/categories" %> - <%= render :partial => "/blog/shared/tags" %> - <%= render :partial => "/blog/shared/rss_feed" %> - <%= blog_archive_list %> -<% end %> - -<%= render :partial => "/shared/content_page" %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb deleted file mode 100644 index cc763a8..0000000 --- a/app/views/blog/posts/show.html.erb +++ /dev/null @@ -1,67 +0,0 @@ -<% content_for :body_content_left do %> - <div id="show_blog_post"> - <%= render 'post' %> - </div> - - <% if BlogPost.comments_allowed? %> - <aside id="comments"> - <h2><%= t('.comments.title') %></h2> - <% if (comments = @blog_post.comments.approved).any? %> - <%= render :partial => "comment", :collection => comments %> - <% else %> - <p> - <%= t('none', :scope => 'blog.shared.comments') %>. - </p> - <% end %> - - <% flash.each do |key, value| %> - <div id='flash' class="flash flash_<%= key %>"> - <%= value %> - </div> - <% end %> - - <h2><%= t('.comments.add') %></h2> - <%= form_for [:blog_post, @blog_comment] do |f| %> - <%= render :partial => "/shared/admin/error_messages", - :locals => { - :object => f.object, - :include_object_name => true - } %> - <div class='field'> - <%= f.label :name %> - <%= f.text_field :name %> - </div> - <div class='field'> - <%= f.label :email %> - <%= f.email_field :email %> - </div> - <div class='field message_field'> - <%= f.label :message %> - <%= f.text_area :message, :rows => 6 %> - </div> - <div class='field form-actions'> - <%= f.submit t('.submit') %> - </div> - <% end %> - </aside> - <% end %> -<% end %> - -<% content_for :body_content_right do %> - <%= render :partial => "/blog/shared/categories" %> - <%= render :partial => "/blog/shared/tags" %> - <%= render :partial => "/blog/shared/posts" %> - <%= render :partial => "/blog/shared/rss_feed" %> - <%= blog_archive_list %> -<% end %> - -<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %> - -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> -<% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %> -<% content_for :javascripts do %> - <%# enable AJAX'd post nav at your own risk until html5 history API implemented. %> - <%#= javascript_include_tag('refinerycms-blog') %> - <script src="http://w.sharethis.com/button/buttons.js"></script> - <script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script> -<% end if BlogPost::ShareThis.enabled? %> diff --git a/app/views/blog/posts/tagged.html.erb b/app/views/blog/posts/tagged.html.erb deleted file mode 100644 index 904150f..0000000 --- a/app/views/blog/posts/tagged.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% content_for :body_content_title, "#{t('.posts_tagged')} “#{@tag_name.titleize}”".html_safe -%> - -<% content_for :body_content_left do %> - <% if @blog_posts.any? %> - <section id="blog_posts"> - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> - </section> - <% else %> - <p><%= t('.no_blog_articles_yet') %></p> - <% end %> -<% end %> - -<% content_for :body_content_right do %> - <%= render :partial => "/blog/shared/categories" %> - <%= render :partial => "/blog/shared/tags" %> - <%= render :partial => "/blog/shared/rss_feed" %> - <%= blog_archive_list %> -<% end %> - -<%= render :partial => "/shared/content_page" %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/shared/_rss_feed.html.erb b/app/views/blog/shared/_rss_feed.html.erb deleted file mode 100644 index 1c2cef7..0000000 --- a/app/views/blog/shared/_rss_feed.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<h2><%= t('.title') %></h2> -<%= link_to t('.subscribe'), blog_rss_feed_url, :id => "rss_feed_subscribe"%> diff --git a/app/views/refinery/admin/blog/_submenu.html.erb b/app/views/refinery/admin/blog/_submenu.html.erb new file mode 100644 index 0000000..2915610 --- /dev/null +++ b/app/views/refinery/admin/blog/_submenu.html.erb @@ -0,0 +1,96 @@ +<nav id='actions' class='multilist'> + <ul class='search_list'> + <li class='not_a_link'> + <%= render :partial => "/refinery/admin/search", + :locals => { + :url => main_app.refinery_admin_blog_posts_path + } %> + </li> + </ul> + + <ul class='collapsible_menu'> + <li class='not_a_link'> + <%= link_to t('.posts.title'), '#', + :class => 'page_copy_icon' %> + </li> + <li> + <%= link_to t('.posts.manage'), main_app.refinery_admin_blog_posts_path, + :class => 'page_icon' %> + </li> + <li> + <%= link_to t('.posts.uncategorized'), main_app.uncategorized_refinery_admin_blog_posts_path, + :class => 'page_icon' %> + </li> + <li> + <%= link_to t('.posts.new'), main_app.new_refinery_admin_blog_post_path, + :class => 'page_add_icon' %> + </li> + </ul> + <% if Refinery::Blog::Post.comments_allowed? %> + <ul class='collapsible_menu'> + <li class='not_a_link'> + <% if Refinery::Blog::Comment.unmoderated.any? %> + <% title = t('.comments.title_with_count', :new_count => Refinery::Blog::Comment.unmoderated.size) %> + <% else %> + <% title = t('.comments.title') %> + <% end %> + <%= link_to title, '#', + :class => 'comments_icon' %> + </li> + <li> + <%= link_to t('.comments.new'), main_app.refinery_admin_blog_comments_path, + :class => 'comment_icon' %> + </li> + <li> + <%= link_to t('.comments.approved'), main_app.approved_refinery_admin_blog_comments_path, + :class => 'comment_tick_icon' %> + </li> + <li> + <%= link_to t('.comments.rejected'), main_app.rejected_refinery_admin_blog_comments_path, + :class => 'comment_cross_icon' %> + </li> + </ul> + <% end %> + + <ul class='collapsible_menu'> + <li class='not_a_link'> + <%= link_to t('.categories.title'), '#', + :class => 'folder_icon' %> + </li> + <li> + <%= link_to t('.categories.manage'), main_app.refinery_admin_blog_categories_path, + :class => 'folder_edit_icon' %> + </li> + <li> + <%= link_to t('.categories.new'), main_app.new_refinery_admin_blog_category_path(:dialog => true, :height => 325), + :class => 'folder_add_icon' %> + </li> + </ul> + + <ul class='collapsible_menu'> + <li class='not_a_link'> + <%= link_to t('.settings.title'), main_app.refinery_admin_blog_settings_path, + :class => 'settings_icon' %> + </li> + <li> + <%= link_to t('.settings.comments'), main_app.comments_refinery_admin_blog_settings_path, + :class => "#{Refinery::Blog::Post.comments_allowed? ? 'success' : 'failure'}_icon" %> + </li> + <li> + <%= link_to t('.settings.moderation'), main_app.moderation_refinery_admin_blog_settings_path, + :class => "#{Refinery::Blog::Comment::Moderation.enabled? ? 'success' : 'failure'}_icon" %> + </li> + <li> + <%= link_to t('.settings.update_notified'), + main_app.notification_recipients_refinery_admin_blog_settings_path(:dialog => true, :height => 400), + :class => 'user_comment_icon' %> + </li> + <li> + <%= link_to t('.settings.teasers'), + main_app.teasers_refinery_admin_blog_settings_path, :class => "#{Refinery::Blog::Post.teasers_enabled? ? 'success' : 'failure'}_icon" %> + </li> + </ul> + +</nav> + +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/backend') %> diff --git a/app/views/admin/blog/categories/_category.html.erb b/app/views/refinery/admin/blog/categories/_category.html.erb index 191f649..80cc2e3 100644 --- a/app/views/admin/blog/categories/_category.html.erb +++ b/app/views/refinery/admin/blog/categories/_category.html.erb @@ -5,12 +5,14 @@ </span> <span class='actions'> <%= link_to refinery_icon_tag("application_edit.png"), - edit_admin_blog_category_path(category, :dialog => true, :height => 325), + main_app.edit_refinery_admin_blog_category_path(category, + :dialog => true, + :height => 325), :title => t('.edit') %> - <%= link_to refinery_icon_tag("delete.png"), admin_blog_category_path(category), + <%= link_to refinery_icon_tag("delete.png"), main_app.refinery_admin_blog_category_path(category), :class => "cancel confirm-delete", :title => t('.delete'), :method => :delete, - :confirm => t('message', :scope => 'shared.admin.delete', :title => category.title) %> + :confirm => t('message', :scope => 'refinery.admin.delete', :title => category.title) %> </span> </li> diff --git a/app/views/admin/blog/categories/_form.html.erb b/app/views/refinery/admin/blog/categories/_form.html.erb index bfcbc7b..a5d3de3 100644 --- a/app/views/admin/blog/categories/_form.html.erb +++ b/app/views/refinery/admin/blog/categories/_form.html.erb @@ -1,5 +1,5 @@ -<%= form_for [:admin, @blog_category] do |f| -%> - <%= render :partial => "/shared/admin/error_messages", +<%= form_for [main_app, :refinery_admin, @blog_category] do |f| -%> + <%= render :partial => "/refinery/admin/error_messages", :locals => { :object => f.object, :include_object_name => true @@ -10,10 +10,10 @@ <%= f.text_field :title, :class => 'larger widest' -%> </div> - <%= render :partial => "/shared/admin/form_actions", + <%= render :partial => "/refinery/admin/form_actions", :locals => { :f => f, :continue_editing => false, - :delete_title => t('delete', :scope => 'admin.blog.categories.category') + :delete_title => t('delete', :scope => 'refinery.admin.blog.categories.category') } %> <% end %> diff --git a/app/views/admin/blog/categories/_sortable_list.html.erb b/app/views/refinery/admin/blog/categories/_sortable_list.html.erb index df6a39b..f4e8641 100644 --- a/app/views/admin/blog/categories/_sortable_list.html.erb +++ b/app/views/refinery/admin/blog/categories/_sortable_list.html.erb @@ -1,7 +1,7 @@ <ul id='sortable_list'> <%= render :partial => 'category', :collection => @blog_categories %> </ul> -<%= render :partial => "/shared/admin/sortable_list", +<%= render :partial => "/refinery/admin/sortable_list", :locals => { :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) } %> diff --git a/app/views/admin/blog/categories/edit.html.erb b/app/views/refinery/admin/blog/categories/edit.html.erb index 2872e82..2872e82 100644 --- a/app/views/admin/blog/categories/edit.html.erb +++ b/app/views/refinery/admin/blog/categories/edit.html.erb diff --git a/app/views/admin/blog/categories/index.html.erb b/app/views/refinery/admin/blog/categories/index.html.erb index 5d17d42..4ad59ab 100644 --- a/app/views/admin/blog/categories/index.html.erb +++ b/app/views/refinery/admin/blog/categories/index.html.erb @@ -1,12 +1,13 @@ -<%= render :partial => '/admin/blog/submenu' %> +<%= render :partial => '/refinery/admin/blog/submenu' %> <div id='records'> <% if searching? %> - <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <h2><%= t('results_for', :scope => 'refinery.admin.search', + :query => params[:search]) %></h2> <% if @blog_categories.any? %> <%= render :partial => "blog_categories", :collection => @blog_categories %> <% else %> - <p><%= t('search_no_results', :scope => 'admin') %></p> + <p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <% end %> <% else %> <% if @blog_categories.any? %> @@ -18,7 +19,7 @@ <% else %> <p> <strong> - <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.categories')) %> + <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.admin.blog.submenu.categories')) %> </strong> </p> <% end %> diff --git a/app/views/admin/blog/categories/new.html.erb b/app/views/refinery/admin/blog/categories/new.html.erb index 2872e82..2872e82 100644 --- a/app/views/admin/blog/categories/new.html.erb +++ b/app/views/refinery/admin/blog/categories/new.html.erb diff --git a/app/views/admin/blog/comments/_comment.html.erb b/app/views/refinery/admin/blog/comments/_comment.html.erb index 547b9e4..f5eba4d 100644 --- a/app/views/admin/blog/comments/_comment.html.erb +++ b/app/views/refinery/admin/blog/comments/_comment.html.erb @@ -5,16 +5,16 @@ </span> <span class='actions'> <%= link_to refinery_icon_tag("application_go.png"), - blog_post_url(comment.post, :anchor => "comment-#{comment.to_param}"), + main_app.blog_post_path(comment.post, :anchor => "comment-#{comment.to_param}"), :title => t('.view_live_html'), :target => "_blank" unless comment.unmoderated? %> - <%= link_to refinery_icon_tag('zoom.png'), admin_blog_comment_path(comment), + <%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_admin_blog_comment_path(comment), :title => t('.read') %> <%= link_to refinery_icon_tag("cross.png"), - rejected_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + main_app.rejected_refinery_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), :title => t('.reject') unless comment.rejected? %> <%= link_to refinery_icon_tag("tick.png"), - approved_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + main_app.approved_refinery_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), :title => t('.approve') unless comment.approved? %> </span> </li> diff --git a/app/views/admin/blog/comments/_sortable_list.html.erb b/app/views/refinery/admin/blog/comments/_sortable_list.html.erb index e141dee..f781ba1 100644 --- a/app/views/admin/blog/comments/_sortable_list.html.erb +++ b/app/views/refinery/admin/blog/comments/_sortable_list.html.erb @@ -1,7 +1,7 @@ <ul id='sortable_list'> <%= render :partial => 'comment', :collection => @blog_comments %> </ul> -<%= render :partial => "/shared/admin/sortable_list", +<%= render :partial => "/refinery/admin/sortable_list", :locals => { :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) } %> diff --git a/app/views/admin/blog/comments/index.html.erb b/app/views/refinery/admin/blog/comments/index.html.erb index aaec4ae..059ef59 100644 --- a/app/views/admin/blog/comments/index.html.erb +++ b/app/views/refinery/admin/blog/comments/index.html.erb @@ -1,34 +1,30 @@ -<%= render :partial => '/admin/blog/submenu' %> +<%= render :partial => '/refinery/admin/blog/submenu' %> <div id='records'> <% if searching? %> <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> <% if @blog_comments.any? %> - <%=# will_paginate @blog_comments - %> + <%= will_paginate @blog_comments %> <ul> <%= render :partial => "blog_comments", :collection => @blog_comments %> </ul> - <%=# will_paginate @blog_comments - %> + <%= will_paginate @blog_comments %> <% else %> <p><%= t('search_no_results', :scope => 'admin') %></p> <% end %> <% else %> <% if @blog_comments.any? %> - <%=# will_paginate @blog_comments - %> + <%= will_paginate @blog_comments %> <%= render :partial => "sortable_list" %> - <%=# will_paginate @blog_comments - %> + <%= will_paginate @blog_comments %> <% else %> <h3> <%= t('.no_items_yet', - :type => t(action_name.gsub('index', 'new'), :scope => 'admin.blog.submenu.comments').downcase) %> + :type => action_name.gsub('index', 'new')).downcase %> </h3> <% end %> <% end %> diff --git a/app/views/admin/blog/comments/show.html.erb b/app/views/refinery/admin/blog/comments/show.html.erb index d4c2186..3dc50ff 100644 --- a/app/views/admin/blog/comments/show.html.erb +++ b/app/views/refinery/admin/blog/comments/show.html.erb @@ -6,14 +6,14 @@ <h2><%= t('.actions') %></h2> <ul> <li> - <%= link_to t('.back'), {:action => 'index'}, :class => "back_icon" %> + <%= link_to t('.back'), main_app.refinery_admin_blog_comments_path, :class => "back_icon" %> </li> <li> - <%= link_to t('.reject'), rejected_admin_blog_comment_path(@blog_comment, :return_to => 'rejected'), + <%= link_to t('.reject'), main_app.rejected_refinery_admin_blog_comment_path(@blog_comment, :return_to => 'rejected'), :class => 'comment_cross_icon' unless @blog_comment.rejected? %> </li> <li> - <%= link_to t('.approve'), approved_admin_blog_comment_path(@blog_comment, :return_to => 'approved'), + <%= link_to t('.approve'), main_app.approved_refinery_admin_blog_comment_path(@blog_comment, :return_to => 'approved'), :class => 'comment_tick_icon' unless @blog_comment.approved? %> </li> </ul> @@ -27,7 +27,7 @@ </td> <td> <%= link_to @blog_comment.post.title, - blog_post_url(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), + main_app.blog_post_path(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), :target => '_blank' %> </td> </tr> @@ -60,4 +60,4 @@ </table> </div> -<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog') %> +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/backend') %> diff --git a/app/views/admin/blog/posts/_form.html.erb b/app/views/refinery/admin/blog/posts/_form.html.erb index c891b63..822ec8a 100644 --- a/app/views/admin/blog/posts/_form.html.erb +++ b/app/views/refinery/admin/blog/posts/_form.html.erb @@ -1,5 +1,5 @@ -<%= form_for [:admin, @blog_post] do |f| -%> - <%= render :partial => "/shared/admin/error_messages", +<%= form_for [main_app, :refinery_admin, @blog_post] do |f| -%> + <%= render :partial => "/refinery/admin/error_messages", :locals => { :object => f.object, :include_object_name => true @@ -14,10 +14,10 @@ <div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'> <ul id='page_parts'> <li class='ui-state-default ui-state-active'> - <%= link_to t('body', :scope => 'activerecord.attributes.blog_post'), "#page_part_body" %> + <%= link_to t('body', :scope => 'activerecord.attributes.refinery/blog_post'), "#page_part_body" %> </li> <li class='ui-state-default'> - <%= link_to t('teaser', :scope => 'activerecord.attributes.blog_post'), "#page_part_teaser" %> + <%= link_to t('teaser', :scope => 'activerecord.attributes.refinery/blog_post'), "#page_part_teaser" %> </li> <% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %> <li class='ui-state-default' id="custom_<%= tab.name %>_tab"> @@ -27,7 +27,6 @@ </ul> <div id='page_part_editors'> - <% part_index = -1 %> <%= render :partial => 'form_part', :locals => { @@ -49,7 +48,7 @@ </div> <div class='field'> - <%= f.label :tag_list, t('blog.shared.tags.title') -%> + <%= f.label :tag_list, t('refinery.blog.shared.tags.title') -%> <%= f.text_field :tag_list, :class => 'larger' -%> </div> @@ -66,7 +65,7 @@ </div> <div id='more_options' style="display:none;"> <div class="hemisquare"> - <h3><%= t('title', :scope => 'admin.blog.submenu.categories') %></h3> + <h3><%= t('title', :scope => 'refinery.admin.blog.submenu.categories') %></h3> <ul class='blog_categories'> <% @blog_categories.each do |category| %> <li> @@ -95,14 +94,14 @@ <%= render :partial => '/seo_meta/form', :locals => {:form => f} %> </div> </div> - <%= render :partial => "/shared/admin/form_actions", + <%= render :partial => "/refinery/admin/form_actions", :locals => { :f => f, :continue_editing => true, - :delete_title => t('delete', :scope => 'admin.blog.posts.post') + :delete_title => t('delete', :scope => 'refinery.admin.blog.posts.post') } %> <% end -%> -<% content_for :stylesheets, render(:partial => 'form.css') -%> -<% content_for :javascripts, render(:partial => 'form.js') -%> -<%= render 'shared/admin/autocomplete', :dom_id => '#blog_post_tag_list', :url => tags_admin_blog_posts_url %> +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/backend') %> +<% content_for :javascripts, javascript_include_tag('refinery/blog/backend') %> +<%= render 'refinery/shared/admin/autocomplete', :dom_id => '#blog_post_tag_list', :url => main_app.tags_refinery_admin_blog_posts_url %> diff --git a/app/views/admin/blog/posts/_form_part.html.erb b/app/views/refinery/admin/blog/posts/_form_part.html.erb index 114e493..114e493 100644 --- a/app/views/admin/blog/posts/_form_part.html.erb +++ b/app/views/refinery/admin/blog/posts/_form_part.html.erb diff --git a/app/views/admin/blog/posts/_post.html.erb b/app/views/refinery/admin/blog/posts/_post.html.erb index a7f09e0..28704ff 100644 --- a/app/views/admin/blog/posts/_post.html.erb +++ b/app/views/refinery/admin/blog/posts/_post.html.erb @@ -7,15 +7,15 @@ </span> </span> <span class='actions'> - <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post), + <%= link_to refinery_icon_tag("application_go.png"), main_app.blog_post_path(post), :title => t('.view_live_html'), :target => "_blank" %> - <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_blog_post_path(post), + <%= link_to refinery_icon_tag("application_edit.png"), main_app.edit_refinery_admin_blog_post_path(post), :title => t('.edit') %> - <%= link_to refinery_icon_tag("delete.png"), admin_blog_post_path(post), + <%= link_to refinery_icon_tag("delete.png"), main_app.refinery_admin_blog_post_path(post), :class => "cancel confirm-delete", :title => t('.delete'), :method => :delete, - :confirm => t('message', :scope => 'shared.admin.delete', :title => post.title) %> + :confirm => t('message', :scope => 'refinery.admin.delete', :title => post.title) %> </span> </li> diff --git a/app/views/admin/blog/posts/_sortable_list.html.erb b/app/views/refinery/admin/blog/posts/_sortable_list.html.erb index 7ae0ad3..18d12cc 100644 --- a/app/views/admin/blog/posts/_sortable_list.html.erb +++ b/app/views/refinery/admin/blog/posts/_sortable_list.html.erb @@ -1,7 +1,7 @@ <ul id='sortable_list'> <%= render :partial => 'post', :collection => @blog_posts %> </ul> -<%= render :partial => "/shared/admin/sortable_list", +<%= render :partial => "/refinery/admin/sortable_list", :locals => { :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) } %> diff --git a/app/views/admin/blog/posts/_teaser_part.html.erb b/app/views/refinery/admin/blog/posts/_teaser_part.html.erb index 71d7d01..dc9186a 100644 --- a/app/views/admin/blog/posts/_teaser_part.html.erb +++ b/app/views/refinery/admin/blog/posts/_teaser_part.html.erb @@ -2,9 +2,9 @@ <%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%> <p> <span class='clearfix label_inline_with_link'> - <%= link_to t('copy_body', :scope => 'admin.blog.posts.form'), "#", + <%= link_to t('copy_body', :scope => 'refinery.admin.blog.posts.form'), "#", :id => 'copy_body_link', - :title => t('copy_body_help', :scope => 'admin.blog.posts.form') %> + :title => t('copy_body_help', :scope => 'refinery.admin.blog.posts.form') %> </span> </p> </div> diff --git a/app/views/admin/blog/posts/edit.html.erb b/app/views/refinery/admin/blog/posts/edit.html.erb index 2872e82..2872e82 100644 --- a/app/views/admin/blog/posts/edit.html.erb +++ b/app/views/refinery/admin/blog/posts/edit.html.erb diff --git a/app/views/admin/blog/posts/index.html.erb b/app/views/refinery/admin/blog/posts/index.html.erb index 90a6a6e..922353c 100644 --- a/app/views/admin/blog/posts/index.html.erb +++ b/app/views/refinery/admin/blog/posts/index.html.erb @@ -1,14 +1,14 @@ -<%= render :partial => '/admin/blog/submenu' %> +<%= render :partial => '/refinery/admin/blog/submenu' %> <div id='records'> <% if searching? %> - <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2> <% if @blog_posts.any? %> <ul> <%= render :partial => "post", :collection => @blog_posts %> </ul> <% else %> - <p><%= t('no_results', :scope => 'shared.admin.search') %></p> + <p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <% end %> <% else %> <% if @blog_posts.any? %> @@ -20,7 +20,7 @@ <% else %> <p> <strong> - <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %> + <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.admin.blog.submenu.posts')) %> </strong> </p> <% end %> diff --git a/app/views/admin/blog/posts/new.html.erb b/app/views/refinery/admin/blog/posts/new.html.erb index 2872e82..2872e82 100644 --- a/app/views/admin/blog/posts/new.html.erb +++ b/app/views/refinery/admin/blog/posts/new.html.erb diff --git a/app/views/admin/blog/posts/uncategorized.html.erb b/app/views/refinery/admin/blog/posts/uncategorized.html.erb index 19d9e20..030e789 100644 --- a/app/views/admin/blog/posts/uncategorized.html.erb +++ b/app/views/refinery/admin/blog/posts/uncategorized.html.erb @@ -1,12 +1,13 @@ -<%= render :partial => '/admin/blog/submenu' %> +<%= render :partial => '/refinery/admin/blog/submenu' %> <div id='records'> <% if searching? %> - <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <h2><%= t('results_for', :scope => 'refinery.admin.search', + :query => params[:search]) %></h2> <% if @blog_posts.any? %> <%= render :partial => "blog_posts", :collection => @blog_posts %> <% else %> - <p><%= t('search_no_results', :scope => 'admin') %></p> + <p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <% end %> <% else %> <% if @blog_posts.any? %> @@ -18,7 +19,7 @@ <% else %> <p> <strong> - <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %> + <%= t('.no_items_yet') %> </strong> </p> <% end %> diff --git a/app/views/admin/blog/settings/notification_recipients.html.erb b/app/views/refinery/admin/blog/settings/notification_recipients.html.erb index 41e7f2d..d321ded 100644 --- a/app/views/admin/blog/settings/notification_recipients.html.erb +++ b/app/views/refinery/admin/blog/settings/notification_recipients.html.erb @@ -14,7 +14,7 @@ <%= t('.example') %> </p> - <%= render :partial => "/shared/admin/form_actions", + <%= render :partial => "/refinery/admin/form_actions", :locals => { :f => nil, :continue_editing => false, diff --git a/app/views/refinery/blog/categories/show.html.erb b/app/views/refinery/blog/categories/show.html.erb new file mode 100644 index 0000000..00d9596 --- /dev/null +++ b/app/views/refinery/blog/categories/show.html.erb @@ -0,0 +1,21 @@ +<% content_for :body_content_title, @blog_category.title %> + +<% content_for :body_content_left do %> + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> + </section> + <% else %> + <p> + <%= t('.no_posts') %> + </p> + <% end %> +<% end %> + +<% content_for :body_content_right do %> + <%= render :partial => "/refinery/blog/shared/categories" %> +<% end %> + +<%= render :partial => "/refinery/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/frontend') %> diff --git a/app/views/blog/comment_mailer/notification.html.erb b/app/views/refinery/blog/comment_mailer/notification.html.erb index 800f12c..0c7dcd4 100644 --- a/app/views/blog/comment_mailer/notification.html.erb +++ b/app/views/refinery/blog/comment_mailer/notification.html.erb @@ -4,10 +4,10 @@ <%=raw t('.comment_starts') %> -<%=raw t('.from') %>: <%= @comment.name %> -<%=raw t('.email') %>: <%= @comment.email %> +<%=raw t('.from') %>: <%= @blog_comment.name %> +<%=raw t('.email') %>: <%= @blog_comment.email %> <%=raw t('.message') %>: -<%=simple_format strip_tags(@comment.body) %> +<%=simple_format strip_tags(@blog_comment.body) %> <%=raw t('.comment_ends') %> diff --git a/app/views/blog/posts/_comment.html.erb b/app/views/refinery/blog/posts/_comment.html.erb index 5503826..659f433 100644 --- a/app/views/blog/posts/_comment.html.erb +++ b/app/views/refinery/blog/posts/_comment.html.erb @@ -3,8 +3,8 @@ <%= simple_format auto_link(comment.message.to_s) %> <footer class='blog_comment_author'> <p> - <%= t('by', :scope => 'blog.posts.comments', :who => comment.name) %>, - <%= t('time_ago', :scope => 'blog.posts.comments', :time => time_ago_in_words(comment.created_at)) %> + <%= t('by', :scope => 'refinery.blog.posts.comments', :who => comment.name) %>, + <%= t('time_ago', :scope => 'refinery.blog.posts.comments', :time => time_ago_in_words(comment.created_at)) %> </p> </footer> </article> diff --git a/app/views/refinery/blog/posts/_comments.html.erb b/app/views/refinery/blog/posts/_comments.html.erb new file mode 100644 index 0000000..9bc0a13 --- /dev/null +++ b/app/views/refinery/blog/posts/_comments.html.erb @@ -0,0 +1,40 @@ +<aside id="comments"> + <h2><%= t('title', :scope => 'refinery.blog.posts.show.comments') %></h2> + <% if (comments = @blog_post.comments.approved).any? %> + <%= render :partial => "comment", :collection => comments %> + <% else %> + <p> + <%= t('none', :scope => 'refinery.blog.shared.comments') %>. + </p> + <% end %> + + <% flash.each do |key, value| %> + <div id='flash' class="flash flash_<%= key %>"> + <%= value %> + </div> + <% end %> + + <h2><%= t('add', :scope => 'refinery.blog.posts.show.comments') %></h2> + <%= form_for [main_app, :blog_post, @blog_comment] do |f| %> + <%= render :partial => "/refinery/admin/error_messages", + :locals => { + :object => f.object, + :include_object_name => true + } %> + <div class='field'> + <%= f.label :name %> + <%= f.text_field :name %> + </div> + <div class='field'> + <%= f.label :email %> + <%= f.email_field :email %> + </div> + <div class='field message_field'> + <%= f.label :message %> + <%= f.text_area :message, :rows => 6 %> + </div> + <div class='field form-actions'> + <%= f.submit t('submit', :scope => 'refinery.blog.posts.show') %> + </div> + <% end %> +</aside> diff --git a/app/views/refinery/blog/posts/_nav.html.erb b/app/views/refinery/blog/posts/_nav.html.erb new file mode 100644 index 0000000..67aed14 --- /dev/null +++ b/app/views/refinery/blog/posts/_nav.html.erb @@ -0,0 +1,17 @@ +<nav id="next_prev_article"> + <% if @blog_post.next.present? -%> + <%= link_to (truncate(@blog_post.next.title) + " »").html_safe, + main_app.url_for(@blog_post.next), + :class => 'next' %> + <% end -%> + + <%= link_to t('blog_home', :scope => 'refinery.blog.posts.show'), + main_app.blog_root_path, + :class => 'home' %> + + <% if @blog_post.prev.present? -%> + <%= link_to ("« " + truncate(@blog_post.prev.title)).html_safe, + main_app.url_for(@blog_post.prev), + :class => 'prev' %> + <% end -%> +</nav><!-- /next_prev_article --> diff --git a/app/views/blog/posts/_post.html.erb b/app/views/refinery/blog/posts/_post.html.erb index 12978d3..cbecc5f 100644 --- a/app/views/blog/posts/_post.html.erb +++ b/app/views/refinery/blog/posts/_post.html.erb @@ -8,14 +8,14 @@ <h1><%= @blog_post.title %></h1> <section class='details'> <time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'> - <%= t('created_at', :scope => 'blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %> + <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %> </time> - <%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>. + <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>. <% if (categories = @blog_post.categories).any? %> <aside class='filed_in'> - <%= t('filed_in', :scope => 'blog.posts.show') %> + <%= t('filed_in', :scope => 'refinery.blog.posts.show') %> <% categories.each_with_index do |category, index| %> - <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %> + <%= link_to category.title, main_app.blog_category_path(category) -%><%= ',' if index < ((categories.length) - 1) %> <% end %> </aside> <% end %> @@ -23,9 +23,9 @@ </header> <%= @blog_post.body.html_safe %> - <% if BlogPost::ShareThis.enabled? %> + <% if Refinery::Blog::Post::ShareThis.enabled? %> <span class="st_sharethis" displayText="ShareThis"></span> <% end %> </article> -<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%> +<%= render :partial => '/refinery/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%> <%= render 'nav' if next_or_previous?(@blog_post) %> diff --git a/app/views/refinery/blog/posts/archive.html.erb b/app/views/refinery/blog/posts/archive.html.erb new file mode 100644 index 0000000..c7a2c92 --- /dev/null +++ b/app/views/refinery/blog/posts/archive.html.erb @@ -0,0 +1,15 @@ +<% content_for :body_content_left do %> + <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1> + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> + </section> + <% else %> + <p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p> + <% end %> +<% end %> + +<%= render :partial => '/refinery/blog/shared/body_content_right' %> + +<%= render :partial => "/refinery/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/frontend') %> diff --git a/app/views/refinery/blog/posts/index.html.erb b/app/views/refinery/blog/posts/index.html.erb new file mode 100644 index 0000000..4eef04f --- /dev/null +++ b/app/views/refinery/blog/posts/index.html.erb @@ -0,0 +1,20 @@ +<% content_for :body_content_left do %> + <%=raw @page[::Refinery::Page.default_parts.first.to_sym] if ::Refinery::Page.default_parts.any? %> + + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> + </section> + <% else %> + <p><%= t('.no_blog_articles_yet') %></p> + <% end %> +<% end %> + +<% content_for :body_content_right_prepend do -%> + <%= raw @page[::Refinery::Page.default_parts.second.to_sym] if ::Refinery::Page.default_parts.many? %> +<% end -%> +<%= render :partial => '/refinery/blog/shared/body_content_right' %> + +<%= render :partial => "/refinery/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/frontend') %> diff --git a/app/views/blog/posts/index.rss.builder b/app/views/refinery/blog/posts/index.rss.builder index 51fa4da..8cd89b7 100644 --- a/app/views/blog/posts/index.rss.builder +++ b/app/views/refinery/blog/posts/index.rss.builder @@ -1,16 +1,16 @@ xml.instruct! :xml, :version => "1.0" xml.rss :version => "2.0" do xml.channel do - xml.title RefinerySetting.find_or_set(:site_name, "Company Name") - xml.description RefinerySetting.find_or_set(:site_name, "Company Name") + " Blog Posts" - xml.link blog_root_url + xml.title ::Refinery::Setting.find_or_set(:site_name, "Company Name") + xml.description ::Refinery::Setting.find_or_set(:site_name, "Company Name") + " Blog Posts" + xml.link main_app.blog_root_url @blog_posts.each do |post| xml.item do xml.title post.title xml.description post.body xml.pubDate post.published_at.to_s(:rfc822) - xml.link blog_post_url(post) + xml.link main_app.blog_post_url(post) end end end diff --git a/app/views/refinery/blog/posts/show.html.erb b/app/views/refinery/blog/posts/show.html.erb new file mode 100644 index 0000000..2ca168e --- /dev/null +++ b/app/views/refinery/blog/posts/show.html.erb @@ -0,0 +1,21 @@ +<% content_for :body_content_left do %> + <div id="show_blog_post"> + <%= render 'post' %> + </div> + + <% if Refinery::Blog::Post.comments_allowed? %> + <%= render 'comments'%> + <% end %> +<% end %> + +<%= render :partial => '/refinery/blog/shared/body_content_right' %> + +<%= render :partial => "/refinery/content_page", :locals => { :remove_automatic_sections => true } %> + +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/frontend') %> +<% content_for :javascripts do %> + <%# enable AJAX'd post nav at your own risk until html5 history API implemented. %> + <%#= javascript_include_tag('refinery/blog/frontend') %> + <script src="http://w.sharethis.com/button/buttons.js"></script> + <script>stLight.options({publisher:'<%= Blog::Post::ShareThis.key %>'});</script> +<% end if Refinery::Blog::Post::ShareThis.enabled? %> diff --git a/app/views/refinery/blog/posts/tagged.html.erb b/app/views/refinery/blog/posts/tagged.html.erb new file mode 100644 index 0000000..477d2b7 --- /dev/null +++ b/app/views/refinery/blog/posts/tagged.html.erb @@ -0,0 +1,17 @@ +<% content_for :body_content_title, "#{t('.posts_tagged')} “#{@tag_name.titleize}”".html_safe -%> + +<% content_for :body_content_left do %> + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> + </section> + <% else %> + <p><%= t('.no_blog_articles_yet') %></p> + <% end %> +<% end %> + +<%= render :partial => '/refinery/blog/shared/body_content_right' %> + +<%= render :partial => "/refinery/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/frontend') %> diff --git a/app/views/refinery/blog/shared/_body_content_right.html.erb b/app/views/refinery/blog/shared/_body_content_right.html.erb new file mode 100644 index 0000000..bd73d1c --- /dev/null +++ b/app/views/refinery/blog/shared/_body_content_right.html.erb @@ -0,0 +1,9 @@ +<% content_for :body_content_right do %> + <%= yield(:body_content_right_prepend) %> + <%= render :partial => "/refinery/blog/shared/rss_feed" %> + <%= render :partial => "/refinery/blog/shared/categories" %> + <%= render :partial => "/refinery/blog/shared/tags" %> + <%= render :partial => "/refinery/blog/shared/posts" %> + <%= blog_archive_widget %> + <%= yield(:body_content_right_append) %> +<% end %> diff --git a/app/views/blog/shared/_categories.html.erb b/app/views/refinery/blog/shared/_categories.html.erb index 05cc53f..1280cd2 100644 --- a/app/views/blog/shared/_categories.html.erb +++ b/app/views/refinery/blog/shared/_categories.html.erb @@ -2,8 +2,8 @@ <h2><%= t('.title') %></h2> <ul id='categories'> <% @blog_categories.each do |category| %> - <li<%= " class='selected'" if @category.present? and @category.id == category.id %>> - <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %> + <li<%= " class='selected'" if @blog_category.present? and @blog_category.id == category.id %>> + <%= link_to "#{category.title} (#{category.post_count})", main_app.blog_category_path(category) %> </li> <% end %> </ul> diff --git a/app/views/blog/shared/_post.html.erb b/app/views/refinery/blog/shared/_post.html.erb index 6cda22d..c384bcb 100644 --- a/app/views/blog/shared/_post.html.erb +++ b/app/views/refinery/blog/shared/_post.html.erb @@ -1,22 +1,22 @@ <% if post.live? %> <article class="blog_post" id="<%= dom_id(post) %>"> <header> - <h1><%= link_to post.title, blog_post_url(post) %></h1> + <h1><%= link_to post.title, main_app.blog_post_path(post) %></h1> <section class='details'> <time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'> - <%= t('created_at', :scope => 'blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %> + <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %> </time> - <%= "#{t('by', :scope => 'blog.posts.show')} #{post.author.username}" if post.author.present? %>. + <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{post.author.username}" if post.author.present? %>. <% if (categories = post.categories).any? %> <aside class='filed_in'> - <%= t('filed_in', :scope => 'blog.posts.show') %> - <%=raw categories.collect { |category| link_to category.title, blog_category_url(category) }.to_sentence %> + <%= t('filed_in', :scope => 'refinery.blog.posts.show') %> + <%=raw categories.collect { |category| link_to category.title, main_app.blog_category_path(category) }.to_sentence %> </aside> <% end %> <% if (tags = post.tags).any? %> <aside class='tagged'> - <%= t('tagged', :scope => 'blog.posts.show') %> - <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %> + <%= t('tagged', :scope => 'refinery.blog.posts.show') %> + <%=raw tags.collect { |tag| link_to tag, main_app.tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %> </aside> <% end %> </section> @@ -30,14 +30,14 @@ </section> <footer> <p> - <%= link_to t('read_more', :scope => 'blog.shared.posts'), blog_post_url(post) if blog_post_teaser_enabled? %> + <%= link_to t('read_more', :scope => 'refinery.blog.shared.posts'), main_app.blog_post_path(post) if blog_post_teaser_enabled? %> </p> <aside class='comment_count'> - <% if BlogPost.comments_allowed? %> + <% if Refinery::Blog::Post.comments_allowed? %> <% if post.comments.any? %> - (<%= pluralize(post.comments.approved.count, t('singular', :scope => 'blog.shared.comments')) %>) + (<%= pluralize(post.comments.approved.count, t('singular', :scope => 'refinery.blog.shared.comments')) %>) <% else %> - (<%= t('none', :scope => 'blog.shared.comments') %>) + (<%= t('none', :scope => 'refinery.blog.shared.comments') %>) <% end %> <% end %> </aside> diff --git a/app/views/blog/shared/_posts.html.erb b/app/views/refinery/blog/shared/_posts.html.erb index 24a8199..7dc570b 100644 --- a/app/views/blog/shared/_posts.html.erb +++ b/app/views/refinery/blog/shared/_posts.html.erb @@ -3,7 +3,7 @@ <ul id="blog_posts"> <% @blog_posts.each do |blog_post| %> <li class='clearfix'> - <%= link_to blog_post.title, blog_post_url(blog_post) %> + <%= link_to blog_post.title, main_app.blog_post_path(blog_post) %> </li> <% end %> </ul> diff --git a/app/views/refinery/blog/shared/_rss_feed.html.erb b/app/views/refinery/blog/shared/_rss_feed.html.erb new file mode 100644 index 0000000..5ece5ae --- /dev/null +++ b/app/views/refinery/blog/shared/_rss_feed.html.erb @@ -0,0 +1,2 @@ +<h2><%= t('.title') %></h2> +<%= link_to t('.subscribe'), main_app.blog_rss_feed_path, :id => "rss_feed_subscribe"%> diff --git a/app/views/blog/shared/_tags.html.erb b/app/views/refinery/blog/shared/_tags.html.erb index b0b11ee..5a72b81 100644 --- a/app/views/blog/shared/_tags.html.erb +++ b/app/views/refinery/blog/shared/_tags.html.erb @@ -2,7 +2,7 @@ <h2><%= t('.title') %></h2> <nav id='tags'> <% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %> - <%= link_to tag.name, tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %> + <%= link_to tag.name, main_app.tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %> <% end %> </nav> <% end %>
\ No newline at end of file diff --git a/app/views/refinery/blog/widgets/_blog_archive.html.erb b/app/views/refinery/blog/widgets/_blog_archive.html.erb new file mode 100644 index 0000000..7679a5b --- /dev/null +++ b/app/views/refinery/blog/widgets/_blog_archive.html.erb @@ -0,0 +1,10 @@ +<section id="blog_archive_widget"> + <h2><%= t('archives', :scope => 'refinery.blog.shared') %></h2> + <nav> + <ul> + <% posts.each do |post| %> + <li><%= archive_link(post) %></li> + <% end %> + </ul> + </nav> +</section>
\ No newline at end of file diff --git a/app/views/refinery/shared/admin/_autocomplete.html.erb b/app/views/refinery/shared/admin/_autocomplete.html.erb new file mode 100644 index 0000000..bf495e0 --- /dev/null +++ b/app/views/refinery/shared/admin/_autocomplete.html.erb @@ -0,0 +1,5 @@ +<% content_for :stylesheets, stylesheet_link_tag("refinery/blog/ui-lightness/jquery-ui-1.8.13.custom") %> + +<% content_for :javascripts do %> + <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" %> +<% end %>
\ No newline at end of file diff --git a/app/views/shared/admin/_autocomplete.html.erb b/app/views/shared/admin/_autocomplete.html.erb deleted file mode 100644 index b4898cc..0000000 --- a/app/views/shared/admin/_autocomplete.html.erb +++ /dev/null @@ -1,55 +0,0 @@ -<% content_for :stylesheets, stylesheet_link_tag("ui-lightness/jquery-ui-1.8.13.custom.css") -%> - -<% content_for :javascripts do %> - <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" %> - <script> - function split( val ) { - return val.split( /,\s*/ ); - } - function extractLast( term ) { - return split( term ).pop(); - } - - - $(document).ready(function(){ - page_options.init(false, '', '') - - $('<%= dom_id %>') - .bind( "keydown", function( event ) { - if ( event.keyCode === $.ui.keyCode.TAB && - $( this ).data( "autocomplete" ).menu.active ) { - event.preventDefault() - } - }) - .autocomplete({ - source: function( request, response ) { - $.getJSON( "<%= url %>", { - term: extractLast( request.term ) - }, response ); - }, - search: function() { - // custom minLength - var term = extractLast( this.value ); - if ( term.length < 2 ) { - return false; - } - }, - focus: function() { - // prevent value inserted on focus - return false; - }, - select: function( event, ui ) { - var terms = split( this.value ); - // remove the current input - terms.pop(); - // add the selected item - terms.push( ui.item.value ); - // add placeholder to get the comma-and-space at the end - terms.push( "" ); - this.value = terms.join( ", " ); - return false; - } - }) - }); - </script> -<% end %>
\ No newline at end of file diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 3044acd..f7ed37c 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1,158 +1,159 @@ bg: - plugins: - refinerycms_blog: - title: Блог - admin: - blog: - categories: - category: - edit: Редактиране на тази категория - delete: Изтриване на тази категория завинаги - index: - no_items_yet: 'Все още няма категории. Натиснете "%{create}", за да въведете нова.' - comments: - approved: 'Коментара от "%{author}" бе одобрен.' - comment: - view_live_html: 'Преглед на този коментар <br/><em>(ще се отвори се в нов прозорец)</em>' - read: Прочитане на този коментар - reject: Отхвърляне на този коментар - approve: Одобряване на този коментар - rejected: 'Коментара от "%{author}" бе отхвърлен.' - index: - no_items_yet: '%{type} коментари не бяха намерени.' - show: - comment: Коментар - blog_post: Публикация - from: Публикувано от - date: Публикувано на - message: Коментар - details: Детайли - age: Възраст - actions: Действия - back: Обратно към всички коментари - reject: Отхвърляне на този коментар - approve: Одобряване на този коментар - posts: - form: - advanced_options: Разширени настройки - toggle_advanced_options: Натиснете, за да достъпите настройките за етикета "meta" и менюто - save_as_draft: Запис като чернова - published_at: Дата на публикуване - custom_url: Уеб адрес по избор - custom_url_help: Вместо от заглавието, генерирайте уеб адреса за тази публикация чрез този текст. - copy_body: Копиране на съдържанието на публикацията като извадка - copy_body_help: Съдържанието на публикацията ще се копира като извадка. Оставете извадката празна и Refinery автоматично ще я сглоби. - index: - no_items_yet: 'Все още няма публикации. Натиснете "%{create}", за да въведете нова.' - uncategorized: - no_items_yet: 'Не съществуват некатегоризирани публикации.' - post: - view_live_html: 'Преглед на този публикация <br/><em>(ще се отвори се в нов прозорец)</em>' - edit: Редактиране на тази публикация - delete: Изтриване на тази публикация завинаги - settings: - notification_recipients: - value: Изпращане на уведомления до - explanation: 'Всеки път, когато някой коментира публикация, Refinery ще изпраща е-писмо, за да уведоми, че съществува нов коментар.' - hint: 'При добавяне на коментар, Refinery ще Ви уведоми по е-пощата.' - example: "Въведете адреса(ите) на Вашата е-поща. Например: jack@work.com, jill@office.com" - updated: 'Уведомления бяха изпратени до "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Блог + admin: + blog: categories: - title: Категории - manage: Управление - new: Добавяне на нова категория + category: + edit: Редактиране на тази категория + delete: Изтриване на тази категория завинаги + index: + no_items_yet: 'Все още няма категории. Натиснете "%{create}", за да въведете нова.' comments: - title: Коментари - title_with_count: 'Коментари (%{new_count} нови)' - new: Нови - unmoderated: Нови - approved: Одобрени - rejected: Отхвърлени + approved: 'Коментара от "%{author}" бе одобрен.' + comment: + view_live_html: 'Преглед на този коментар <br/><em>(ще се отвори се в нов прозорец)</em>' + read: Прочитане на този коментар + reject: Отхвърляне на този коментар + approve: Одобряване на този коментар + rejected: 'Коментара от "%{author}" бе отхвърлен.' + index: + no_items_yet: '%{type} коментари не бяха намерени.' + show: + comment: Коментар + blog_post: Публикация + from: Публикувано от + date: Публикувано на + message: Коментар + details: Детайли + age: Възраст + actions: Действия + back: Обратно към всички коментари + reject: Отхвърляне на този коментар + approve: Одобряване на този коментар posts: - title: Публикации - manage: Управление на публикации - new: Добавяне на нова публикация - uncategorized: Некатегоризирани публикации + form: + advanced_options: Разширени настройки + toggle_advanced_options: Натиснете, за да достъпите настройките за етикета "meta" и менюто + save_as_draft: Запис като чернова + published_at: Дата на публикуване + custom_url: Уеб адрес по избор + custom_url_help: Вместо от заглавието, генерирайте уеб адреса за тази публикация чрез този текст. + copy_body: Копиране на съдържанието на публикацията като извадка + copy_body_help: Съдържанието на публикацията ще се копира като извадка. Оставете извадката празна и Refinery автоматично ще я сглоби. + index: + no_items_yet: 'Все още няма публикации. Натиснете "%{create}", за да въведете нова.' + uncategorized: + no_items_yet: 'Не съществуват некатегоризирани публикации.' + post: + view_live_html: 'Преглед на този публикация <br/><em>(ще се отвори се в нов прозорец)</em>' + edit: Редактиране на тази публикация + delete: Изтриване на тази публикация завинаги settings: - title: Настройки - moderation: Модерация - update_notified: Получатели на уведомления - comments: Коментари - blog: - comment_mailer: - notification: - greeting: Здравейте - you_recieved_new_comment: Току що получихте нов коментар на Вашия уебсайт. - comment_starts: --- Начало на коментара --- - comment_ends: --- Край на коментара --- - from: От - email: Е-поща - message: Съобщение - closing_line: Поздрави - ps: 'П.П. Всички Ваши коментари се съхраняват от Refinery в секция "Блог" в подменю "Коментари" и могат да бъдат прегледани по-късно.' - shared: + notification_recipients: + value: Изпращане на уведомления до + explanation: 'Всеки път, когато някой коментира публикация, Refinery ще изпраща е-писмо, за да уведоми, че съществува нов коментар.' + hint: 'При добавяне на коментар, Refinery ще Ви уведоми по е-пощата.' + example: "Въведете адреса(ите) на Вашата е-поща. Например: jack@work.com, jill@office.com" + updated: 'Уведомления бяха изпратени до "%{recipients}"' + submenu: + categories: + title: Категории + manage: Управление + new: Добавяне на нова категория + comments: + title: Коментари + title_with_count: 'Коментари (%{new_count} нови)' + new: Нови + unmoderated: Нови + approved: Одобрени + rejected: Отхвърлени + posts: + title: Публикации + manage: Управление на публикации + new: Добавяне на нова публикация + uncategorized: Некатегоризирани публикации + settings: + title: Настройки + moderation: Модерация + update_notified: Получатели на уведомления + comments: Коментари + blog: + comment_mailer: + notification: + greeting: Здравейте + you_recieved_new_comment: Току що получихте нов коментар на Вашия уебсайт. + comment_starts: --- Начало на коментара --- + comment_ends: --- Край на коментара --- + from: От + email: Е-поща + message: Съобщение + closing_line: Поздрави + ps: 'П.П. Всички Ваши коментари се съхраняват от Refinery в секция "Блог" в подменю "Коментари" и могат да бъдат прегледани по-късно.' + shared: + categories: + title: Категории + rss_feed: + title: RSS хранилка + subscribe: Абониране + posts: + other: Други публикации + created_at: 'Публикувано на %{when}' + read_more: Цялата публикация + comments: + singular: коментар + none: няма коментари + archives: Архиви + tags: + title: "Етикети" categories: - title: Категории - rss_feed: - title: RSS хранилка - subscribe: Абониране + show: + no_posts: Тук все още няма публикации. posts: - other: Други публикации - created_at: 'Публикувано на %{when}' - read_more: Цялата публикация - comments: - singular: коментар - none: няма коментари - archives: Архиви - tags: - title: "Етикети" - categories: - show: - no_posts: Тук все още няма публикации. - posts: - post: - filed_in: Категория - comment: коментар - comments: - by: 'Публикувано от %{who}' - time_ago: 'преди %{time}' - thank_you: 'Благодаря за Вашия коментар.' - thank_you_moderated: 'Благодаря за Вашия коментар. Съобщението Ви е в опашката за модерация и скоро ще бъде показано.' - index: - no_blog_articles_yet: Все още няма публикувани статии. Очаквайте скоро. - show: - blog_home: Обратно към началото на блога + post: + filed_in: Категория + comment: коментар comments: - title: Коментари - add: Вашият коментар - other: Други публикации - filed_in: Категория - tagged: Отбелязано с - submit: Изпращане на коментар - name: Име - email: Е-поща - message: Съобщение - by: от - tagged: - no_blog_articles_yet: Все още няма публикувани статии. Очаквайте скоро. - posts_tagged: Публикации отбелязани с - archive: - blog_archive_for: 'Архив на блога за %{date}' - no_blog_articles_posted: 'Все още няма публикувани статии за %{date}. Очаквайте скоро.' + by: 'Публикувано от %{who}' + time_ago: 'преди %{time}' + thank_you: 'Благодаря за Вашия коментар.' + thank_you_moderated: 'Благодаря за Вашия коментар. Съобщението Ви е в опашката за модерация и скоро ще бъде показано.' + index: + no_blog_articles_yet: Все още няма публикувани статии. Очаквайте скоро. + show: + blog_home: Обратно към началото на блога + comments: + title: Коментари + add: Вашият коментар + other: Други публикации + filed_in: Категория + tagged: Отбелязано с + submit: Изпращане на коментар + name: Име + email: Е-поща + message: Съобщение + by: от + tagged: + no_blog_articles_yet: Все още няма публикувани статии. Очаквайте скоро. + posts_tagged: Публикации отбелязани с + archive: + blog_archive_for: 'Архив на блога за %{date}' + no_blog_articles_posted: 'Все още няма публикувани статии за %{date}. Очаквайте скоро.' activerecord: models: - blog_category: Категория - blog_comment: Коментар - blog_post: Публикация + refinery/blog_category: Категория + refinery/blog_comment: Коментар + refinery/blog_post: Публикация attributes: - blog_category: + refinery/blog_category: title: Заглавие - blog_comment: + refinery/blog_comment: name: Име email: Е-поща message: Съобщение - blog_post: + refinery/blog_post: title: Заглавие body: Съдържание teaser: Извадка diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 8d8d81d..10f02b6 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1,128 +1,129 @@ cs: - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - categories: - category: - edit: Upravit kategorii - delete: Smazat kategorii - index: - no_items_yet: 'Nejsou zde žádné kategorie. Klikni na "%{create}" pro přidání první.' - comments: - approved: 'Komentář od "%{author}" byl schválen.' - comment: - view_live_html: 'Zobrazit živý náhled <br/><em>(otevře nové okno)</em>' - read: Zobrazit komentář - reject: Zamítnout komentář - approve: Schválit - rejected: 'Komentář od "%{author}" byl zamítnut.' - index: - no_items_yet: 'Nejsou zde žádné %{type} komentáře.' - show: - comment: Komentář - blog_post: Blog článek - from: Odeslal - date: Datum - message: Komentář - details: Detaily - age: Věk - actions: Akce - back: Zpět na seznam komentářů - reject: Zamítnout komentář - approve: Schváliť komentář - posts: - form: - advanced_options: Pokročilé nastavení - toggle_advanced_options: Klikni pro přístup k nastavením meta tagů a menu - save_as_draft: Uložit jako koncept - published_at: Datum publikování - index: - no_items_yet: 'Nejsou žádné články na blogu. Klikni na "%{create}" pro přidání prvního.' - uncategorized: - no_items_yet: 'Nejsou žádné nekategorizované články.' - post: - view_live_html: 'Zobrazit článek <br/><em>(otevře jej v novém okně)</em>' - edit: Upravit článek - delete: Smazat článek - settings: - notification_recipients: - value: Poslat notifikaci pro - explanation: 'Vždycky když někdo přidá komentář, Refinery zašle oznámení.' - hint: 'Vždycky když někdo přidá komentář, Refinery ti pošle oznámení.' - example: "Zadej tvou emailovou adresu(y) jako například: jack@work.com, jill@office.com" - updated: 'Seznam příjemců notifikací "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Kategorie - manage: Spravovat - new: Nová kategórie + category: + edit: Upravit kategorii + delete: Smazat kategorii + index: + no_items_yet: 'Nejsou zde žádné kategorie. Klikni na "%{create}" pro přidání první.' comments: - title: Komentáře - title_with_count: 'Komentáře (%{new_count} nových)' - new: Nový - unmoderated: Nový - approved: Schválený - rejected: Zamítnutý + approved: 'Komentář od "%{author}" byl schválen.' + comment: + view_live_html: 'Zobrazit živý náhled <br/><em>(otevře nové okno)</em>' + read: Zobrazit komentář + reject: Zamítnout komentář + approve: Schválit + rejected: 'Komentář od "%{author}" byl zamítnut.' + index: + no_items_yet: 'Nejsou zde žádné %{type} komentáře.' + show: + comment: Komentář + blog_post: Blog článek + from: Odeslal + date: Datum + message: Komentář + details: Detaily + age: Věk + actions: Akce + back: Zpět na seznam komentářů + reject: Zamítnout komentář + approve: Schváliť komentář posts: - title: Články - manage: Spravovat články - new: Vytvořit nový článek - uncategorized: Nekategorizované články + form: + advanced_options: Pokročilé nastavení + toggle_advanced_options: Klikni pro přístup k nastavením meta tagů a menu + save_as_draft: Uložit jako koncept + published_at: Datum publikování + index: + no_items_yet: 'Nejsou žádné články na blogu. Klikni na "%{create}" pro přidání prvního.' + uncategorized: + no_items_yet: 'Nejsou žádné nekategorizované články.' + post: + view_live_html: 'Zobrazit článek <br/><em>(otevře jej v novém okně)</em>' + edit: Upravit článek + delete: Smazat článek settings: - title: Nastavení - moderation: Moderování - update_notified: Upravit seznam notifikovaných - comments: Komentáře - blog: - comment_mailer: - notification: - greeting: Ahoj - you_recieved_new_comment: Máš nový komentář na stránce - comment_starts: --- začátek komentáře --- - comment_ends: --- konec komentáře --- - from: Od - email: Email - message: Zpráva - closing_line: S pozdravem - ps: 'P.S. Všechny komentáře jsou uloženy v sekci "Blog" pod záložkou "Komentáře" v případě pokud by je bylo třeba zobrazit později.' - shared: + notification_recipients: + value: Poslat notifikaci pro + explanation: 'Vždycky když někdo přidá komentář, Refinery zašle oznámení.' + hint: 'Vždycky když někdo přidá komentář, Refinery ti pošle oznámení.' + example: "Zadej tvou emailovou adresu(y) jako například: jack@work.com, jill@office.com" + updated: 'Seznam příjemců notifikací "%{recipients}"' + submenu: + categories: + title: Kategorie + manage: Spravovat + new: Nová kategórie + comments: + title: Komentáře + title_with_count: 'Komentáře (%{new_count} nových)' + new: Nový + unmoderated: Nový + approved: Schválený + rejected: Zamítnutý + posts: + title: Články + manage: Spravovat články + new: Vytvořit nový článek + uncategorized: Nekategorizované články + settings: + title: Nastavení + moderation: Moderování + update_notified: Upravit seznam notifikovaných + comments: Komentáře + blog: + comment_mailer: + notification: + greeting: Ahoj + you_recieved_new_comment: Máš nový komentář na stránce + comment_starts: --- začátek komentáře --- + comment_ends: --- konec komentáře --- + from: Od + email: Email + message: Zpráva + closing_line: S pozdravem + ps: 'P.S. Všechny komentáře jsou uloženy v sekci "Blog" pod záložkou "Komentáře" v případě pokud by je bylo třeba zobrazit později.' + shared: + categories: + title: Kategorie + rss_feed: + title: RSS zdroj článků + subscribe: Přihlásit k odběru + posts: + other: Další články + created_at: 'Publikován %{when}' + read_more: Celý článek + comments: + singular: komentář + none: žiadne komentáře + archives: Archiv categories: - title: Kategorie - rss_feed: - title: RSS zdroj článků - subscribe: Přihlásit k odběru + show: + no_posts: Nejsou zde žádné články. posts: - other: Další články - created_at: 'Publikován %{when}' - read_more: Celý článek - comments: - singular: komentář - none: žiadne komentáře - archives: Archiv - categories: - show: - no_posts: Nejsou zde žádné články. - posts: - post: - filed_in: Podaný - comment: komentář - comments: - by: 'Odeslal %{who}' - time_ago: '%{time} zpět' - thank_you: 'Díky za komentář.' - thank_you_moderated: 'Děkujeme za Váš komentář. Vaše zpráva čeká na schválení a objeví se v nejbližší době.' - index: - no_blog_articles_yet: Právě nejsou žádné články na blogu. Zůstaňte naladěni. - show: - blog_home: Hlavní stránka blogu + post: + filed_in: Podaný + comment: komentář comments: - title: Komentáře - add: Přidat komentář - other: Další články - filed_in: Podaný - submit: Odeslat komentář - archive: - blog_archive_for: 'Blog archiv pro %{date}' - no_blog_articles_posted: 'Nejsou žádné články publikované %{date}.' + by: 'Odeslal %{who}' + time_ago: '%{time} zpět' + thank_you: 'Díky za komentář.' + thank_you_moderated: 'Děkujeme za Váš komentář. Vaše zpráva čeká na schválení a objeví se v nejbližší době.' + index: + no_blog_articles_yet: Právě nejsou žádné články na blogu. Zůstaňte naladěni. + show: + blog_home: Hlavní stránka blogu + comments: + title: Komentáře + add: Přidat komentář + other: Další články + filed_in: Podaný + submit: Odeslat komentář + archive: + blog_archive_for: 'Blog archiv pro %{date}' + no_blog_articles_posted: 'Nejsou žádné články publikované %{date}.' diff --git a/config/locales/de.yml b/config/locales/de.yml index b7927f6..7b96846 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,130 +1,131 @@ de: - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - categories: - category: - edit: Diese Kategorie bearbeiten - delete: Diese Kategorie dauerhaft entfernen - index: - no_items_yet: 'Es sind noch keine Kategorien vorhanden. Klicken Sie auf "%{create}", um Ihre erste Kategorie hinzuzufügen.' - comments: - approved: 'Der Kommentar von "%{author}" wurde genehmigt.' - comment: - view_live: 'Diesen Kommentar live betrachten <br/><em>(öffnet sich in einem neuen Fenster)</em>' - read: Kommentar lesen - reject: Kommentar ablehnen - approve: Kommentar genehmigen - rejected: 'Der Kommentar von "%{author}" wurde abgelehnt.' - index: - no_items_yet: 'Es sind keine %{type}en Kommentare vorhanden.' - show: - comment: Kommentar - blog_post: Artikel - from: Verfasst von - date: Verfasst am - message: Kommentar - details: Details - age: Alter - actions: Aktionen - back: Zurück zu allen Kommentaren - reject: Kommentar ablehnen - approve: Kommentar genehmigen - posts: - form: - advanced_options: Erweiterte Optionen - toggle_advanced_options: 'Klicken, um auf Meta-Tag-Einstellungen und Menüoptionen zuzugreifen' - save_as_draft: Als Entwurf speichern - published_at: Veröffentlichungsdatum - index: - no_items_yet: 'Es sind noch keine Artikel vorhanden. Klicken Sie auf "%{create}", um Ihren ersten Artikel hinzuzufügen.' - uncategorized: - no_items_yet: 'Es sind keine unkategorisierten Artikel vorhanden.' - post: - view_live: 'Diesen Artikel live betrachten <br/><em>(öffnet sich in einem neuen Fenster)</em>' - edit: Diesen Artikel bearbeiten - delete: Diesen Artikel dauerhaft entfernen - settings: - notification_recipients: - value: Sende Benachrichtigungen an - explanation: 'Jedes Mal, wenn jemand einen Artikel kommentiert, sendet Refinery eine E-Mail Benachrichtigung aus, um über den neuen Kommentar zu informieren.' - hint: 'Refinery sendet eine E-Mail Benachrichtigung an Sie, wenn ein neuer Kommentar hinzugefügt wurde.' - example: 'Geben Sie Ihre E-Mail-Adresse(n) wie folgt ein: jack@work.com, jill@office.com' - updated: 'Empfänger für Benachrichtigungen wurden auf "%{recipients}" gesetzt' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Kategorien - manage: Verwalten - new: Neue Kategorie anlegen + category: + edit: Diese Kategorie bearbeiten + delete: Diese Kategorie dauerhaft entfernen + index: + no_items_yet: 'Es sind noch keine Kategorien vorhanden. Klicken Sie auf "%{create}", um Ihre erste Kategorie hinzuzufügen.' comments: - title: Kommentare - title_with_count: 'Kommentare (%{new_count} neu)' - new: Neu - unmoderated: Neu - approved: Genehmigt - rejected: Abgelehnt + approved: 'Der Kommentar von "%{author}" wurde genehmigt.' + comment: + view_live: 'Diesen Kommentar live betrachten <br/><em>(öffnet sich in einem neuen Fenster)</em>' + read: Kommentar lesen + reject: Kommentar ablehnen + approve: Kommentar genehmigen + rejected: 'Der Kommentar von "%{author}" wurde abgelehnt.' + index: + no_items_yet: 'Es sind keine %{type}en Kommentare vorhanden.' + show: + comment: Kommentar + blog_post: Artikel + from: Verfasst von + date: Verfasst am + message: Kommentar + details: Details + age: Alter + actions: Aktionen + back: Zurück zu allen Kommentaren + reject: Kommentar ablehnen + approve: Kommentar genehmigen posts: - title: Artikel - manage: Artikel verwalten - new: Neuen Artikel anlegen - uncategorized: Unkategorisierte Artikel + form: + advanced_options: Erweiterte Optionen + toggle_advanced_options: 'Klicken, um auf Meta-Tag-Einstellungen und Menüoptionen zuzugreifen' + save_as_draft: Als Entwurf speichern + published_at: Veröffentlichungsdatum + index: + no_items_yet: 'Es sind noch keine Artikel vorhanden. Klicken Sie auf "%{create}", um Ihren ersten Artikel hinzuzufügen.' + uncategorized: + no_items_yet: 'Es sind keine unkategorisierten Artikel vorhanden.' + post: + view_live: 'Diesen Artikel live betrachten <br/><em>(öffnet sich in einem neuen Fenster)</em>' + edit: Diesen Artikel bearbeiten + delete: Diesen Artikel dauerhaft entfernen settings: - title: Einstellungen - moderation: Moderation - update_notified: Empfänger für Benachrichtigungen bearbeiten - comments: Kommentare - blog: - comment_mailer: - notification: - greeting: Hallo - you_recieved_new_comment: Auf Ihrer Website wurde soeben ein neuer Kommentar hinzugefügt. - comment_starts: --- Kommentar beginnt --- - comment_ends: --- Kommentar endet --- - from: Von - email: E-Mail - message: Nachricht - closing_line: Mit besten Grüßen - ps: 'P.S. Alle Kommentare sind im "Blog" Abschnitt von Refinery - im Untermenü "Kommentare" - gespeichert, falls Sie diese später dort lesen möchten.' - shared: + notification_recipients: + value: Sende Benachrichtigungen an + explanation: 'Jedes Mal, wenn jemand einen Artikel kommentiert, sendet Refinery eine E-Mail Benachrichtigung aus, um über den neuen Kommentar zu informieren.' + hint: 'Refinery sendet eine E-Mail Benachrichtigung an Sie, wenn ein neuer Kommentar hinzugefügt wurde.' + example: 'Geben Sie Ihre E-Mail-Adresse(n) wie folgt ein: jack@work.com, jill@office.com' + updated: 'Empfänger für Benachrichtigungen wurden auf "%{recipients}" gesetzt' + submenu: + categories: + title: Kategorien + manage: Verwalten + new: Neue Kategorie anlegen + comments: + title: Kommentare + title_with_count: 'Kommentare (%{new_count} neu)' + new: Neu + unmoderated: Neu + approved: Genehmigt + rejected: Abgelehnt + posts: + title: Artikel + manage: Artikel verwalten + new: Neuen Artikel anlegen + uncategorized: Unkategorisierte Artikel + settings: + title: Einstellungen + moderation: Moderation + update_notified: Empfänger für Benachrichtigungen bearbeiten + comments: Kommentare + blog: + comment_mailer: + notification: + greeting: Hallo + you_recieved_new_comment: Auf Ihrer Website wurde soeben ein neuer Kommentar hinzugefügt. + comment_starts: --- Kommentar beginnt --- + comment_ends: --- Kommentar endet --- + from: Von + email: E-Mail + message: Nachricht + closing_line: Mit besten Grüßen + ps: 'P.S. Alle Kommentare sind im "Blog" Abschnitt von Refinery - im Untermenü "Kommentare" - gespeichert, falls Sie diese später dort lesen möchten.' + shared: + categories: + title: Kategorien + rss_feed: + title: RSS Feed + subscribe: Abonnieren + posts: + other: Andere Artikel + created_at: 'Verfasst am %{when}' + read_more: Mehr lesen + comments: + singular: Kommentar + none: Keine Kommentare + archives: Archiv + tags: + title: Kategorien categories: - title: Kategorien - rss_feed: - title: RSS Feed - subscribe: Abonnieren + show: + no_posts: Es sind noch keine Artikel vorhanden. posts: - other: Andere Artikel - created_at: 'Verfasst am %{when}' - read_more: Mehr lesen - comments: - singular: Kommentar - none: Keine Kommentare - archives: Archiv - tags: - title: Kategorien - categories: - show: - no_posts: Es sind noch keine Artikel vorhanden. - posts: - post: - filed_in: Gespeichert unter - comment: Kommentar - comments: - by: 'Verfasst von %{who}' - time_ago: 'vor %{time}' - thank_you: 'Danke für den Kommentar.' - thank_you_moderated: 'Danke für den Kommentar. Die Nachricht wurde in die Warteschlange der Moderation gestellt und erscheint in Kürze.' - index: - no_blog_articles_yet: Es wurden noch keine Artikel verfasst. - show: - blog_home: Blog Startseite + post: + filed_in: Gespeichert unter + comment: Kommentar comments: - title: Kommentare - add: Neuen Kommentar hinzufügen - other: Andere Artikel - filed_in: Gespeichert unter - submit: Kommentar senden - archive: - blog_archive_for: 'Blog Archiv für %{date}' - no_blog_articles_posted: 'Für %{date} wurden keine Artikel verfasst.' + by: 'Verfasst von %{who}' + time_ago: 'vor %{time}' + thank_you: 'Danke für den Kommentar.' + thank_you_moderated: 'Danke für den Kommentar. Die Nachricht wurde in die Warteschlange der Moderation gestellt und erscheint in Kürze.' + index: + no_blog_articles_yet: Es wurden noch keine Artikel verfasst. + show: + blog_home: Blog Startseite + comments: + title: Kommentare + add: Neuen Kommentar hinzufügen + other: Andere Artikel + filed_in: Gespeichert unter + submit: Kommentar senden + archive: + blog_archive_for: 'Blog Archiv für %{date}' + no_blog_articles_posted: 'Für %{date} wurden keine Artikel verfasst.' diff --git a/config/locales/en.yml b/config/locales/en.yml index 4f3acec..e3b69c4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,159 +1,160 @@ en: - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - categories: - category: - edit: Edit this category - delete: Delete this category forever - index: - no_items_yet: 'There are no categories yet. Click "%{create}" to add your first category.' - comments: - approved: 'The comment from "%{author}" has been approved.' - comment: - view_live_html: 'View this comment live <br/><em>(opens in a new window)</em>' - read: Read this comment - reject: Reject this comment - approve: Approve this comment - rejected: 'The comment from "%{author}" has been rejected.' - index: - no_items_yet: 'There are no %{type} comments.' - show: - comment: Comment - blog_post: Blog Post - from: Posted by - date: Posted at - message: Comment - details: Details - age: Age - actions: Actions - back: Back to all comments - reject: Reject this comment - approve: Approve this comment - posts: - form: - advanced_options: Advanced Options - toggle_advanced_options: Click to access meta tag settings and menu options - save_as_draft: Save as Draft - published_at: Publish Date - custom_url: Custom Url - custom_url_help: Generate the url for the blog post from this text instead of the title. - copy_body: Copy Post Body to Teaser - copy_body_help: Copies the post body to the teaser. Leave teaser blank to let Refinery automatically make the teaser. - index: - no_items_yet: 'There are no Blog Posts yet. Click "%{create}" to add your first blog post.' - uncategorized: - no_items_yet: 'There are no Uncategorized Blog Posts.' - post: - view_live_html: 'View this blog post live <br/><em>(opens in a new window)</em>' - edit: Edit this blog post - delete: Remove this blog post forever - settings: - notification_recipients: - value: Send notifications to - explanation: 'Every time someone comments on a blog post, Refinery sends out an email to say there is a new comment.' - hint: 'When a new comment is added, Refinery will send an email notification to you.' - example: "Enter your email address(es) like: jack@work.com, jill@office.com" - updated: 'Notification recipients have been set to "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Categories - manage: Manage - new: Create new category + category: + edit: Edit this category + delete: Delete this category forever + index: + no_items_yet: 'There are no categories yet. Click "%{create}" to add your first category.' comments: - title: Comments - title_with_count: 'Comments (%{new_count} new)' - new: New - unmoderated: New - approved: Approved - rejected: Rejected + approved: 'The comment from "%{author}" has been approved.' + comment: + view_live_html: 'View this comment live <br/><em>(opens in a new window)</em>' + read: Read this comment + reject: Reject this comment + approve: Approve this comment + rejected: 'The comment from "%{author}" has been rejected.' + index: + no_items_yet: 'There are no %{type} comments.' + show: + comment: Comment + blog_post: Blog Post + from: Posted by + date: Posted at + message: Comment + details: Details + age: Age + actions: Actions + back: Back to all comments + reject: Reject this comment + approve: Approve this comment posts: - title: Posts - manage: Manage posts - new: Create new post - uncategorized: Uncategorized posts + form: + advanced_options: Advanced Options + toggle_advanced_options: Click to access meta tag settings and menu options + save_as_draft: Save as Draft + published_at: Publish Date + custom_url: Custom Url + custom_url_help: Generate the url for the blog post from this text instead of the title. + copy_body: Copy Post Body to Teaser + copy_body_help: Copies the post body to the teaser. Leave teaser blank to let Refinery automatically make the teaser. + index: + no_items_yet: 'There are no Blog Posts yet. Click "%{create}" to add your first blog post.' + uncategorized: + no_items_yet: 'There are no Uncategorized Blog Posts.' + post: + view_live_html: 'View this blog post live <br/><em>(opens in a new window)</em>' + edit: Edit this blog post + delete: Remove this blog post forever settings: - title: Settings - moderation: Moderation - update_notified: Update who gets notified - comments: Comments - teasers: Teasers - blog: - comment_mailer: - notification: - greeting: Hi there - you_recieved_new_comment: You just received a new comment on your website. - comment_starts: --- comment starts --- - comment_ends: --- comment ends --- - from: From - email: Email - message: Message - closing_line: Kind Regards - ps: 'P.S. All your comments are stored in the "Blog" section of Refinery under the "Comments" submenu should you ever want to view it there later.' - shared: + notification_recipients: + value: Send notifications to + explanation: 'Every time someone comments on a blog post, Refinery sends out an email to say there is a new comment.' + hint: 'When a new comment is added, Refinery will send an email notification to you.' + example: "Enter your email address(es) like: jack@work.com, jill@office.com" + updated: 'Notification recipients have been set to "%{recipients}"' + submenu: + categories: + title: Categories + manage: Manage + new: Create new category + comments: + title: Comments + title_with_count: 'Comments (%{new_count} new)' + new: New + unmoderated: New + approved: Approved + rejected: Rejected + posts: + title: Posts + manage: Manage posts + new: Create new post + uncategorized: Uncategorized posts + settings: + title: Settings + moderation: Moderation + update_notified: Update who gets notified + comments: Comments + teasers: Teasers + blog: + comment_mailer: + notification: + greeting: Hi there + you_recieved_new_comment: You just received a new comment on your website. + comment_starts: --- comment starts --- + comment_ends: --- comment ends --- + from: From + email: Email + message: Message + closing_line: Kind Regards + ps: 'P.S. All your comments are stored in the "Blog" section of Refinery under the "Comments" submenu should you ever want to view it there later.' + shared: + categories: + title: Categories + rss_feed: + title: RSS Feed + subscribe: Subscribe + posts: + other: Other Posts + created_at: 'Posted on %{when}' + read_more: Read more + comments: + singular: comment + none: no comments + archives: Archives + tags: + title: "Tags" categories: - title: Categories - rss_feed: - title: RSS Feed - subscribe: Subscribe + show: + no_posts: There are no posts here yet. posts: - other: Other Posts - created_at: 'Posted on %{when}' - read_more: Read more - comments: - singular: comment - none: no comments - archives: Archives - tags: - title: "Tags" - categories: - show: - no_posts: There are no posts here yet. - posts: - post: - filed_in: Filed in - comment: comment - comments: - by: 'Posted by %{who}' - time_ago: '%{time} ago' - thank_you: 'Thank you for commenting.' - thank_you_moderated: 'Thank you for commenting. Your message has been placed in the moderation queue and will appear shortly.' - index: - no_blog_articles_yet: There are no blog articles posted yet. Stay tuned. - show: - blog_home: Blog Home + post: + filed_in: Filed in + comment: comment comments: - title: Comments - add: Make a Comment - other: Other Blog Posts - filed_in: Filed in - tagged: Tagged - submit: Send comment - name: Name - email: Email - message: Message - by: by - tagged: - no_blog_articles_yet: There are no blog articles posted yet. Stay tuned. - posts_tagged: Posts tagged - archive: - blog_archive_for: 'Blog Archive for %{date}' - no_blog_articles_posted: 'There are no blog articles posted for %{date}. Stay tuned.' + by: 'Posted by %{who}' + time_ago: '%{time} ago' + thank_you: 'Thank you for commenting.' + thank_you_moderated: 'Thank you for commenting. Your message has been placed in the moderation queue and will appear shortly.' + index: + no_blog_articles_yet: There are no blog articles posted yet. Stay tuned. + show: + blog_home: Blog Home + comments: + title: Comments + add: Make a Comment + other: Other Blog Posts + filed_in: Filed in + tagged: Tagged + submit: Send comment + name: Name + email: Email + message: Message + by: by + tagged: + no_blog_articles_yet: There are no blog articles posted yet. Stay tuned. + posts_tagged: Posts tagged + archive: + blog_archive_for: 'Blog Archive for %{date}' + no_blog_articles_posted: 'There are no blog articles posted for %{date}. Stay tuned.' activerecord: models: - blog_category: Category - blog_comment: Comment - blog_post: Blog post + refinery/blog_category: Category + refinery/blog_comment: Comment + refinery/blog_post: Blog post attributes: - blog_category: + refinery/blog_category: title: Title - blog_comment: + refinery/blog_comment: name: Name email: Email message: Message - blog_post: + refinery/blog_post: title: Title body: Body teaser: Teaser diff --git a/config/locales/es.yml b/config/locales/es.yml index 363d87f..fb22854 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,159 +1,129 @@ es: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: + categories: + category: + edit: Editar esta categoría + delete: Borrar esta categoría para siempre + index: + no_items_yet: 'Todavía no hay categorías. Haz click en "%{create}" para añadir la primera.' + comments: + approved: 'El comentario de "%{author}" ha sido aprobado.' + comment: + view_live_html: 'Ver este comentario<br/><em>(se abrirá en una ventana nueva)</em>' + read: Leer este comentario + reject: Rechazar este comentario + approve: Aprovar este comentario + rejected: 'El comentario de "%{author}" ha sido rechazado.' + index: + no_items_yet: 'No hay comentarios %{type}.' + show: + comment: Comentario + blog_post: Entrada en el Blog + from: Enviado por + date: Enviado el + message: Mensaje + details: Detalles + age: Edad + actions: Acciones + back: Volver a todos los comentarios + reject: Rechazar este comentario + approve: Aprovar este comentario + posts: + form: + advanced_options: Opciones avanzadas + toggle_advanced_options: Click para acceder a las opciones de menú y etiquetas + save_as_draft: Guardar Borrador + published_at: Fecha de publicación + index: + no_items_yet: 'Aún no hay entradas en el Blog. Haz click en "%{create}" para añadir el primero' + uncategorized: + no_items_yet: 'No hay entradas en el Blog sin categoría.' + post: + view_live_html: 'Ver entrada <br/><em>(se abrirá en una ventana nueva)</em>' + edit: Editar esta entrada + delete: Eliminar esta entrada para siempre + settings: + notification_recipients: + value: Enviar notificaciones a + explanation: 'Cada vez que alguien comente en una entrada, Refinery envia un email para avisar de que hay un nuevo comentario.' + hint: 'Refinery te avisará con un email cada vez que haya un nuevo comentario en tu Blog.' + example: 'Si deseas que las notificaciones lleguen a más de una cuenta, puedes usar comas para separarlas (pepe@direccionpersonal.com, jose@direccionlaboral.com, ...)' + updated: 'Las notifiaciones han sido enviadas a "%{recipients}"' + submenu: + categories: + title: Categorías + manage: Gestionar + new: Añadir categoría + comments: + title: Comentarios + title_with_count: 'Comentarios (%{new_count} nuevos)' + new: Nuevo + unmoderated: Nuevos + approved: Aprobados + rejected: Rechazados + posts: + title: Entradas + manage: Gestionar entradas + new: Crear nueva entrada + uncategorized: Entradas sin categoría + settings: + title: Configuración + moderation: Moderación + update_notified: '¿Quién recibe las notificaciones?' + comments: Comentarios blog: - categories: - category: - edit: Editar esta categoría - delete: Borrar esta categoría para siempre - index: - no_items_yet: 'Todavía no hay categorías. Haz click en "%{create}" para añadir la primera.' - comments: - approved: 'El comentario de "%{author}" ha sido aprobado.' - comment: - view_live_html: 'Ver este comentario<br/><em>(se abrirá en una ventana nueva)</em>' - read: Leer este comentario - reject: Rechazar este comentario - approve: Aprovar este comentario - rejected: 'El comentario de "%{author}" ha sido rechazado.' - index: - no_items_yet: 'No hay comentarios %{type}.' - show: - comment: Comentario - blog_post: Entrada en el Blog - from: Enviado por - date: Enviado el + comment_mailer: + notification: + greeting: Hola + you_recieved_new_comment: Han hecho un nuevo comentario en una de las entradas de tu Blog. + comment_starts: --- inicio comentario --- + comment_ends: --- fin comentario --- + from: De + email: Email message: Mensaje - details: Detalles - age: Edad - actions: Acciones - back: Volver a todos los comentarios - reject: Rechazar este comentario - approve: Aprovar este comentario - posts: - form: - advanced_options: Opciones avanzadas - toggle_advanced_options: Click para acceder a las opciones de menú y etiquetas - save_as_draft: Guardar Borrador - published_at: Fecha de publicación - custom_url: Url personalizada - custom_url_help: Generar la url de la entrada en el blog de este texto en lugar del título. - copy_body: Copia el cuerpo de la publicación a teaser. - copy_body_help: Copia el cuerpo de la publicación a teaser. Deja teaser en blanco para que Refinery automaticamente genere el teaser. - index: - no_items_yet: 'Aún no hay entradas en el Blog. Haz click en "%{create}" para añadir el primero' - uncategorized: - no_items_yet: 'No hay entradas en el Blog sin categoría.' - post: - view_live_html: 'Ver entrada <br/><em>(se abrirá en una ventana nueva)</em>' - edit: Editar esta entrada - delete: Eliminar esta entrada para siempre - settings: - notification_recipients: - value: Enviar notificaciones a - explanation: 'Cada vez que alguien comente en una entrada, Refinery envia un email para avisar de que hay un nuevo comentario.' - hint: 'Refinery te avisará con un email cada vez que haya un nuevo comentario en tu Blog.' - example: 'Si deseas que las notificaciones lleguen a más de una cuenta, puedes usar comas para separarlas (pepe@direccionpersonal.com, jose@direccionlaboral.com, ...)' - updated: 'Las notifiaciones han sido enviadas a "%{recipients}"' - submenu: + closing_line: Saludos + ps: 'P.D. Recuerda que puedes ver todos los comentarios en el apartado "Comentarios" dentro de la sección "Blog".' + shared: categories: title: Categorías - manage: Gestionar - new: Añadir categoría - comments: - title: Comentarios - title_with_count: 'Comentarios (%{new_count} nuevos)' - new: Nuevo - unmoderated: Nuevos - approved: Aprobados - rejected: Rechazados + rss_feed: + title: Feed RSS + subscribe: Suscribirse posts: - title: Entradas - manage: Gestionar entradas - new: Crear nueva entrada - uncategorized: Entradas sin categoría - settings: - title: Configuración - moderation: Moderación - update_notified: '¿Quién recibe las notificaciones?' - comments: Comentarios - teasers: Teasers - blog: - comment_mailer: - notification: - greeting: Hola - you_recieved_new_comment: Han hecho un nuevo comentario en una de las entradas de tu Blog. - comment_starts: --- inicio comentario --- - comment_ends: --- fin comentario --- - from: De - email: Email - message: Mensaje - closing_line: Saludos - ps: 'P.D. Recuerda que puedes ver todos los comentarios en el apartado "Comentarios" dentro de la sección "Blog".' - shared: + other: Otras entradas + created_at: 'Enviado hace %{when}' + read_more: Leer más + comments: + singular: comentario + none: no hay comentarios + archives: Archivos categories: - title: Categorías - rss_feed: - title: Feed RSS - subscribe: Suscribirse + show: + no_posts: Todavía no hay entradas. posts: - other: Otras entradas - created_at: 'Enviado hace %{when}' - read_more: Leer más - comments: - singular: comentario - none: no hay comentarios - archives: Archivos - tags: - title: "Etiquetas" - categories: - show: - no_posts: Todavía no hay entradas. - posts: - post: - filed_in: Archivado en - comment: comentario - comments: - by: 'Enviado por %{who}' - time_ago: 'Hace %{time}' - thank_you: Gracias por tu comentario. - thank_you_moderated: 'Gracias por tu comentario. Ha sido enviado a la cola de moderación y, si lo aprobamos, aparecerá dentro de poco.' - index: - no_blog_articles_yet: 'Todavía no hay artículos. ¡Pero vuelve pronto!' - show: - blog_home: 'Página principal del Blog' + post: + filed_in: Archivado en + comment: comentario comments: - title: Comentarios - add: 'Envía tu comentario' - other: Otros posts - filed_in: Archivado en - submit: Enviar comentario - tagged: Etiquetado en - name: Nombre - email: Email - message: Mensaje - by: por - tagged: - no_blog_articles_yet: Todavía no hay artículos. ¡Pero vuelve pronto!. - posts_tagged: Publicaciones etiquetadas - archive: - blog_archive_for: 'Archivo del blog en %{date}' - no_blog_articles_posted: 'No hay entradas publicadas en %{date}.' - activerecord: - models: - blog_category: Categoría - blog_comment: Comentario - blog_post: Publicación - attributes: - blog_category: - title: Título - blog_comment: - name: Nombre - email: Email - message: Mensaje - blog_post: - title: Título - body: Cuerpo - teaser: Teaser
\ No newline at end of file + by: 'Enviado por %{who}' + time_ago: 'Hace %{time}' + thank_you: Gracias por tu comentario. + thank_you_moderated: 'Gracias por tu comentario. Ha sido enviado a la cola de moderación y, si lo aprobamos, aparecerá dentro de poco.' + index: + no_blog_articles_yet: 'Todavía no hay artículos. ¡Pero vuelve pronto!' + show: + blog_home: 'Página principal del Blog' + comments: + title: Comentarios + add: 'Envía tu comentario' + other: Otros posts + filed_in: Archivado en + submit: Enviar comentario + archive: + blog_archive_for: 'Archivo del blog en %{date}' + no_blog_articles_posted: 'No hay entradas publicadas en %{date}.' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 272be07..33027da 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1,154 +1,155 @@ fr: - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - categories: - category: - edit: Modifier cette catégorie - delete: Supprimer cett catégorie - index: - no_items_yet: 'Il n''y a aucune catégorie pour le moment. Cliquez sur "%{create}" pour ajouter votre première catégorie.' - comments: - approved: 'Le commentaire de "%{author}" a été approuvé.' - comment: - view_live_html: 'Voir ce commentaire <br/><em>(Ouvre une nouvelle fenêtre)</em>' - read: Lire ce commentaire - reject: Rejeter ce commentaire - approve: Approuver ce commentaire - rejected: 'Le commentaire de "%{author}" a été rejeté.' - index: - no_items_yet: 'Il n''y aucun %{type} de commentaires.' - show: - comment: Commenter - blog_post: Article - from: Écrit par - date: Écrit le - message: Commentaire - details: Détails - age: Âge - actions: Actions - back: Retour à la liste des commentaires - reject: Rejeter ce commentaire - approve: Approuver ce commentaire - posts: - form: - advanced_options: Options avancées - toggle_advanced_options: Cliquez ici pour accéder aux paramêtres des meta-tags et au menu des options - save_as_draft: Enregistrer comme Brouillon - published_at: Date de publication - index: - no_items_yet: 'Il n''y a aucun article pour l''instant. Cliquez sur "%{create}" pour ajouter votre premier article.' - uncategorized: - no_items_yet: 'Il n''y a aucun article non catégorisé.' - post: - view_live_html: 'Voir cet article sur le site<br/><em>(Ouvre une nouvelle fenêtre)</em>' - edit: Modifier cet article - delete: Supprimer cet article - settings: - notification_recipients: - value: Envoyer les notifications à - explanation: 'Chaque fois que quelqu''un écrit un commentaire sur un article, Refinery envoie un e-mail pour prévenir qu''il y a un nouveau commentaire.' - hint: 'Quand un nouveau commentaire est ajouté, Refinery vous enverra un e-mail de notifications.' - example: "Entrez une/des adresse(s) e-mail comme : jack@work.com, jill@office.com" - updated: 'Les destinataires des notifications sont définis : "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Catégories - manage: Gérer - new: Créer une nouvelle catégorie + category: + edit: Modifier cette catégorie + delete: Supprimer cett catégorie + index: + no_items_yet: 'Il n''y a aucune catégorie pour le moment. Cliquez sur "%{create}" pour ajouter votre première catégorie.' comments: - title: Commentaires - title_with_count: 'Commentaires (%{new_count} nouveau(x))' - new: Nouveau - unmoderated: Nouveau - approved: Approuvé - rejected: Rejeté + approved: 'Le commentaire de "%{author}" a été approuvé.' + comment: + view_live_html: 'Voir ce commentaire <br/><em>(Ouvre une nouvelle fenêtre)</em>' + read: Lire ce commentaire + reject: Rejeter ce commentaire + approve: Approuver ce commentaire + rejected: 'Le commentaire de "%{author}" a été rejeté.' + index: + no_items_yet: 'Il n''y aucun %{type} de commentaires.' + show: + comment: Commenter + blog_post: Article + from: Écrit par + date: Écrit le + message: Commentaire + details: Détails + age: Âge + actions: Actions + back: Retour à la liste des commentaires + reject: Rejeter ce commentaire + approve: Approuver ce commentaire posts: - title: Articles - manage: Gérer les articles - new: Créer un nouvel article - uncategorized: Aricles non catégorisés + form: + advanced_options: Options avancées + toggle_advanced_options: Cliquez ici pour accéder aux paramêtres des meta-tags et au menu des options + save_as_draft: Enregistrer comme Brouillon + published_at: Date de publication + index: + no_items_yet: 'Il n''y a aucun article pour l''instant. Cliquez sur "%{create}" pour ajouter votre premier article.' + uncategorized: + no_items_yet: 'Il n''y a aucun article non catégorisé.' + post: + view_live_html: 'Voir cet article sur le site<br/><em>(Ouvre une nouvelle fenêtre)</em>' + edit: Modifier cet article + delete: Supprimer cet article settings: - title: Paramêtres - moderation: Modération - update_notified: Mettre à jour les personnes à notifier - comments: Commentaires - blog: - comment_mailer: - notification: - greeting: Bonjour - you_recieved_new_comment: Il y a un nouveau commentaire sur le blog. - comment_starts: --- comment starts --- - comment_ends: --- comment ends --- - from: De - email: Email - message: Message - closing_line: Cordialement - ps: P.S. Tous les commentaires sont stockés dans la section "Blog" de Refinery dans le menu "Commentaires" si vous voulez les revoir plus tard. - shared: + notification_recipients: + value: Envoyer les notifications à + explanation: 'Chaque fois que quelqu''un écrit un commentaire sur un article, Refinery envoie un e-mail pour prévenir qu''il y a un nouveau commentaire.' + hint: 'Quand un nouveau commentaire est ajouté, Refinery vous enverra un e-mail de notifications.' + example: "Entrez une/des adresse(s) e-mail comme : jack@work.com, jill@office.com" + updated: 'Les destinataires des notifications sont définis : "%{recipients}"' + submenu: + categories: + title: Catégories + manage: Gérer + new: Créer une nouvelle catégorie + comments: + title: Commentaires + title_with_count: 'Commentaires (%{new_count} nouveau(x))' + new: Nouveau + unmoderated: Nouveau + approved: Approuvé + rejected: Rejeté + posts: + title: Articles + manage: Gérer les articles + new: Créer un nouvel article + uncategorized: Aricles non catégorisés + settings: + title: Paramêtres + moderation: Modération + update_notified: Mettre à jour les personnes à notifier + comments: Commentaires + blog: + comment_mailer: + notification: + greeting: Bonjour + you_recieved_new_comment: Il y a un nouveau commentaire sur le blog. + comment_starts: --- comment starts --- + comment_ends: --- comment ends --- + from: De + email: Email + message: Message + closing_line: Cordialement + ps: P.S. Tous les commentaires sont stockés dans la section "Blog" de Refinery dans le menu "Commentaires" si vous voulez les revoir plus tard. + shared: + categories: + title: Catégories + rss_feed: + title: Flux RSS + subscribe: Souscrire + posts: + other: Autres articles + created_at: 'Écrit le %{when}' + read_more: Lire la suite + by: 'par' + comments: + singular: commentaire + none: aucun commentaire + archives: Archives + tags: + title: "Mots clés" categories: - title: Catégories - rss_feed: - title: Flux RSS - subscribe: Souscrire + show: + no_posts: 'Il n''y a aucun article pour cette catégorie.' posts: - other: Autres articles - created_at: 'Écrit le %{when}' - read_more: Lire la suite - by: 'par' - comments: - singular: commentaire - none: aucun commentaire - archives: Archives - tags: - title: "Mots clés" - categories: - show: - no_posts: 'Il n''y a aucun article pour cette catégorie.' - posts: - post: - filed_in: Classé dans - comment: commentaire - comments: - by: 'Écrit par %{who}' - time_ago: 'il y a %{time} ' - thank_you: 'Merci pour votre commentaire.' - thank_you_moderated: 'Merci pour votre commentaire. Votre message a été placé en attente de validation et apparaitra bientôt.' - index: - no_blog_articles_yet: "Il n'y a aucun article pour l'instant. Restez en alerte." - show: - blog_home: Accueil du blog + post: + filed_in: Classé dans + comment: commentaire comments: - title: Commentaires - add: Ajouter un commentaire - other: Autres articles - filed_in: Classé dans - tagged: Taggé - submit: Envoyer le commentaire - name: Nom - email: Email - message: Message - by: par - tagged: - no_blog_articles_yet: "Il n'y a aucun article pour l'instant. Restez en alerte." - posts_tagged: Articles taggés - archive: - blog_archive_for: 'Archive du blog pour le %{date}' - no_blog_articles_posted: "Il n'y a aucun article pour la date du %{date}. Restez en alerte." + by: 'Écrit par %{who}' + time_ago: 'il y a %{time} ' + thank_you: 'Merci pour votre commentaire.' + thank_you_moderated: 'Merci pour votre commentaire. Votre message a été placé en attente de validation et apparaitra bientôt.' + index: + no_blog_articles_yet: "Il n'y a aucun article pour l'instant. Restez en alerte." + show: + blog_home: Accueil du blog + comments: + title: Commentaires + add: Ajouter un commentaire + other: Autres articles + filed_in: Classé dans + tagged: Taggé + submit: Envoyer le commentaire + name: Nom + email: Email + message: Message + by: par + tagged: + no_blog_articles_yet: "Il n'y a aucun article pour l'instant. Restez en alerte." + posts_tagged: Articles taggés + archive: + blog_archive_for: 'Archive du blog pour le %{date}' + no_blog_articles_posted: "Il n'y a aucun article pour la date du %{date}. Restez en alerte." activerecord: models: - blog_category: Categorie - blog_comment: Commentaire - blog_post: Article + refinery/blog_category: Categorie + refinery/blog_comment: Commentaire + refinery/blog_post: Article attributes: - blog_category: + refinery/blog_category: title: Titre - blog_comment: + refinery/blog_comment: name: Nom email: Email message: Message - blog_post: + refinery/blog_post: title: Titre body: Corps diff --git a/config/locales/it.yml b/config/locales/it.yml index fa505a0..58cc41c 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1,156 +1,157 @@ it: - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - categories: - category: - edit: Modifica questa categoria - delete: Elimina questa categoria per sempre - index: - no_items_yet: 'Nessuna categoria ancora presente. Fare click su "%{create}" per aggiungere la tua prima categoria.' - comments: - approved: 'Il commento di "%{author}" è stato approvato.' - comment: - view_live_html: 'Visualizza questo commento <em> <br/> live (si apre in una nuova finestra) </em>' - read: Leggi questo commento - reject: Rifiuta questo commento - approve: Approva questo commento - rejected: 'Il commento di "%{author}" è stato rifiutato.' - index: - no_items_yet: 'Non ci sono %{type} commenti.' - show: - comment: Commento - blog_post: Articolo - from: Pubblicato da - date: Pubblicato il - message: Commento - details: Dettagli - age: età - actions: Azioni - back: Torna a tutti i commenti - reject: Rifiuta questo commento - approve: Approva questo commento - posts: - form: - advanced_options: Opzioni Avanzate - toggle_advanced_options: Clicca per accedere alle impostationi dei meta tag e del menu - save_as_draft: Salva come Bozza - published_at: Data di Pubblicazione - custom_url: Url personalizzato - custom_url_help: Puoi scegliere un url specifico per questo articolo. Lasciando questo campo vuoto verrà utilizzato il titolo. - copy_body: Copia il testo dell'articolo nel teaser - copy_body_help: Lascia il teaser bianco per creare il teaser automaticamente. - index: - no_items_yet: 'Non ci sono ancora articoli in questo Blog. Clicca su "%{create}" per aggiungerne uno.' - uncategorized: - no_items_yet: 'Non ci sono articoli senza categoria.' - post: - view_live_html: 'Visualizza questo articolo sul sito <br/><em>(si aprirà in una nuova finestra)</em>' - edit: Modifica questo articolo - delete: Rimuovi questo articolo per sempre - settings: - notification_recipients: - value: Inviare notifiche a - explanation: "Ogni volta che qualcuno commenta un articolo, Refinery invia una mail per avvisare che c'è un nuovo comemnto" - hint: 'Quando viene aggiunto un nuovo commento Refinery ti invierà una email di notifica.' - example: "Inserisci il tuo indirizzo email. È possibile insierire più indirizzi separati dalla virgola. Es: jack@work.com, jill@office.com" - updated: 'I destinatari delle notifiche sono stati impostati "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Categorie - manage: Gestione categorie - new: Crea una nuova categoria + category: + edit: Modifica questa categoria + delete: Elimina questa categoria per sempre + index: + no_items_yet: 'Nessuna categoria ancora presente. Fare click su "%{create}" per aggiungere la tua prima categoria.' comments: - title: Commenti - title_with_count: 'Commenti (%{new_count} nuovi)' - new: Nuovo - unmoderated: Nuovo - approved: Approvato - rejected: Rifiutato + approved: 'Il commento di "%{author}" è stato approvato.' + comment: + view_live_html: 'Visualizza questo commento <em> <br/> live (si apre in una nuova finestra) </em>' + read: Leggi questo commento + reject: Rifiuta questo commento + approve: Approva questo commento + rejected: 'Il commento di "%{author}" è stato rifiutato.' + index: + no_items_yet: 'Non ci sono %{type} commenti.' + show: + comment: Commento + blog_post: Articolo + from: Pubblicato da + date: Pubblicato il + message: Commento + details: Dettagli + age: età + actions: Azioni + back: Torna a tutti i commenti + reject: Rifiuta questo commento + approve: Approva questo commento posts: - title: Articoli - manage: Gestione articoli - new: Crea un nuovo articolo - uncategorized: Articoli senza categoria + form: + advanced_options: Opzioni Avanzate + toggle_advanced_options: Clicca per accedere alle impostationi dei meta tag e del menu + save_as_draft: Salva come Bozza + published_at: Data di Pubblicazione + custom_url: Url personalizzato + custom_url_help: Puoi scegliere un url specifico per questo articolo. Lasciando questo campo vuoto verrà utilizzato il titolo. + copy_body: Copia il testo dell'articolo nel teaser + copy_body_help: Lascia il teaser bianco per creare il teaser automaticamente. + index: + no_items_yet: 'Non ci sono ancora articoli in questo Blog. Clicca su "%{create}" per aggiungerne uno.' + uncategorized: + no_items_yet: 'Non ci sono articoli senza categoria.' + post: + view_live_html: 'Visualizza questo articolo sul sito <br/><em>(si aprirà in una nuova finestra)</em>' + edit: Modifica questo articolo + delete: Rimuovi questo articolo per sempre settings: - title: Impostazioni - moderation: Moderazione - update_notified: Aggiornare i destinatari delle notifiche - comments: Commenti - blog: - comment_mailer: - notification: - greeting: Ciao - you_recieved_new_comment: Hai ricevuto un commento sul tuo sito. - comment_starts: --- inizio commento --- - comment_ends: --- fine commento --- - from: Da - email: Email - message: Testo - closing_line: Saluti - ps: 'P.S. Tutti i commenti sono memorizzati nella sezione "Blog di Refinery sotto la voce "Commenti" se mai volessi visualizzarli lì.' - shared: + notification_recipients: + value: Inviare notifiche a + explanation: "Ogni volta che qualcuno commenta un articolo, Refinery invia una mail per avvisare che c'è un nuovo comemnto" + hint: 'Quando viene aggiunto un nuovo commento Refinery ti invierà una email di notifica.' + example: "Inserisci il tuo indirizzo email. È possibile insierire più indirizzi separati dalla virgola. Es: jack@work.com, jill@office.com" + updated: 'I destinatari delle notifiche sono stati impostati "%{recipients}"' + submenu: + categories: + title: Categorie + manage: Gestione categorie + new: Crea una nuova categoria + comments: + title: Commenti + title_with_count: 'Commenti (%{new_count} nuovi)' + new: Nuovo + unmoderated: Nuovo + approved: Approvato + rejected: Rifiutato + posts: + title: Articoli + manage: Gestione articoli + new: Crea un nuovo articolo + uncategorized: Articoli senza categoria + settings: + title: Impostazioni + moderation: Moderazione + update_notified: Aggiornare i destinatari delle notifiche + comments: Commenti + blog: + comment_mailer: + notification: + greeting: Ciao + you_recieved_new_comment: Hai ricevuto un commento sul tuo sito. + comment_starts: --- inizio commento --- + comment_ends: --- fine commento --- + from: Da + email: Email + message: Testo + closing_line: Saluti + ps: 'P.S. Tutti i commenti sono memorizzati nella sezione "Blog di Refinery sotto la voce "Commenti" se mai volessi visualizzarli lì.' + shared: + categories: + title: Categorie + rss_feed: + title: RSS Feed + subscribe: Iscriviti + posts: + other: Altri Articoli + created_at: 'Pubblicato il %{when}' + read_more: Continua a leggere + comments: + singular: commento + plural: commenti + none: nessun commento + tags: + title: "Tags" categories: - title: Categorie - rss_feed: - title: RSS Feed - subscribe: Iscriviti + show: + no_posts: Non sono ancora presenti articoli. posts: - other: Altri Articoli - created_at: 'Pubblicato il %{when}' - read_more: Continua a leggere - comments: - singular: commento - plural: commenti - none: nessun commento - tags: - title: "Tags" - categories: - show: - no_posts: Non sono ancora presenti articoli. - posts: - post: - filed_in: Archiviato in - comment: commento - comments: - by: 'Pubblicato da %{who}' - time_ago: '%{time} fa' - thank_you: 'Grazie per aver scritto un commento.' - thank_you_moderated: 'Grazie per aver scritto un commento. Il tuo messaggio è stato inserito nella coda di moderazione e sarà visibile a breve.' - index: - no_blog_articles_yet: Non sono stati ancora pubblicati articoli nel blog. Continuate a seguirci. - show: + post: + filed_in: Archiviato in + comment: commento comments: - title: Commenti - add: Scrivi un Commento - other: Altri Articoli - filed_in: Archiviato in - submit: Invia commento - tagged: Taggato - name: Nome - email: Email - message: Articolo - by: da - tagged: - no_blog_articles_yet: Non sono stati ancora pubblicati articoli nel blog. Continuate a seguirci. - posts_tagged: Articoli taggati - archive: - blog_archive_for: 'Articoli pubblicati il %{date}' - no_blog_articles_posted: Non sono stati pubblicati articoli nel blog il %{date}. Continuate a seguirci. + by: 'Pubblicato da %{who}' + time_ago: '%{time} fa' + thank_you: 'Grazie per aver scritto un commento.' + thank_you_moderated: 'Grazie per aver scritto un commento. Il tuo messaggio è stato inserito nella coda di moderazione e sarà visibile a breve.' + index: + no_blog_articles_yet: Non sono stati ancora pubblicati articoli nel blog. Continuate a seguirci. + show: + comments: + title: Commenti + add: Scrivi un Commento + other: Altri Articoli + filed_in: Archiviato in + submit: Invia commento + tagged: Taggato + name: Nome + email: Email + message: Articolo + by: da + tagged: + no_blog_articles_yet: Non sono stati ancora pubblicati articoli nel blog. Continuate a seguirci. + posts_tagged: Articoli taggati + archive: + blog_archive_for: 'Articoli pubblicati il %{date}' + no_blog_articles_posted: Non sono stati pubblicati articoli nel blog il %{date}. Continuate a seguirci. activerecord: models: - blog_category: Categoria - blog_comment: Commento - blog_post: Articolo + refinery/blog_category: Categoria + refinery/blog_comment: Commento + refinery/blog_post: Articolo attributes: - blog_category: + refinery/blog_category: title: Titolo - blog_comment: + refinery/blog_comment: name: Nome email: Email message: Testo - blog_post: + refinery/blog_post: title: Titolo - body: Testo
\ No newline at end of file + body: Testo diff --git a/config/locales/nb.yml b/config/locales/nb.yml index c71bd25..891ea13 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -1,30 +1,31 @@ nb: - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - posts: - form: - seo_override_title: Nettleser tittel - seo_override_title_help: Skriv inn en tittel på 5-10 ord som oppsummerer innholdet på siden. - meta_keywords_title: Meta stikkord - meta_keywords_help: Skriv inn 5-10 stikkord som relaterer til denne siden. Separer stikkordene med komma. - meta_description_title: Meta beskrivelse - meta_description_help: Skriv en kort beskrivelse på to eller tre setninger som forteller hva denne siden inneholder. - index: - no_items_yet: 'Det er ingen Blog Posts enda. Klikk på "Lag en ny Blog Posts" for å legge til din første blog posts.' - post: - view_live: 'Vis hvordan denne blog post ser ut offentlig <br/><em>(åpner i et nytt vindu)</em>' - edit: Rediger denne blog post - delete: Fjern denne blog post permanent - submenu: - comments: - new: ny + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: posts: - new: Lag en ny post - settings: - update_notified: Oppdater hvem som blir informert - blog_posts: - show: - other: Andre Blog Posts
\ No newline at end of file + form: + seo_override_title: Nettleser tittel + seo_override_title_help: Skriv inn en tittel på 5-10 ord som oppsummerer innholdet på siden. + meta_keywords_title: Meta stikkord + meta_keywords_help: Skriv inn 5-10 stikkord som relaterer til denne siden. Separer stikkordene med komma. + meta_description_title: Meta beskrivelse + meta_description_help: Skriv en kort beskrivelse på to eller tre setninger som forteller hva denne siden inneholder. + index: + no_items_yet: 'Det er ingen Blog Posts enda. Klikk på "Lag en ny Blog Posts" for å legge til din første blog posts.' + post: + view_live: 'Vis hvordan denne blog post ser ut offentlig <br/><em>(åpner i et nytt vindu)</em>' + edit: Rediger denne blog post + delete: Fjern denne blog post permanent + submenu: + comments: + new: ny + posts: + new: Lag en ny post + settings: + update_notified: Oppdater hvem som blir informert + blog_posts: + show: + other: Andre Blog Posts diff --git a/config/locales/nl.yml b/config/locales/nl.yml index a7f5583..ec3edd9 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1,134 +1,135 @@ nl: - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - categories: - category: - edit: Bewerk deze categorie - delete: Verwijder deze categorie definitief - index: - no_items_yet: 'Er zijn momenteel geen categorien. Klik op "%{create}" om uw eerste categorie toe te voegen.' - comments: - approved: 'De reactie van "%{author}" is goedgekeurd.' - comment: - view_live_html: 'Bekijk deze reactie op de website <br/><em>(opent in een nieuw venster)</em>' - read: Lees deze reactie - reject: Keur deze reactie af - approve: Keur deze reactie goed - rejected: 'De reactie van "%{author}" is afgekeurd.' - index: - no_items_yet: 'Er zijn geen %{type} reacties.' - show: - comment: Reactie - blog_post: Blogpost - from: Gepost door - date: Gepost op - message: Reactie - details: Details - age: Leeftijd - actions: Acties - back: Terug naar alle reacties - reject: Keur deze reactie af - approve: Keur deze reactie goed - posts: - form: - advanced_options: Geavanceerde eigenschappen - toggle_advanced_options: Klik voor toegang tot meta tag instellingen en menu opties - save_as_draft: Sla op als concept - published_at: Publicatiedatum - index: - no_items_yet: 'Er zijn momenteel geen blogposts. Klik op "%{create}" om uw eerste blogpost toe te voegen.' - uncategorized: - no_items_yet: 'Er zijn geen ongecategoriseerde blogposts.' - post: - view_live_html: 'Bekijk deze blogpost op de website <br/><em>(opent in een nieuw venster)</em>' - edit: Bewerk deze blogpost - delete: Verwijder deze blogpost definitief - settings: - notification_recipients: - value: Stuur notificaties naar - explanation: 'Bij elke nieuwe reactie op een blogpost stuurt Refinery u een e-mail om dit te melden.' - hint: 'Als er een reactie is toegevoegd stuurt Refinery een e-mail notificatie naar u.' - example: "Voer uw e-mailadres(sen) in, bijvoorbeeld: jack@work.com, jill@office.com" - updated: 'De ontvanger(s) van notificaties is/zijn gewijzigd naar "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Categorien - manage: Beheren - new: Voeg een nieuwe categorie toe + category: + edit: Bewerk deze categorie + delete: Verwijder deze categorie definitief + index: + no_items_yet: 'Er zijn momenteel geen categorien. Klik op "%{create}" om uw eerste categorie toe te voegen.' comments: - title: Reacties - title_with_count: 'Reacties (%{new_count} nieuwe)' - new: Nieuw - unmoderated: Nieuw - approved: Goedgekeurd - rejected: Afgekeurd + approved: 'De reactie van "%{author}" is goedgekeurd.' + comment: + view_live_html: 'Bekijk deze reactie op de website <br/><em>(opent in een nieuw venster)</em>' + read: Lees deze reactie + reject: Keur deze reactie af + approve: Keur deze reactie goed + rejected: 'De reactie van "%{author}" is afgekeurd.' + index: + no_items_yet: 'Er zijn geen %{type} reacties.' + show: + comment: Reactie + blog_post: Blogpost + from: Gepost door + date: Gepost op + message: Reactie + details: Details + age: Leeftijd + actions: Acties + back: Terug naar alle reacties + reject: Keur deze reactie af + approve: Keur deze reactie goed posts: - title: Posts - manage: Beheer posts - new: Voeg een nieuwe post toe - uncategorized: Ongecategoriseerde posts + form: + advanced_options: Geavanceerde eigenschappen + toggle_advanced_options: Klik voor toegang tot meta tag instellingen en menu opties + save_as_draft: Sla op als concept + published_at: Publicatiedatum + index: + no_items_yet: 'Er zijn momenteel geen blogposts. Klik op "%{create}" om uw eerste blogpost toe te voegen.' + uncategorized: + no_items_yet: 'Er zijn geen ongecategoriseerde blogposts.' + post: + view_live_html: 'Bekijk deze blogpost op de website <br/><em>(opent in een nieuw venster)</em>' + edit: Bewerk deze blogpost + delete: Verwijder deze blogpost definitief settings: - title: Instellingen - moderation: Stuur notificaties - update_notified: Wijzig wie notificaties ontvangt - comments: Reacties - teasers: Teasers - blog: - comment_mailer: - notification: - greeting: Hallo - you_recieved_new_comment: Er is zojuist een reactie geplaatst op uw website. - comment_starts: --- begin reactie --- - comment_ends: --- einde reactie --- - from: Van - email: E-mail - message: Bericht - closing_line: Met vriendelijke groet - ps: 'P.S. Alle reacties worden opgeslagen in de "Blog" sectie van Refinery onder het submenu "Comments", voor als u deze reacties later wilt bekijken.' - shared: + notification_recipients: + value: Stuur notificaties naar + explanation: 'Bij elke nieuwe reactie op een blogpost stuurt Refinery u een e-mail om dit te melden.' + hint: 'Als er een reactie is toegevoegd stuurt Refinery een e-mail notificatie naar u.' + example: "Voer uw e-mailadres(sen) in, bijvoorbeeld: jack@work.com, jill@office.com" + updated: 'De ontvanger(s) van notificaties is/zijn gewijzigd naar "%{recipients}"' + submenu: + categories: + title: Categorien + manage: Beheren + new: Voeg een nieuwe categorie toe + comments: + title: Reacties + title_with_count: 'Reacties (%{new_count} nieuwe)' + new: Nieuw + unmoderated: Nieuw + approved: Goedgekeurd + rejected: Afgekeurd + posts: + title: Posts + manage: Beheer posts + new: Voeg een nieuwe post toe + uncategorized: Ongecategoriseerde posts + settings: + title: Instellingen + moderation: Stuur notificaties + update_notified: Wijzig wie notificaties ontvangt + comments: Reacties + teasers: Teasers + blog: + comment_mailer: + notification: + greeting: Hallo + you_recieved_new_comment: Er is zojuist een reactie geplaatst op uw website. + comment_starts: --- begin reactie --- + comment_ends: --- einde reactie --- + from: Van + email: E-mail + message: Bericht + closing_line: Met vriendelijke groet + ps: 'P.S. Alle reacties worden opgeslagen in de "Blog" sectie van Refinery onder het submenu "Comments", voor als u deze reacties later wilt bekijken.' + shared: + categories: + title: Categorien + rss_feed: + title: RSS Feed + subscribe: Aanmelden + posts: + other: Andere posts + created_at: 'Gepost op %{when}' + read_more: Lees verder + comments: + singular: Reactie + none: Geen reacties + archives: Archief + tags: + title: "Tags" categories: - title: Categorien - rss_feed: - title: RSS Feed - subscribe: Aanmelden + show: + no_posts: Er zijn momenteel geen posts. posts: - other: Andere posts - created_at: 'Gepost op %{when}' - read_more: Lees verder - comments: - singular: Reactie - none: Geen reacties - archives: Archief - tags: - title: "Tags" - categories: - show: - no_posts: Er zijn momenteel geen posts. - posts: - post: - filed_in: Toegevoegd aan - comment: Reactie - comments: - by: 'Gepost door %{who}' - time_ago: '%{time} geleden' - thank_you: 'Bedankt voor uw reactie.' - thank_you_moderated: 'Bedankt voor uw reactie. Uw reactie is in de wachtrij geplaatst en zal binnenkort verschijnen.' - index: - no_blog_articles_yet: Er zijn momenteel nog geen blogposts. Neem regelmatig een kijkje. - show: - blog_home: Blog Home + post: + filed_in: Toegevoegd aan + comment: Reactie comments: - title: Reacties - add: Plaats een reactie - other: Andere blogposts - filed_in: Toegevoegd aan - tagged: Tagged - submit: Verstuur reactie - tagged: - no_blog_articles_yet: Er zijn momenteel nog geen blogposts. Neem regelmatig een kijkje. - archive: - blog_archive_for: 'Blog archief voor %{date}' - no_blog_articles_posted: 'Er zijn geen blogposts voor %{date}. Neem regelmatig een kijkje.' + by: 'Gepost door %{who}' + time_ago: '%{time} geleden' + thank_you: 'Bedankt voor uw reactie.' + thank_you_moderated: 'Bedankt voor uw reactie. Uw reactie is in de wachtrij geplaatst en zal binnenkort verschijnen.' + index: + no_blog_articles_yet: Er zijn momenteel nog geen blogposts. Neem regelmatig een kijkje. + show: + blog_home: Blog Home + comments: + title: Reacties + add: Plaats een reactie + other: Andere blogposts + filed_in: Toegevoegd aan + tagged: Tagged + submit: Verstuur reactie + tagged: + no_blog_articles_yet: Er zijn momenteel nog geen blogposts. Neem regelmatig een kijkje. + archive: + blog_archive_for: 'Blog archief voor %{date}' + no_blog_articles_posted: 'Er zijn geen blogposts voor %{date}. Neem regelmatig een kijkje.' diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 5a9fe9d..6423d22 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1,134 +1,135 @@ pl: - activerecord: - attributes: - blog_comment: - name: "Imię" - email: "Email" - message: "Treść" - plugins: - refinerycms_blog: - title: Blog - admin: - blog: - categories: - category: - edit: Edytuj tą kategorię - delete: Usuń na zawsze - index: - no_items_yet: 'W tej chwili nie ma żadnych kategorii. Kliknij "%{create}" aby dodać pierwszą.' - comments: - approved: 'Komentarz "%{author}" został zaakceptowany.' - comment: - view_live: 'Zobacz ten komentarz na żywo<br/><em>(otwiera w nowym oknie)</em>' - read: Pokaż ten komentarz - reject: Odrzuć ten komentarz - approve: Zaakceptuj ten komentarz - rejected: 'Komentarz "%{author}" został odrzucony.' - index: - no_items_yet: 'Nie ma więcej komentarzy typu "%{type}".' - show: - comment: Komentarz - blog_post: Post - from: Autor - date: Data - message: Komentarz - details: Szczegóły - age: Wiek - actions: Akcje - back: Powrót do listy komentarzy - reject: Odrzuć ten komentarz - approve: Zaakceptuj ten komentarz - posts: - form: - advanced_options: Opcje zaawansowane - toggle_advanced_options: 'Kliknij, aby zarządzać meta-ustawieniami' - save_as_draft: Zapisz jako szkic - published_at: Data publikacji - index: - no_items_yet: 'Na blogu nie ma jeszcze żadnych wpisów. Kliknij "%{create}" aby dodać pierwszy post.' - uncategorized: - no_items_yet: 'Brak nieskategoryzowanych wpisów na blogu.' - post: - view_live: 'Zobacz ten post na żywo<br/><em>(otwiera w nowym oknie)</em>' - edit: Edytuj ten post - delete: Usuń ten post na zawsze - settings: - notification_recipients: - value: Powiadomienia wysyłane do - explanation: 'Gdy zostanie dodany nowy komentarz, system wyśle powiadomienie przez e-mail.' - hint: 'Gdy zostanie dodany nowy komentarz, system wyśle powiadomienie przez e-mail.' - example: 'Podaj adresy e-mail oddzielone przecinkiem, np: jack@work.com, jill@office.com' - updated: 'Powiadomienia będą wysyłane do "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Kategorie - manage: Zarządzaj kategoriami - new: Dodaj nową kategorię + category: + edit: Edytuj tą kategorię + delete: Usuń na zawsze + index: + no_items_yet: 'W tej chwili nie ma żadnych kategorii. Kliknij "%{create}" aby dodać pierwszą.' comments: - title: Komentarze - title_with_count: 'Komentarze (%{new_count} nowych)' - new: Nowe - unmoderated: Nowe - approved: Zaakceptowane - rejected: Odrzucone + approved: 'Komentarz "%{author}" został zaakceptowany.' + comment: + view_live: 'Zobacz ten komentarz na żywo<br/><em>(otwiera w nowym oknie)</em>' + read: Pokaż ten komentarz + reject: Odrzuć ten komentarz + approve: Zaakceptuj ten komentarz + rejected: 'Komentarz "%{author}" został odrzucony.' + index: + no_items_yet: 'Nie ma więcej komentarzy typu "%{type}".' + show: + comment: Komentarz + blog_post: Post + from: Autor + date: Data + message: Komentarz + details: Szczegóły + age: Wiek + actions: Akcje + back: Powrót do listy komentarzy + reject: Odrzuć ten komentarz + approve: Zaakceptuj ten komentarz posts: - title: Posty - manage: Zarządzaj postami - new: Dodaj nowy post - uncategorized: Posty bez kategorii + form: + advanced_options: Opcje zaawansowane + toggle_advanced_options: 'Kliknij, aby zarządzać meta-ustawieniami' + save_as_draft: Zapisz jako szkic + published_at: Data publikacji + index: + no_items_yet: 'Na blogu nie ma jeszcze żadnych wpisów. Kliknij "%{create}" aby dodać pierwszy post.' + uncategorized: + no_items_yet: 'Brak nieskategoryzowanych wpisów na blogu.' + post: + view_live: 'Zobacz ten post na żywo<br/><em>(otwiera w nowym oknie)</em>' + edit: Edytuj ten post + delete: Usuń ten post na zawsze settings: - title: Ustawienia - moderation: Wł./wył. moderację - update_notified: Powiadamianie przez e-mail - comments: Komentarze - blog: - comment_mailer: - notification: - greeting: Witaj:) - you_recieved_new_comment: Właśnie otrzymałeś nowy komentarz na swojej stronie! - comment_starts: --- początek komentarza --- - comment_ends: --- koniec komentarza --- - from: Od - email: Email - message: Treść - closing_line: Pozdrawiamy - ps: 'P.S. Wszystkie komentarze przechowywane są w panelu zarządzania, w sekcji "Blog" i podmenu "Komentarze". ' - shared: + notification_recipients: + value: Powiadomienia wysyłane do + explanation: 'Gdy zostanie dodany nowy komentarz, system wyśle powiadomienie przez e-mail.' + hint: 'Gdy zostanie dodany nowy komentarz, system wyśle powiadomienie przez e-mail.' + example: 'Podaj adresy e-mail oddzielone przecinkiem, np: jack@work.com, jill@office.com' + updated: 'Powiadomienia będą wysyłane do "%{recipients}"' + submenu: + categories: + title: Kategorie + manage: Zarządzaj kategoriami + new: Dodaj nową kategorię + comments: + title: Komentarze + title_with_count: 'Komentarze (%{new_count} nowych)' + new: Nowe + unmoderated: Nowe + approved: Zaakceptowane + rejected: Odrzucone + posts: + title: Posty + manage: Zarządzaj postami + new: Dodaj nowy post + uncategorized: Posty bez kategorii + settings: + title: Ustawienia + moderation: Wł./wył. moderację + update_notified: Powiadamianie przez e-mail + comments: Komentarze + blog: + comment_mailer: + notification: + greeting: Witaj:) + you_recieved_new_comment: Właśnie otrzymałeś nowy komentarz na swojej stronie! + comment_starts: --- początek komentarza --- + comment_ends: --- koniec komentarza --- + from: Od + email: Email + message: Treść + closing_line: Pozdrawiamy + ps: 'P.S. Wszystkie komentarze przechowywane są w panelu zarządzania, w sekcji "Blog" i podmenu "Komentarze". ' + shared: + categories: + title: Kategorie + rss_feed: + title: RSS Feed + subscribe: Sukskrybuj + posts: + other: Pozostałe posty + created_at: 'Data: %{when}' + read_more: Więcej + comments: + singular: komentarz + none: brak komentarzy + archives: Archiwum categories: - title: Kategorie - rss_feed: - title: RSS Feed - subscribe: Sukskrybuj + show: + no_posts: Nie ma jeszcze żadnych postów. posts: - other: Pozostałe posty - created_at: 'Data: %{when}' - read_more: Więcej - comments: - singular: komentarz - none: brak komentarzy - archives: Archiwum - categories: - show: - no_posts: Nie ma jeszcze żadnych postów. - posts: - post: - filed_in: 'kategorie:' - comment: komentarz - comments: - by: 'Autor: %{who}' - time_ago: '%{time} temu' - thank_you: 'Dziękujemy za Twój komentarz.' - thank_you_moderated: 'Dziękujemy za Twój komentarz. Został on przekazany do moderacji i niedługo pojawi się na stronie.' - index: - no_blog_articles_yet: W tej chwili nie ma jeszcze żadnych postów. Cierpliwości:) - show: - blog_home: Blog + post: + filed_in: 'kategorie:' + comment: komentarz comments: - title: Komentarze - add: Dodaj komentarz - other: Pozostałe wpisy - filed_in: 'kategorie:' - submit: Dodaj komentarz - archive: - blog_archive_for: 'Archiwum dla %{date}' - no_blog_articles_posted: 'Brak wpisów dla daty %{date}.' + by: 'Autor: %{who}' + time_ago: '%{time} temu' + thank_you: 'Dziękujemy za Twój komentarz.' + thank_you_moderated: 'Dziękujemy za Twój komentarz. Został on przekazany do moderacji i niedługo pojawi się na stronie.' + index: + no_blog_articles_yet: W tej chwili nie ma jeszcze żadnych postów. Cierpliwości:) + show: + blog_home: Blog + comments: + title: Komentarze + add: Dodaj komentarz + other: Pozostałe wpisy + filed_in: 'kategorie:' + submit: Dodaj komentarz + archive: + blog_archive_for: 'Archiwum dla %{date}' + no_blog_articles_posted: 'Brak wpisów dla daty %{date}.' + activerecord: + attributes: + refinery/blog_comment: + name: "Imię" + email: "Email" + message: "Treść" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 6f7fd2d..bf5f914 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1,138 +1,139 @@ pt-BR: - plugins: - refinerycms_blog: - title: Blog - activerecord: - attributes: - blog_post: - title: Título - body: Corpo - blog_comment: - name: Nome - message: Mensagem - admin: - blog: - categories: - category: - edit: Editar esta categoria - delete: Apagar esta categoria para sempre - index: - no_items_yet: 'Não há categorias ainda. Clique em "%{create}" para adicionar a primeira categoria.' - comments: - approved: 'O comentário de "%{author}" foi aprovado.' - comment: - view_live_html: 'Ver este comentário <br/><em>(será aberto em outra janela)</em>' - read: Ler este comentário - reject: Rejeitar este comentário - approve: Aprovar este comentário - rejected: 'O comentário de "%{author}" foi rejeitado.' - index: - no_items_yet: 'Não há %{type} comentários.' - show: - comment: Comentário - blog_post: Post - from: Postado por - date: Postado em - message: Comentário - details: Detalhes - age: Idade - actions: Ações - back: Voltar para todos os comentários - reject: Rejeitar este comentário - approve: Aprovar este comentário - posts: - form: - advanced_options: Opções avançadas - toggle_advanced_options: Clique aqui para acessar as configurações de meta tag e menu - save_as_draft: Salvar como rascunho - published_at: Data de publicação - index: - no_items_yet: 'Ainda não há Posts no Blog. Clique em "%{create}" para adicionar o primeiro post.' - uncategorized: - no_items_yet: 'Ainda não há posts sem categoria.' - post: - view_live_html: 'Ver este comentário <br/><em>(será aberto em outra janela)</em>' - edit: Editar este post - delete: Remover esse post para sempre - settings: - notification_recipients: - value: Enviar notificações para - explanation: 'Cada vez que alguém comenta em um post no blog, é enviado um e-mail para informar que há um novo comentário.' - hint: 'Quando um novo comentário é adicionado, será enviado uma notificação por e-mail para você.' - example: 'Entre com o(s) seu(s) endereço(s) de email, como: jack@work.com, jill@office.com' - updated: 'As notificações foram enviadas para "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: categories: - title: Categorias - manage: Gerenciar - new: Criar nova categoria + category: + edit: Editar esta categoria + delete: Apagar esta categoria para sempre + index: + no_items_yet: 'Não há categorias ainda. Clique em "%{create}" para adicionar a primeira categoria.' comments: - title: Comentários - title_with_count: 'Comentários (%{new_count} novos)' - new: Novo - unmoderated: Novo - approved: Aprovado - rejected: Rejeitado + approved: 'O comentário de "%{author}" foi aprovado.' + comment: + view_live_html: 'Ver este comentário <br/><em>(será aberto em outra janela)</em>' + read: Ler este comentário + reject: Rejeitar este comentário + approve: Aprovar este comentário + rejected: 'O comentário de "%{author}" foi rejeitado.' + index: + no_items_yet: 'Não há %{type} comentários.' + show: + comment: Comentário + blog_post: Post + from: Postado por + date: Postado em + message: Comentário + details: Detalhes + age: Idade + actions: Ações + back: Voltar para todos os comentários + reject: Rejeitar este comentário + approve: Aprovar este comentário posts: - title: Posts - manage: Gerenciar posts - new: Criar novo post - uncategorized: Posts sem categoria + form: + advanced_options: Opções avançadas + toggle_advanced_options: Clique aqui para acessar as configurações de meta tag e menu + save_as_draft: Salvar como rascunho + published_at: Data de publicação + index: + no_items_yet: 'Ainda não há Posts no Blog. Clique em "%{create}" para adicionar o primeiro post.' + uncategorized: + no_items_yet: 'Ainda não há posts sem categoria.' + post: + view_live_html: 'Ver este comentário <br/><em>(será aberto em outra janela)</em>' + edit: Editar este post + delete: Remover esse post para sempre settings: - title: Configurações - moderation: Moderação - update_notified: Quem receberá a notificação? - comments: Comentários - blog: - comment_mailer: - notification: - greeting: Olá - you_recieved_new_comment: Você acaba de receber um novo comentário em seu site. - comment_starts: --- Início do comentário --- - comment_ends: --- Fim do comentário --- - from: De - email: Email - message: Mensagem - closing_line: Atenciosamente - ps: 'P.S. Lembre-se que você pode ver todos os comentários em "Comentários" dentro da seção "Blog".' - shared: + notification_recipients: + value: Enviar notificações para + explanation: 'Cada vez que alguém comenta em um post no blog, é enviado um e-mail para informar que há um novo comentário.' + hint: 'Quando um novo comentário é adicionado, será enviado uma notificação por e-mail para você.' + example: 'Entre com o(s) seu(s) endereço(s) de email, como: jack@work.com, jill@office.com' + updated: 'As notificações foram enviadas para "%{recipients}"' + submenu: + categories: + title: Categorias + manage: Gerenciar + new: Criar nova categoria + comments: + title: Comentários + title_with_count: 'Comentários (%{new_count} novos)' + new: Novo + unmoderated: Novo + approved: Aprovado + rejected: Rejeitado + posts: + title: Posts + manage: Gerenciar posts + new: Criar novo post + uncategorized: Posts sem categoria + settings: + title: Configurações + moderation: Moderação + update_notified: Quem receberá a notificação? + comments: Comentários + blog: + comment_mailer: + notification: + greeting: Olá + you_recieved_new_comment: Você acaba de receber um novo comentário em seu site. + comment_starts: --- Início do comentário --- + comment_ends: --- Fim do comentário --- + from: De + email: Email + message: Mensagem + closing_line: Atenciosamente + ps: 'P.S. Lembre-se que você pode ver todos os comentários em "Comentários" dentro da seção "Blog".' + shared: + categories: + title: Categorias + rss_feed: + title: Feed RSS + subscribe: Assinar + posts: + other: Últimos posts + created_at: 'Postado em %{when}' + read_more: Continue lendo... + comments: + singular: comentário + none: não há comentários + archives: Arquivos + tags: + title: Tags categories: - title: Categorias - rss_feed: - title: Feed RSS - subscribe: Assinar + show: + no_posts: Não há posts aqui ainda. posts: - other: Últimos posts - created_at: 'Postado em %{when}' - read_more: Continue lendo... - comments: - singular: comentário - none: não há comentários - archives: Arquivos - tags: - title: Tags - categories: - show: - no_posts: Não há posts aqui ainda. - posts: - comment: commentário - comments: - by: 'Postado por %{who}' - time_ago: '%{time} atrás' - thank_you: 'Obrigado por comentar.' - thank_you_moderated: 'Obrigado por comentar. Sua mensagem foi colocada na fila de moderação e será exibida em breve.' - index: - no_blog_articles_yet: Ainda não há artigos postados no blog. - show: - blog_home: Blog Home + comment: commentário comments: - title: Comentários - add: Fazer um comentário - other: Outros posts - filed_in: Arquivado em - submit: Enviar comentário - archive: - blog_archive_for: 'Arquivo do blog em %{date}' - no_blog_articles_posted: 'Não há arquivos do blog em %{date}.' - post: - filed_in: Arquivado em + by: 'Postado por %{who}' + time_ago: '%{time} atrás' + thank_you: 'Obrigado por comentar.' + thank_you_moderated: 'Obrigado por comentar. Sua mensagem foi colocada na fila de moderação e será exibida em breve.' + index: + no_blog_articles_yet: Ainda não há artigos postados no blog. + show: + blog_home: Blog Home + comments: + title: Comentários + add: Fazer um comentário + other: Outros posts + filed_in: Arquivado em + submit: Enviar comentário + archive: + blog_archive_for: 'Arquivo do blog em %{date}' + no_blog_articles_posted: 'Não há arquivos do blog em %{date}.' + post: + filed_in: Arquivado em + activerecord: + attributes: + refinery/blog_post: + title: Título + body: Corpo + refinery/blog_comment: + name: Nome + message: Mensagem diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 5ba2a89..acde9a9 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,128 +1,129 @@ ru: - plugins: - refinerycms_blog: - title: Блог - admin: - blog: - categories: - category: - edit: Редактировать эту категорию - delete: Удалить эту категорию навсегда - index: - no_items_yet: 'Категории пока не созданы. Нажмите "%{create}", чтобы добавить вашу первую категорию.' - comments: - approved: 'Комментарий от "%{author}" был опубликован.' - comment: - view_live_html: Посмотреть комментарий на сайте <br/><em>(откроется в новом окне)</em> - read: Прочитать комментарий - reject: Отклонить комментарий - approve: Принять комментарий - rejected: 'Комментарий от "%{author}" был отклонен.' - index: - no_items_yet: '%{type} комментарии: отсутствуют.' - show: - comment: Комментарий - blog_post: Запись в блоге - from: Опубликовал - date: Опубликовано - message: Комментарий - details: Детали - age: Возраст - actions: Действия - back: Вернуться к списку комментариев - reject: Отклонить этот комментарий - approve: Принять этот комментарий - posts: - form: - advanced_options: Дополнительные настройки - toggle_advanced_options: 'Нажмите, чтобы получить доступ к настройкам мета-тегов и меню' - save_as_draft: Сохранить как черновик - published_at: Дата публикации - index: - no_items_yet: 'Записи в блоге отстутствуют. Нажмите "%{create}", чтобы добавить первую запись.' - uncategorized: - no_items_yet: 'Записи без категорий отсутствуют.' - post: - view_live_html: Посмотреть запись на сайте <br/><em>(откроется в новом окне)</em> - edit: Редактировать запись - delete: Удалить запись - settings: - notification_recipients: - value: Отправлять уведомления - explanation: 'При появлении новых комментариев Refinery пришлет уведомление на email.' - hint: 'При появлении новых комментариев Refinery пришлет уведомление на email.' - example: "Введите адреса эл. почты, например: jack@work.com, jill@office.com" - updated: 'Получателем уведомлений является "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: Блог + admin: + blog: categories: - title: Категории - manage: Редактировать категории - new: Создать новую категорию + category: + edit: Редактировать эту категорию + delete: Удалить эту категорию навсегда + index: + no_items_yet: 'Категории пока не созданы. Нажмите "%{create}", чтобы добавить вашу первую категорию.' comments: - title: Комментарии - title_with_count: 'Комментарии (%{new_count} новых)' - new: Новые - unmoderated: Новые - approved: Принятые - rejected: Отклоненные + approved: 'Комментарий от "%{author}" был опубликован.' + comment: + view_live_html: Посмотреть комментарий на сайте <br/><em>(откроется в новом окне)</em> + read: Прочитать комментарий + reject: Отклонить комментарий + approve: Принять комментарий + rejected: 'Комментарий от "%{author}" был отклонен.' + index: + no_items_yet: '%{type} комментарии: отсутствуют.' + show: + comment: Комментарий + blog_post: Запись в блоге + from: Опубликовал + date: Опубликовано + message: Комментарий + details: Детали + age: Возраст + actions: Действия + back: Вернуться к списку комментариев + reject: Отклонить этот комментарий + approve: Принять этот комментарий posts: - title: Записи - manage: Редактировать записи - new: Создать новую запись - uncategorized: Записи без категорий + form: + advanced_options: Дополнительные настройки + toggle_advanced_options: 'Нажмите, чтобы получить доступ к настройкам мета-тегов и меню' + save_as_draft: Сохранить как черновик + published_at: Дата публикации + index: + no_items_yet: 'Записи в блоге отстутствуют. Нажмите "%{create}", чтобы добавить первую запись.' + uncategorized: + no_items_yet: 'Записи без категорий отсутствуют.' + post: + view_live_html: Посмотреть запись на сайте <br/><em>(откроется в новом окне)</em> + edit: Редактировать запись + delete: Удалить запись settings: - title: Настройки - moderation: Модерирование - update_notified: Настроить уведомления - comments: Комментарии - blog: - comment_mailer: - notification: - greeting: Здравствуйте - you_recieved_new_comment: Новый комментарий опубликован на вашем сайте. - comment_starts: --- начало комментария --- - comment_ends: --- конец комментария --- - from: От - email: Эл. почта - message: Сообщение - closing_line: С уважением - ps: P.S. Все комментарии находятся в разделе "Блог" Refinery CMS в подменю "Комментарии". - shared: + notification_recipients: + value: Отправлять уведомления + explanation: 'При появлении новых комментариев Refinery пришлет уведомление на email.' + hint: 'При появлении новых комментариев Refinery пришлет уведомление на email.' + example: "Введите адреса эл. почты, например: jack@work.com, jill@office.com" + updated: 'Получателем уведомлений является "%{recipients}"' + submenu: + categories: + title: Категории + manage: Редактировать категории + new: Создать новую категорию + comments: + title: Комментарии + title_with_count: 'Комментарии (%{new_count} новых)' + new: Новые + unmoderated: Новые + approved: Принятые + rejected: Отклоненные + posts: + title: Записи + manage: Редактировать записи + new: Создать новую запись + uncategorized: Записи без категорий + settings: + title: Настройки + moderation: Модерирование + update_notified: Настроить уведомления + comments: Комментарии + blog: + comment_mailer: + notification: + greeting: Здравствуйте + you_recieved_new_comment: Новый комментарий опубликован на вашем сайте. + comment_starts: --- начало комментария --- + comment_ends: --- конец комментария --- + from: От + email: Эл. почта + message: Сообщение + closing_line: С уважением + ps: P.S. Все комментарии находятся в разделе "Блог" Refinery CMS в подменю "Комментарии". + shared: + categories: + title: Категории + rss_feed: + title: RSS-лента + subscribe: Подписаться + posts: + other: Другие записи + created_at: 'Опубликовано %{when}' + read_more: Читать дальше + comments: + singular: комментарий + none: нет комментариев + archives: Архивы categories: - title: Категории - rss_feed: - title: RSS-лента - subscribe: Подписаться + show: + no_posts: Записей пока нет. posts: - other: Другие записи - created_at: 'Опубликовано %{when}' - read_more: Читать дальше - comments: - singular: комментарий - none: нет комментариев - archives: Архивы - categories: - show: - no_posts: Записей пока нет. - posts: - post: - filed_in: Категория - comment: комментарий - comments: - by: 'Опубликовал %{who}' - time_ago: '%{time} назад' - thank_you: 'Спасибо за комментарий.' - thank_you_moderated: 'Спасибо за комментарий. Ваше сообщение модерируется и скоро появится на сайте.' - index: - no_blog_articles_yet: Пока ни одной записи не опубликовано. Следите за новостями. - show: - blog_home: Вернуться к списку записей + post: + filed_in: Категория + comment: комментарий comments: - title: Комментарии - add: Написать комментарий - other: Другие записи - filed_in: Категория - submit: Отправить комментарий - archive: - blog_archive_for: 'Архив %{date}' - no_blog_articles_posted: 'Ни одной записи за %{date} не опубликовано. Следите за новостями.' + by: 'Опубликовал %{who}' + time_ago: '%{time} назад' + thank_you: 'Спасибо за комментарий.' + thank_you_moderated: 'Спасибо за комментарий. Ваше сообщение модерируется и скоро появится на сайте.' + index: + no_blog_articles_yet: Пока ни одной записи не опубликовано. Следите за новостями. + show: + blog_home: Вернуться к списку записей + comments: + title: Комментарии + add: Написать комментарий + other: Другие записи + filed_in: Категория + submit: Отправить комментарий + archive: + blog_archive_for: 'Архив %{date}' + no_blog_articles_posted: 'Ни одной записи за %{date} не опубликовано. Следите за новостями.' diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 1db3a29..d90333f 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1,128 +1,129 @@ sk: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog + admin: + blog: + categories: + category: + edit: Upraviť kategóriu + delete: Zmazať kategóriu + index: + no_items_yet: 'Niesu tu žiadne kategórie. Klikni "%{create}" pre pridanie prvej.' + comments: + approved: 'Komentár od "%{author}" bol schválený.' + comment: + view_live_html: 'Zobraziť živý náhľad <br/><em>(otvorí nové okno)</em>' + read: Zobraziť komentár + reject: Zamietnuť komentár + approve: Schváliť + rejected: 'Komentár od "%{author}" bol zamietnutý.' + index: + no_items_yet: 'Niesu tu žiadne %{type} komentáre.' + show: + comment: Komentár + blog_post: Blog článok + from: Odoslal + date: Dátum + message: Správa + details: Detaily + age: Vek + actions: Akcie + back: Späť na zoznam komentárov. + reject: Zamietnuť komentár + approve: Schváliť komentár + posts: + form: + advanced_options: Pokročilé nastavenia + toggle_advanced_options: Klikni pre prístup k nastaveniam meta tagov a menu + save_as_draft: Uložiť ako koncept + published_at: Dátum publikovania + index: + no_items_yet: 'Niesu žiadne články na blogu. Klikni na "%{create}" pre pridanie prvého.' + uncategorized: + no_items_yet: 'Niesu žiadne nekategorizované články.' + post: + view_live_html: 'Zobraziť článok<br/><em>(otvorí ho v novom okne)</em>' + edit: Upraviť článok + delete: Zmazať článok + settings: + notification_recipients: + value: Poslať notifikáciu pre + explanation: 'Vždy keď niekto pridá komentár, Refinery pošle notifikáciu.' + hint: 'Vždy keď niekto pridá komentár, Refinery ti pošle notifikáciu.' + example: "Zadaj tvoju emailovú adresu(y) ako napríklad: jack@work.com, jill@office.com" + updated: 'Zoznam príjemcov notifikácií "%{recipients}"' + submenu: + categories: + title: Kategórie + manage: Spravovať + new: Nová kategória + comments: + title: Komentáre + title_with_count: 'Komentáre (%{new_count} nových)' + new: Nový + unmoderated: Nový + approved: Schválený + rejected: Zamietnutý + posts: + title: Články + manage: Spravovať články + new: Vytvoriť nový článok + uncategorized: Nekategorizované články + settings: + title: Nastavenia + moderation: Moderovanie + update_notified: Upraviť zoznam notifikovaných + comments: Komentáre blog: - categories: - category: - edit: Upraviť kategóriu - delete: Zmazať kategóriu - index: - no_items_yet: 'Nie sú tu žiadne kategórie. Klikni "%{create}" pre pridanie prvej.' - comments: - approved: 'Komentár od "%{author}" bol schválený.' - comment: - view_live_html: 'Zobraziť živý náhľad <br/><em>(otvorí nové okno)</em>' - read: Zobraziť komentár - reject: Zamietnuť komentár - approve: Schváliť - rejected: 'Komentár od "%{author}" bol zamietnutý.' - index: - no_items_yet: 'Nie sú tu žiadne %{type} komentáre.' - show: - comment: Komentár - blog_post: Blog článok - from: Odoslal - date: Dátum + comment_mailer: + notification: + greeting: Ahoj + you_recieved_new_comment: Máš nový komentár na stránke + comment_starts: --- začiatok komentára --- + comment_ends: --- koniec komentára --- + from: Od + email: Email message: Správa - details: Detaily - age: Vek - actions: Akcie - back: Späť na zoznam komentárov. - reject: Zamietnuť komentár - approve: Schváliť komentár - posts: - form: - advanced_options: Pokročilé nastavenia - toggle_advanced_options: Klikni pre prístup k nastaveniam meta tagov a menu - save_as_draft: Uložiť ako koncept - published_at: Dátum publikovania - index: - no_items_yet: 'Nie sú žiadne články na blogu. Klikni na "%{create}" pre pridanie prvého.' - uncategorized: - no_items_yet: 'Nie sú žiadne nekategorizované články.' - post: - view_live_html: 'Zobraziť článok<br/><em>(otvorí ho v novom okne)</em>' - edit: Upraviť článok - delete: Zmazať článok - settings: - notification_recipients: - value: Poslať notifikáciu pre - explanation: 'Vždy keď niekto pridá komentár, Refinery pošle notifikáciu.' - hint: 'Vždy keď niekto pridá komentár, Refinery ti pošle notifikáciu.' - example: "Zadaj tvoju emailovú adresu(y) ako napríklad: jack@work.com, jill@office.com" - updated: 'Zoznam príjemcov notifikácií "%{recipients}"' - submenu: + closing_line: S pozdravom + ps: 'P.S. Všetky komentáre su uložené v sekcii "Blog" pod záložkou "Komentáre" v prípade ak by ich bolo potrebné zobraziť neskôr.' + shared: categories: title: Kategórie - manage: Spravovať - new: Nová kategória - comments: - title: Komentáre - title_with_count: 'Komentáre (%{new_count} nových)' - new: Nový - unmoderated: Nový - approved: Schválený - rejected: Zamietnutý + rss_feed: + title: RSS zdroj článkov + subscribe: Prihlásiť k odberu posts: - title: Články - manage: Spravovať články - new: Vytvoriť nový článok - uncategorized: Nekategorizované články - settings: - title: Nastavenia - moderation: Moderovanie - update_notified: Upraviť zoznam notifikovaných - comments: Komentáre - blog: - comment_mailer: - notification: - greeting: Ahoj - you_recieved_new_comment: Máš nový komentár na stránke - comment_starts: --- začiatok komentára --- - comment_ends: --- koniec komentára --- - from: Od - email: Email - message: Správa - closing_line: S pozdravom - ps: 'P.S. Všetky komentáre su uložené v sekcii "Blog" pod záložkou "Komentáre" v prípade ak by ich bolo potrebné zobraziť neskôr.' - shared: + other: Ďaľšie články + created_at: 'Publikovaný %{when}' + read_more: Celý článok + comments: + singular: komentár + none: Niesu tu žiadne komentáre + archives: Archív categories: - title: Kategórie - rss_feed: - title: RSS zdroj článkov - subscribe: Prihlásiť k odberu + show: + no_posts: Niesu tu žiadne články momentálne. posts: - other: Ďaľšie články - created_at: 'Publikovaný %{when}' - read_more: Celý článok - comments: - singular: komentár - none: Nie sú tu žiadne komentáre - archives: Archív - categories: - show: - no_posts: Nie sú tu žiadne články momentálne. - posts: - post: - filed_in: Podaný - comment: komentár - comments: - by: 'Odoslal %{who}' - time_ago: '%{time} späť' - thank_you: 'Vďaka za komentár.' - thank_you_moderated: 'Ďakujeme za Váš komentár. Vaša správa čaká na schválenie a objaví sa v najbližšej dobe.' - index: - no_blog_articles_yet: Práve Nie sú žiadne články na blogu. Zostante naladení. - show: - blog_home: Hlavná stránka blogu + post: + filed_in: Podaný + comment: komentár comments: - title: Komentáre - add: Pridať komentár - other: Ďalšie články - filed_in: Podaný - submit: Odoslať komentár - archive: - blog_archive_for: 'Blog archív pre %{date}' - no_blog_articles_posted: 'Nie sú žiadne články publikované %{date}.' + by: 'Odoslal %{who}' + time_ago: '%{time} späť' + thank_you: 'Vďaka za komentár.' + thank_you_moderated: 'Ďakujeme za Váš komentár. Vaša správa čaká na schválenie a objaví sa v najbližšej dobe.' + index: + no_blog_articles_yet: Práve niesu žiadne články na blogu. Zostante naladení. + show: + blog_home: Hlavná stránka blogu + comments: + title: Komentáre + add: Pridať komentár + other: Ďalšie články + filed_in: Podaný + submit: Odoslať komentár + archive: + blog_archive_for: 'Blog archív pre %{date}' + no_blog_articles_posted: 'Niesu žiadne články publikované %{date}.' diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index a3cafe5..7d94e4a 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1,128 +1,129 @@ zh-CN: - plugins: - refinerycms_blog: - title: 博客 - admin: - blog: - categories: - category: - edit: 编辑此类别 - delete: 永久删除此类别 - index: - no_items_yet: '没有此类别。 点击 "%{create}" 添加第一次类别。' - comments: - approved: '评论来自 "%{author}" 已被审批。' - comment: - view_live_html: '查看此评论 <br/><em>(opens in a new window)</em>' - read: 阅读此评论 - reject: 驳回此评论 - approve: 批准此评论 - rejected: '评论来自 "%{author}" 已被驳回。' - index: - no_items_yet: '没有 %{type} 评论。' - show: - comment: 评论 - blog_post: 发博 - from: 发布由 - date: 发布在 - message: 评论 - details: 详情 - age: 年龄 - actions: 行动 - back: 返回至所有评论 - reject: 驳回此评论 - approve: 批准此评论 - posts: - form: - advanced_options: 高级选项 - toggle_advanced_options: 点击进入标签详解设置和菜单选项 - save_as_draft: 保存为草稿 - published_at: 发布日期 - index: - no_items_yet: '目前尚未发博。 点击 "%{create}" 添加您的第一篇博文。' - uncategorized: - no_items_yet: '没有未归类的博文。' - post: - view_live_html: '查看此博 <br/><em>(opens in a new window)</em>' - edit: 编辑此博 - delete: 永久删除此博 - settings: - notification_recipients: - value: 发送通知 - explanation: '每次有人发表评论,发送邮件告知有新评论。' - hint: '增加新评论时,将会发送邮件告知您。' - example: "输入您的邮件地址,如: jack@work.com, jill@office.com" - updated: '通知收件人已被设为 "%{recipients}"' - submenu: + refinery: + plugins: + refinerycms_blog: + title: 博客 + admin: + blog: categories: - title: 分类 - manage: 管理 - new: 创建新的类别 + category: + edit: 编辑此类别 + delete: 永久删除此类别 + index: + no_items_yet: '没有此类别。 点击 "%{create}" 添加第一次类别。' comments: - title: 评论 - title_with_count: '评论 (%{new_count} new)' - new: 新 - unmoderated: 新 - approved: 批准 - rejected: 驳回 + approved: '评论来自 "%{author}" 已被审批。' + comment: + view_live_html: '查看此评论 <br/><em>(opens in a new window)</em>' + read: 阅读此评论 + reject: 驳回此评论 + approve: 批准此评论 + rejected: '评论来自 "%{author}" 已被驳回。' + index: + no_items_yet: '没有 %{type} 评论。' + show: + comment: 评论 + blog_post: 发博 + from: 发布由 + date: 发布在 + message: 评论 + details: 详情 + age: 年龄 + actions: 行动 + back: 返回至所有评论 + reject: 驳回此评论 + approve: 批准此评论 posts: - title: 博文 - manage: 管理博文 - new: 创建新博文 - uncategorized: 未归类博文 + form: + advanced_options: 高级选项 + toggle_advanced_options: 点击进入标签详解设置和菜单选项 + save_as_draft: 保存为草稿 + published_at: 发布日期 + index: + no_items_yet: '目前尚未发博。 点击 "%{create}" 添加您的第一篇博文。' + uncategorized: + no_items_yet: '没有未归类的博文。' + post: + view_live_html: '查看此博 <br/><em>(opens in a new window)</em>' + edit: 编辑此博 + delete: 永久删除此博 settings: - title: 设置 - moderation: 等待审核 - update_notified: 更新获得通知的人 - comments: 评论 - blog: - comment_mailer: - notification: - greeting: 您好 - you_recieved_new_comment: 您刚收到来自网站的一条新评论 - comment_starts: --- 评论开始 --- - comment_ends: --- 评论结束 --- - from: 来自 - email: 邮件 - message: 信息 - closing_line: 亲切问候 - ps: 'P.S. All your comments are stored in the "Blog" section of Refinery under the "Comments" submenu should you ever want to view it later there.' - shared: + notification_recipients: + value: 发送通知 + explanation: '每次有人发表评论,发送邮件告知有新评论。' + hint: '增加新评论时,将会发送邮件告知您。' + example: "输入您的邮件地址,如: jack@work.com, jill@office.com" + updated: '通知收件人已被设为 "%{recipients}"' + submenu: + categories: + title: 分类 + manage: 管理 + new: 创建新的类别 + comments: + title: 评论 + title_with_count: '评论 (%{new_count} new)' + new: 新 + unmoderated: 新 + approved: 批准 + rejected: 驳回 + posts: + title: 博文 + manage: 管理博文 + new: 创建新博文 + uncategorized: 未归类博文 + settings: + title: 设置 + moderation: 等待审核 + update_notified: 更新获得通知的人 + comments: 评论 + blog: + comment_mailer: + notification: + greeting: 您好 + you_recieved_new_comment: 您刚收到来自网站的一条新评论 + comment_starts: --- 评论开始 --- + comment_ends: --- 评论结束 --- + from: 来自 + email: 邮件 + message: 信息 + closing_line: 亲切问候 + ps: 'P.S. All your comments are stored in the "Blog" section of Refinery under the "Comments" submenu should you ever want to view it later there.' + shared: + categories: + title: 分类 + rss_feed: + title: RSS源 + subscribe: 订阅 + posts: + other: 其他博文 + created_at: '发表于 %{when}' + read_more: 阅读更多 + comments: + singular: 评论 + none: 没有评论 + archives: 档案 categories: - title: 分类 - rss_feed: - title: RSS源 - subscribe: 订阅 + show: + no_posts: 此处没有文章。 posts: - other: 其他博文 - created_at: '发表于 %{when}' - read_more: 阅读更多 - comments: - singular: 评论 - none: 没有评论 - archives: 档案 - categories: - show: - no_posts: 此处没有文章。 - posts: - post: - filed_in: 用户体验 - comment: 评论 - comments: - by: '发布由 %{who}' - time_ago: '%{time} 之前' - thank_you: '感谢您的评论。' - thank_you_moderated: '感谢您的评论。 您的信息已被列入等待审核队列,并会在短期内出现。' - index: - no_blog_articles_yet: 尚未发布文章。敬请关注。 - show: - blog_home: 博客首页 + post: + filed_in: 用户体验 + comment: 评论 comments: - title: 评论 - add: 发表评论 - other: 其他博文 - filed_in: 用户体验 - submit: 发送评论 - archive: - blog_archive_for: '博客存档 %{date}' - no_blog_articles_posted: '没有发布文章 %{date}。敬请关注。' + by: '发布由 %{who}' + time_ago: '%{time} 之前' + thank_you: '感谢您的评论。' + thank_you_moderated: '感谢您的评论。 您的信息已被列入等待审核队列,并会在短期内出现。' + index: + no_blog_articles_yet: 尚未发布文章。敬请关注。 + show: + blog_home: 博客首页 + comments: + title: 评论 + add: 发表评论 + other: 其他博文 + filed_in: 用户体验 + submit: 发送评论 + archive: + blog_archive_for: '博客存档 %{date}' + no_blog_articles_posted: '没有发布文章 %{date}。敬请关注。' diff --git a/config/routes.rb b/config/routes.rb index e26fe64..2ed6e8d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,45 +1,47 @@ -::Refinery::Application.routes.draw do - scope(:path => 'blog', :module => 'blog') do - root :to => 'posts#index', :as => 'blog_root' - match 'feed.rss', :to => 'posts#index', :as => 'blog_rss_feed', :defaults => {:format => "rss"} - match ':id', :to => 'posts#show', :as => 'blog_post' - match 'categories/:id', :to => 'categories#show', :as => 'blog_category' - match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments' - get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_blog_posts' - get 'tagged/:tag_id(/:tag_name)' => 'posts#tagged', :as => 'tagged_posts' - end +Rails.application.routes.draw do + scope(:module => 'refinery') do + scope(:path => 'blog', :module => 'blog') do + root :to => 'posts#index', :as => 'blog_root' + match 'feed.rss', :to => 'posts#index', :as => 'blog_rss_feed', :defaults => {:format => "rss"} + match ':id', :to => 'posts#show', :as => 'blog_post' + match 'categories/:id', :to => 'categories#show', :as => 'blog_category' + match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments' + get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_blog_posts' + get 'tagged/:tag_id(/:tag_name)' => 'posts#tagged', :as => 'tagged_posts' + end - scope(:path => 'refinery', :as => 'admin', :module => 'admin') do - scope(:path => 'blog', :as => 'blog', :module => 'blog') do - root :to => 'posts#index' - resources :posts do - collection do - get :uncategorized - get :tags + scope(:path => 'refinery', :as => 'refinery_admin', :module => 'admin') do + scope(:path => 'blog', :as => 'blog', :module => 'blog') do + root :to => 'posts#index' + resources :posts do + collection do + get :uncategorized + get :tags + end end - end - resources :categories + resources :categories - resources :comments do - collection do - get :approved - get :rejected + resources :comments do + collection do + get :approved + get :rejected + end + member do + get :approved + get :rejected + end end - member do - get :approved - get :rejected - end - end - resources :settings do - collection do - get :notification_recipients - post :notification_recipients + resources :settings do + collection do + get :notification_recipients + post :notification_recipients - get :moderation - get :comments - get :teasers + get :moderation + get :comments + get :teasers + end end end end diff --git a/db/migrate/1_create_blog_structure.rb b/db/migrate/1_create_blog_structure.rb deleted file mode 100644 index a93d2d4..0000000 --- a/db/migrate/1_create_blog_structure.rb +++ /dev/null @@ -1,54 +0,0 @@ -class CreateBlogStructure < ActiveRecord::Migration - - def self.up - create_table :blog_posts, :id => true do |t| - t.string :title - t.text :body - t.boolean :draft - t.datetime :published_at - t.timestamps - end - - add_index :blog_posts, :id - - create_table :blog_comments, :id => true do |t| - t.integer :blog_post_id - t.boolean :spam - t.string :name - t.string :email - t.text :body - t.string :state - t.timestamps - end - - add_index :blog_comments, :id - - create_table :blog_categories, :id => true do |t| - t.string :title - t.timestamps - end - - add_index :blog_categories, :id - - create_table :blog_categories_blog_posts, :id => true do |t| - t.integer :blog_category_id - t.integer :blog_post_id - end - - add_index :blog_categories_blog_posts, [:blog_category_id, :blog_post_id], :name => 'index_blog_categories_blog_posts_on_bc_and_bp' - - load(Rails.root.join('db', 'seeds', 'refinerycms_blog.rb').to_s) - end - - def self.down - UserPlugin.destroy_all({:name => "refinerycms_blog"}) - - Page.delete_all({:link_url => "/blog"}) - - drop_table :blog_posts - drop_table :blog_comments - drop_table :blog_categories - drop_table :blog_categories_blog_posts - end - -end diff --git a/db/migrate/20110803223522_create_blog_structure.rb b/db/migrate/20110803223522_create_blog_structure.rb new file mode 100644 index 0000000..f828936 --- /dev/null +++ b/db/migrate/20110803223522_create_blog_structure.rb @@ -0,0 +1,52 @@ +class CreateBlogStructure < ActiveRecord::Migration + + def up + create_table Refinery::Blog::Post.table_name, :id => true do |t| + t.string :title + t.text :body + t.boolean :draft + t.datetime :published_at + t.timestamps + end + + add_index Refinery::Blog::Post.table_name, :id + + create_table Refinery::Blog::Comment.table_name, :id => true do |t| + t.integer :blog_post_id + t.boolean :spam + t.string :name + t.string :email + t.text :body + t.string :state + t.timestamps + end + + add_index Refinery::Blog::Comment.table_name, :id + + create_table Refinery::Blog::Category.table_name, :id => true do |t| + t.string :title + t.timestamps + end + + add_index Refinery::Blog::Category.table_name, :id + + create_table Refinery::Categorization.table_name, :id => true do |t| + t.integer :blog_category_id + t.integer :blog_post_id + end + + add_index Refinery::Categorization.table_name, [:blog_category_id, :blog_post_id], :name => 'index_blog_categories_blog_posts_on_bc_and_bp' + end + + def down + Refinery::UserPlugin.destroy_all({:name => "refinerycms_blog"}) + + Refinery::Page.delete_all({:link_url => "/blog"}) + + drop_table Refinery::Blog::Post.table_name + drop_table Refinery::Blog::Comment.table_name + drop_table Refinery::Category.table_name + drop_table Refinery::Categorization.table_name + end + +end diff --git a/db/migrate/20110803223523_add_user_id_to_blog_posts.rb b/db/migrate/20110803223523_add_user_id_to_blog_posts.rb new file mode 100644 index 0000000..2fadb28 --- /dev/null +++ b/db/migrate/20110803223523_add_user_id_to_blog_posts.rb @@ -0,0 +1,7 @@ +class AddUserIdToBlogPosts < ActiveRecord::Migration + + def change + add_column Refinery::Blog::Post.table_name, :user_id, :integer + end + +end
\ No newline at end of file diff --git a/db/migrate/3_acts_as_taggable_on_migration.rb b/db/migrate/20110803223524_acts_as_taggable_on_migration.rb index 1661061..812daf4 100644 --- a/db/migrate/3_acts_as_taggable_on_migration.rb +++ b/db/migrate/20110803223524_acts_as_taggable_on_migration.rb @@ -1,5 +1,5 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration - def self.up + def up create_table :tags do |t| t.string :name end @@ -21,7 +21,7 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration add_index :taggings, [:taggable_id, :taggable_type, :context] end - def self.down + def down drop_table :taggings drop_table :tags end diff --git a/db/migrate/20110803223526_add_cached_slugs.rb b/db/migrate/20110803223526_add_cached_slugs.rb new file mode 100644 index 0000000..1024323 --- /dev/null +++ b/db/migrate/20110803223526_add_cached_slugs.rb @@ -0,0 +1,6 @@ +class AddCachedSlugs < ActiveRecord::Migration + def change + add_column Refinery::Blog::Category.table_name, :cached_slug, :string + add_column Refinery::Blog::Post.table_name, :cached_slug, :string + end +end diff --git a/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb b/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb new file mode 100644 index 0000000..7d3a225 --- /dev/null +++ b/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb @@ -0,0 +1,5 @@ +class AddCustomUrlFieldToBlogPosts < ActiveRecord::Migration + def change + add_column Refinery::Blog::Post.table_name, :custom_url, :string + end +end diff --git a/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb b/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb new file mode 100644 index 0000000..895acb5 --- /dev/null +++ b/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb @@ -0,0 +1,6 @@ +class AddCustomTeaserFieldToBlogPosts < ActiveRecord::Migration + def change + add_column Refinery::Blog::Post.table_name, :custom_teaser, :text + end +end + diff --git a/db/migrate/20110803223529_add_primary_key_to_categorizations.rb b/db/migrate/20110803223529_add_primary_key_to_categorizations.rb new file mode 100644 index 0000000..5bbfcf3 --- /dev/null +++ b/db/migrate/20110803223529_add_primary_key_to_categorizations.rb @@ -0,0 +1,14 @@ +class AddPrimaryKeyToCategorizations < ActiveRecord::Migration + def up + unless Refinery::Categorization.column_names.include?("id") + add_column Refinery::Categorization.table_name, :id, :primary_key + end + end + + def down + if Refinery::Categorization.column_names.include?("id") + remove_column Refinery::Categorization.table_name, :id + end + end +end + diff --git a/db/migrate/2_add_user_id_to_blog_posts.rb b/db/migrate/2_add_user_id_to_blog_posts.rb deleted file mode 100644 index cd62524..0000000 --- a/db/migrate/2_add_user_id_to_blog_posts.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddUserIdToBlogPosts < ActiveRecord::Migration - - def self.up - add_column :blog_posts, :user_id, :integer - end - - def self.down - remove_column :blog_posts, :user_id - end - -end
\ No newline at end of file diff --git a/db/migrate/4_create_seo_meta_for_blog.rb b/db/migrate/4_create_seo_meta_for_blog.rb deleted file mode 100644 index baf81a4..0000000 --- a/db/migrate/4_create_seo_meta_for_blog.rb +++ /dev/null @@ -1,25 +0,0 @@ -class CreateSeoMetaForBlog < ActiveRecord::Migration - - def self.up - unless ::SeoMetum.table_exists? - create_table ::SeoMetum.table_name do |t| - t.integer :seo_meta_id - t.string :seo_meta_type - - t.string :browser_title - t.string :meta_keywords - t.text :meta_description - - t.timestamps - end - - add_index ::SeoMetum.table_name, :id - add_index ::SeoMetum.table_name, [:seo_meta_id, :seo_meta_type] - end - end - - def self.down - # can't drop the table because someone else might be using it. - end - -end diff --git a/db/migrate/5_add_cached_slugs.rb b/db/migrate/5_add_cached_slugs.rb deleted file mode 100644 index c189302..0000000 --- a/db/migrate/5_add_cached_slugs.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddCachedSlugs < ActiveRecord::Migration - def self.up - add_column :blog_categories, :cached_slug, :string - add_column :blog_posts, :cached_slug, :string - end - - def self.down - remove_column :blog_categories, :cached_slug - remove_column :blog_posts, :cached_slug - end -end diff --git a/db/migrate/6_add_custom_url_field_to_blog_posts.rb b/db/migrate/6_add_custom_url_field_to_blog_posts.rb deleted file mode 100644 index 5a8901e..0000000 --- a/db/migrate/6_add_custom_url_field_to_blog_posts.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddCustomUrlFieldToBlogPosts < ActiveRecord::Migration - def self.up - add_column :blog_posts, :custom_url, :string - end - - def self.down - remove_column :blog_posts, :custom_url - end -end diff --git a/db/migrate/7_add_custom_teaser_field_to_blog_posts.rb b/db/migrate/7_add_custom_teaser_field_to_blog_posts.rb deleted file mode 100644 index daa4d04..0000000 --- a/db/migrate/7_add_custom_teaser_field_to_blog_posts.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddCustomTeaserFieldToBlogPosts < ActiveRecord::Migration - def self.up - add_column :blog_posts, :custom_teaser, :text - end - - def self.down - remove_column :blog_posts, :custom_teaser - end -end - diff --git a/db/migrate/8_add_primary_key_to_categorizations.rb b/db/migrate/8_add_primary_key_to_categorizations.rb deleted file mode 100644 index efee289..0000000 --- a/db/migrate/8_add_primary_key_to_categorizations.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddPrimaryKeyToCategorizations < ActiveRecord::Migration - def self.up - unless ::Categorization.column_names.include?("id") - add_column :blog_categories_blog_posts, :id, :primary_key - end - end - - def self.down - remove_column :blog_categories_blog_posts, :id - end -end - diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..e0a8b7d --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,27 @@ +Refinery::User.find(:all).each do |user| + if user.plugins.where(:name => 'refinerycms_blog').blank? + user.plugins.create(:name => "refinerycms_blog", + :position => (user.plugins.maximum(:position) || -1) +1) + end +end if defined?(Refinery::User) + +if defined?(Refinery::Page) + page = Refinery::Page.create( + :title => "Blog", + :link_url => "/blog", + :deletable => false, + :position => ((Refinery::Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1), + :menu_match => "^/blogs?(\/|\/.+?|)$" + ) + + Refinery::Page.default_parts.each do |default_page_part| + page.parts.create(:title => default_page_part, :body => nil) + end +end# Refinery seeds +Dir[Rails.root.join('db', 'seeds', '*.rb').to_s].each do |file| + puts "Loading db/seeds/#{file.split(File::SEPARATOR).last}" + load(file) +end + +# Added by RefineryCMS Pages engine +Refinery::Pages::Engine.load_seed diff --git a/db/seeds/refinerycms_blog.rb b/db/seeds/refinerycms_blog.rb deleted file mode 100644 index 0be2a06..0000000 --- a/db/seeds/refinerycms_blog.rb +++ /dev/null @@ -1,20 +0,0 @@ -::User.find(:all).each do |user| - if user.plugins.where(:name => 'refinerycms_blog').blank? - user.plugins.create(:name => "refinerycms_blog", - :position => (user.plugins.maximum(:position) || -1) +1) - end -end if defined?(::User) - -if defined?(::Page) - page = ::Page.create( - :title => "Blog", - :link_url => "/blog", - :deletable => false, - :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1), - :menu_match => "^/blogs?(\/|\/.+?|)$" - ) - - ::Page.default_parts.each do |default_page_part| - page.parts.create(:title => default_page_part, :body => nil) - end -end
\ No newline at end of file diff --git a/features/authors.feature b/features/authors.feature deleted file mode 100644 index f3fd3ec..0000000 --- a/features/authors.feature +++ /dev/null @@ -1,15 +0,0 @@ -@blog @blog_authors -Feature: Blog Post Authors - Blog posts can be assigned authors through the given user model - current_user is assumed through admin screens - - Scenario: Saving a blog post in blog_posts#new associates the current_user as the author - Given I am a logged in refinery user - - When I am on the new blog post form - And I fill in "Title" with "This is my blog post" - And I fill in "blog_post_body" with "And I love it" - And I press "Save" - - Then there should be 1 blog post - And the blog post should belong to me
\ No newline at end of file diff --git a/features/category.feature b/features/category.feature deleted file mode 100644 index 6af1075..0000000 --- a/features/category.feature +++ /dev/null @@ -1,23 +0,0 @@ -@blog @blog_categories -Feature: Blog Post Categories - Blog posts can be assigned categories - - Background: - Given I am a logged in refinery user - Given there is a category titled "Videos" - - Scenario: The blog post new/edit form has category_list - When I am on the new blog post form - Then I should see "Tags" - Then I should see "Videos" - - Scenario: The blog post new/edit form saves categories - When I am on the new blog post form - And I fill in "Title" with "This is my blog post" - And I fill in "blog_post_body" with "And I love it" - And I check "Videos" - And I press "Save" - - Then there should be 1 blog post - And the blog post should have 1 category - And the blog post should have the category "Videos"
\ No newline at end of file diff --git a/features/support/factories/blog_categories.rb b/features/support/factories/blog_categories.rb deleted file mode 100644 index 2b47a87..0000000 --- a/features/support/factories/blog_categories.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'factory_girl' - -Factory.define(:blog_category) do |f| - f.sequence(:title) { |n| "Shopping #{n}" } -end diff --git a/features/support/factories/blog_comments.rb b/features/support/factories/blog_comments.rb deleted file mode 100644 index 9405c42..0000000 --- a/features/support/factories/blog_comments.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'factory_girl' - -Factory.define(:blog_comment) do |f| - f.name "Joe Commenter" - f.sequence(:email) { |n| "person#{n}@example.com" } - f.body "Which one is the best for picking up new shoes?" - f.association :post, :factory => :blog_post -end diff --git a/features/support/factories/blog_posts.rb b/features/support/factories/blog_posts.rb deleted file mode 100644 index 4584fec..0000000 --- a/features/support/factories/blog_posts.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'factory_girl' - -Factory.define(:blog_post, :class => BlogPost) do |f| - f.sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" } - f.body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it." - f.draft false - f.tag_list "chicago, shopping, fun times" - f.published_at Time.now -end diff --git a/features/support/paths.rb b/features/support/paths.rb deleted file mode 100644 index dbd04dd..0000000 --- a/features/support/paths.rb +++ /dev/null @@ -1,24 +0,0 @@ -module NavigationHelpers - module Refinery - module Blog - def path_to(page_name) - case page_name - when /the list of blog posts/ - admin_blog_posts_path - when /the new blog posts? form/ - new_admin_blog_post_path - else - begin - if page_name =~ /the blog post titled "?([^\"]*)"?/ and (page = BlogPost.find_by_title($1)).present? - self.url_for(page.url) - else - nil - end - rescue - nil - end - end - end - end - end -end diff --git a/features/support/step_definitions/authors_steps.rb b/features/support/step_definitions/authors_steps.rb deleted file mode 100644 index d78ca90..0000000 --- a/features/support/step_definitions/authors_steps.rb +++ /dev/null @@ -1,7 +0,0 @@ -Then /^there should be (\d+) blog posts?$/ do |num| - BlogPost.all.size == num -end - -Then /^the blog post should belong to me$/ do - BlogPost.first.author.login == User.last.login -end
\ No newline at end of file diff --git a/features/support/step_definitions/category_steps.rb b/features/support/step_definitions/category_steps.rb deleted file mode 100644 index 891b5c0..0000000 --- a/features/support/step_definitions/category_steps.rb +++ /dev/null @@ -1,11 +0,0 @@ -Given /^there is a category titled "([^"]*)"$/ do |title| - @category = Factory.create(:blog_category, :title => title) -end - -Then /^the blog post should have ([\d]*) categor[yies]{1,3}$/ do |num_category| - BlogPost.last.categories.count.should == num_category.to_i -end - -Then /^the blog post should have the category "([^"]*)"$/ do |category| - BlogPost.last.categories.first.title.should == category -end
\ No newline at end of file diff --git a/features/support/step_definitions/tags_steps.rb b/features/support/step_definitions/tags_steps.rb deleted file mode 100644 index 8280474..0000000 --- a/features/support/step_definitions/tags_steps.rb +++ /dev/null @@ -1,13 +0,0 @@ -Given /^there is a blog post titled "([^"]*)" and tagged "([^"]*)"$/ do |title, tag_name| - @blog_post = Factory.create(:blog_post, :title => title, :tag_list => tag_name) -end - -When /^I visit the tagged posts page for "([^"]*)"$/ do |tag_name| - @blog_post ||= Factory.create(:blog_post, :tag_list => tag_name) - tag = BlogPost.tag_counts_on(:tags).first - visit tagged_posts_path(tag.id, tag_name.parameterize) -end - -Then /^the blog post should have the tags "([^"]*)"$/ do |tag_list| - BlogPost.last.tag_list == tag_list.split(', ') -end diff --git a/features/tags.feature b/features/tags.feature deleted file mode 100644 index 24dff2a..0000000 --- a/features/tags.feature +++ /dev/null @@ -1,26 +0,0 @@ -@blog @blog_tags -Feature: Blog Post Tags - Blog posts can be assigned tags - - Background: - Given I am a logged in refinery user - - Scenario: The blog post new/edit form has tag_list - When I am on the new blog post form - Then I should see "Tags" - - Scenario: The blog post new/edit form saves tag_list - When I am on the new blog post form - And I fill in "Title" with "This is my blog post" - And I fill in "blog_post_body" with "And I love it" - And I fill in "Tags" with "chicago, bikes, beers, babes" - And I press "Save" - - Then there should be 1 blog post - And the blog post should have the tags "chicago, bikes, beers, babes" - - Scenario: The blog has a "tagged" route & view - Given there is a blog post titled "I love my city" and tagged "chicago" - When I visit the tagged posts page for "chicago" - Then I should see "Chicago" - And I should see "I love my city"
\ No newline at end of file diff --git a/lib/gemspec.rb b/lib/gemspec.rb index 3562315..5508df6 100644 --- a/lib/gemspec.rb +++ b/lib/gemspec.rb @@ -2,9 +2,12 @@ require File.expand_path('../refinery/blog/version', __FILE__) version = ::Refinery::Blog::Version.to_s raise "Could not get version so gemspec can not be built" if version.nil? -files = Dir.glob("**/*").flatten.reject{|f| f =~ %r{.gem$}} +files = Dir.glob("**/*").flatten.reject{|f| f =~ %r{(.gem$|^spec/dummy|.lock$)}} gemspec = <<EOF +# Encoding: UTF-8 +# DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it. + Gem::Specification.new do |s| s.name = %q{refinerycms-blog} s.version = %q{#{version}} @@ -17,20 +20,18 @@ Gem::Specification.new do |s| s.require_paths = %w(lib) # Runtime dependencies - s.add_dependency 'refinerycms-core', '~> 1.0.3' + s.add_dependency 'refinerycms-core', '~> 2.0.0' s.add_dependency 'filters_spam', '~> 0.2' s.add_dependency 'acts-as-taggable-on' - s.add_dependency 'seo_meta', '~> 1.1.0' + s.add_dependency 'seo_meta', '~> 1.2.0.rc1' + s.add_dependency 'rails_autolink' # Development dependencies - s.add_development_dependency 'factory_girl' + s.add_development_dependency 'refinerycms-testing', '~> 2.0.0' s.files = %w( #{files.join("\n ")} ) - #{"s.test_files = %w( - #{Dir.glob("test/**/*.rb").join("\n ")} - )" if File.directory?("test")} end EOF diff --git a/lib/generators/refinery/blog/blog_generator.rb b/lib/generators/refinery/blog/blog_generator.rb new file mode 100644 index 0000000..a7d49a3 --- /dev/null +++ b/lib/generators/refinery/blog/blog_generator.rb @@ -0,0 +1,21 @@ +module Refinery + class BlogGenerator < Rails::Generators::Base + + def rake_db + rake("refinery_blog:install:migrations") + end + + source_root File.expand_path('../templates', __FILE__) + + def append_load_seed_data + append_file 'db/seeds.rb', :verbose => true do + <<-EOH + +# Added by RefineryCMS Blog engine +Refinery::Blog::Engine.load_seed + EOH + end + end + + end +end diff --git a/lib/generators/refinerycms_blog_generator.rb b/lib/generators/refinerycms_blog_generator.rb deleted file mode 100644 index 6fca607..0000000 --- a/lib/generators/refinerycms_blog_generator.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'refinery/generators' - -class RefinerycmsBlogGenerator < ::Refinery::Generators::EngineInstaller - - source_root File.expand_path('../../../', __FILE__) - engine_name "refinerycms-blog" - -end
\ No newline at end of file diff --git a/lib/refinery/blog.rb b/lib/refinery/blog.rb new file mode 100644 index 0000000..6b3b72c --- /dev/null +++ b/lib/refinery/blog.rb @@ -0,0 +1,40 @@ +require 'refinerycms-core' +require 'filters_spam' +require 'rails_autolink' + +module Refinery + autoload :BlogGenerator, 'generators/refinery/blog/blog_generator' + + module Blog + + require 'refinery/blog/engine' if defined?(Rails) + + autoload :Version, 'refinery/blog/version' + autoload :Tab, 'refinery/blog/tabs' + + class << self + attr_writer :root + attr_writer :tabs + + def root + @root ||= Pathname.new(File.expand_path('../../', __FILE__)) + end + + def tabs + @tabs ||= [] + end + + def version + ::Refinery::Blog::Version.to_s + end + + def factory_paths + @factory_paths ||= [ root.join("spec/factories").to_s ] + end + + def table_name_prefix + 'refinery_blog_' + end + end + end +end diff --git a/lib/refinery/blog/engine.rb b/lib/refinery/blog/engine.rb new file mode 100644 index 0000000..3c829ca --- /dev/null +++ b/lib/refinery/blog/engine.rb @@ -0,0 +1,29 @@ +require 'refinerycms-blog' +require 'rails' + +module Refinery + module Blog + class Engine < Rails::Engine + include Refinery::Engine + + isolate_namespace Refinery + engine_name :refinery_blog + + initializer "register refinerycms_blog plugin", :after => :set_routes_reloader do |app| + Refinery::Plugin.register do |plugin| + plugin.pathname = root + plugin.name = "refinerycms_blog" + plugin.url = app.routes.url_helpers.refinery_admin_blog_posts_path + plugin.menu_match = /^\/refinery\/blog\/?(posts|comments|categories)?/ + plugin.activity = { + :class_name => :'refinery/blog/post' + } + end + end + + config.after_initialize do + Refinery.register_engine(Refinery::Blog) + end + end + end +end diff --git a/lib/refinery/blog/tabs.rb b/lib/refinery/blog/tabs.rb index 083d50b..519b90e 100644 --- a/lib/refinery/blog/tabs.rb +++ b/lib/refinery/blog/tabs.rb @@ -1,11 +1,5 @@ module Refinery - module Blog - attr_accessor :tabs - - def self.tabs - @tabs ||= [] - end - + module Blog class Tab attr_accessor :name, :partial @@ -18,11 +12,11 @@ module Refinery raise "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank? end - protected + protected - def initialize - ::Refinery::Blog.tabs << self # add me to the collection of registered page tabs - end + def initialize + ::Refinery::Blog.tabs << self # add me to the collection of registered page tabs + end end end end
\ No newline at end of file diff --git a/lib/refinery/blog/version.rb b/lib/refinery/blog/version.rb index 0390414..4023000 100644 --- a/lib/refinery/blog/version.rb +++ b/lib/refinery/blog/version.rb @@ -1,9 +1,9 @@ module Refinery module Blog class Version - @major = 1 - @minor = 6 - @tiny = 2 + @major = 2 + @minor = 0 + @tiny = 0 class << self attr_reader :major, :minor, :tiny diff --git a/lib/refinerycms-blog.rb b/lib/refinerycms-blog.rb index 452863b..e08f070 100644 --- a/lib/refinerycms-blog.rb +++ b/lib/refinerycms-blog.rb @@ -1,41 +1 @@ -require 'filters_spam' - -module Refinery - module Blog - autoload :Version, File.expand_path('../refinery/blog/version', __FILE__) - autoload :Tab, File.expand_path("../refinery/blog/tabs", __FILE__) - - class << self - attr_accessor :root - def root - @root ||= Pathname.new(File.expand_path('../../', __FILE__)) - end - - def version - ::Refinery::Blog::Version.to_s - end - end - - class Engine < Rails::Engine - initializer 'blog serves assets' do |app| - app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public" - end - - config.to_prepare do - require File.expand_path('../refinery/blog/tabs', __FILE__) - end - - config.after_initialize do - Refinery::Plugin.register do |plugin| - plugin.pathname = root - plugin.name = "refinerycms_blog" - plugin.url = {:controller => '/admin/blog/posts', :action => 'index'} - plugin.menu_match = /^\/?(admin|refinery)\/blog\/?(posts|comments|categories)?/ - plugin.activity = { - :class => BlogPost - } - end - end - end if defined?(Rails::Engine) - end -end +require 'refinery/blog' diff --git a/public/stylesheets/refinery/refinerycms-blog.css b/public/stylesheets/refinery/refinerycms-blog.css deleted file mode 100644 index 3df86f0..0000000 --- a/public/stylesheets/refinery/refinerycms-blog.css +++ /dev/null @@ -1,55 +0,0 @@ -.comments_icon { - background-image: url('/images/refinerycms-blog/icons/comments.png'); -} -.comment_icon { - background-image: url('/images/refinerycms-blog/icons/comment.png'); -} -.comment_cross_icon { - background-image: url('/images/refinerycms-blog/icons/comment_cross.png'); -} -.comment_tick_icon { - background-image: url('/images/refinerycms-blog/icons/comment_tick.png'); -} -.folder_icon { - background-image: url('/images/refinerycms-blog/icons/folder.png'); -} -.folder_add_icon { - background-image: url('/images/refinerycms-blog/icons/folder_add.png'); -} -.folder_edit_icon { - background-image: url('/images/refinerycms-blog/icons/folder_edit.png'); -} -.settings_icon { - background-image: url('/images/refinerycms-blog/icons/cog.png'); -} -.page_icon { - background-image: url('/images/refinerycms-blog/icons/page.png'); -} -.page_copy_icon { - background-image: url('/images/refinerycms-blog/icons/page_copy.png'); -} -.page_add_icon { - background-image: url('/images/refinerycms-blog/icons/page_add.png'); -} -ul.collapsible_menu li { - position: relative; -} -ul.collapsible_menu li span.arrow { - background-repeat: no-repeat; - position: absolute; - right: 10px; - top: 13px; - width: 11px; - height: 7px; - cursor: pointer; -} -ul.collapsible_menu li span.arrow { - background-image: url('/images/refinerycms-blog/icons/up.gif'); -} -ul.collapsible_menu li.closed span.arrow { - background-image: url('/images/refinerycms-blog/icons/down.gif'); -} -ul.collapsible_menu > div { - width: 93%; - margin: 0px auto; -} @@ -2,7 +2,7 @@ Simple blog engine for [Refinery CMS](http://refinerycms.com). It supports posts, categories and comments. -This version of `refinerycms-blog` supports Rails 3.0.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). +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). Options: @@ -11,20 +11,38 @@ Options: ## Requirements -Refinery CMS version 1.0.0 or above. +Refinery CMS version 2.0.0 or above. ## Install Open up your ``Gemfile`` and add at the bottom this line: - gem 'refinerycms-blog', '~> 1.6.1' + gem 'refinerycms-blog', '~> 2.0.0' Now, run ``bundle install`` Next, to install the blog plugin run: - rails generate refinerycms_blog + rails generate refinery:blog Finally migrate your database and you're done. - rake db:migrate
\ No newline at end of file + rake db:migrate + +## Developing & Contributing + +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. + +### Testing + +Generate the dummy application to test against + + $ bundle exec rake refinery:testing:dummy_app + +Run the test suite with [Guard](https://github.com/guard/guard) + + $ bundle exec guard start + +Or just with rake spec + + $ bundle exec rake spec diff --git a/refinerycms-blog.gemspec b/refinerycms-blog.gemspec index 51682fb..22dfb6b 100644 --- a/refinerycms-blog.gemspec +++ b/refinerycms-blog.gemspec @@ -1,8 +1,11 @@ +# Encoding: UTF-8 +# DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it. + Gem::Specification.new do |s| s.name = %q{refinerycms-blog} - s.version = %q{1.6.2} + s.version = %q{2.0.0} s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with RefineryCMS.} - s.date = %q{2011-06-29} + s.date = %q{2011-11-06} s.summary = %q{Ruby on Rails blogging engine for RefineryCMS.} s.email = %q{info@refinerycms.com} s.homepage = %q{http://refinerycms.com/blog} @@ -10,101 +13,165 @@ Gem::Specification.new do |s| s.require_paths = %w(lib) # Runtime dependencies - s.add_dependency 'refinerycms-core', '~> 1.0.3' + s.add_dependency 'refinerycms-core', '~> 2.0.0' s.add_dependency 'filters_spam', '~> 0.2' s.add_dependency 'acts-as-taggable-on' - s.add_dependency 'seo_meta', '~> 1.1.0' + s.add_dependency 'seo_meta', '~> 1.2.0.rc1' + s.add_dependency 'rails_autolink' # Development dependencies - s.add_development_dependency 'factory_girl' + s.add_development_dependency 'refinerycms-testing', '~> 2.0.0' s.files = %w( app + app/assets + app/assets/images + app/assets/images/refinery + app/assets/images/refinery/blog + app/assets/images/refinery/blog/icons + app/assets/images/refinery/blog/icons/cog.png + app/assets/images/refinery/blog/icons/comment.png + app/assets/images/refinery/blog/icons/comment_cross.png + app/assets/images/refinery/blog/icons/comment_tick.png + app/assets/images/refinery/blog/icons/comments.png + app/assets/images/refinery/blog/icons/down.gif + app/assets/images/refinery/blog/icons/folder.png + app/assets/images/refinery/blog/icons/folder_add.png + app/assets/images/refinery/blog/icons/folder_edit.png + app/assets/images/refinery/blog/icons/page.png + app/assets/images/refinery/blog/icons/page_add.png + app/assets/images/refinery/blog/icons/page_copy.png + app/assets/images/refinery/blog/icons/up.gif + app/assets/images/refinery/blog/rss-feed.png + app/assets/images/refinerycms-blog + app/assets/javascripts + app/assets/javascripts/refinery + app/assets/javascripts/refinery/blog + app/assets/javascripts/refinery/blog/backend.js + app/assets/javascripts/refinery/blog/frontend.js + app/assets/javascripts/refinerycms-blog + app/assets/stylesheets + app/assets/stylesheets/refinery + app/assets/stylesheets/refinery/blog + app/assets/stylesheets/refinery/blog/backend.css.scss + app/assets/stylesheets/refinery/blog/frontend.css.scss + app/assets/stylesheets/refinery/blog/ui-lightness + app/assets/stylesheets/refinery/blog/ui-lightness/images + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_flat_10_000000_40x100.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_222222_256x240.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_228ef1_256x240.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ef8c08_256x240.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffd27a_256x240.png + app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffffff_256x240.png + app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss + app/assets/stylesheets/refinerycms-blog app/controllers - app/controllers/admin - app/controllers/admin/blog - app/controllers/admin/blog/categories_controller.rb - app/controllers/admin/blog/comments_controller.rb - app/controllers/admin/blog/posts_controller.rb - app/controllers/admin/blog/settings_controller.rb - app/controllers/blog - app/controllers/blog/categories_controller.rb - app/controllers/blog/posts_controller.rb - app/controllers/blog_controller.rb + app/controllers/refinery + app/controllers/refinery/admin + app/controllers/refinery/admin/blog + app/controllers/refinery/admin/blog/categories_controller.rb + app/controllers/refinery/admin/blog/comments_controller.rb + app/controllers/refinery/admin/blog/posts_controller.rb + app/controllers/refinery/admin/blog/settings_controller.rb + app/controllers/refinery/blog + app/controllers/refinery/blog/base_controller.rb + app/controllers/refinery/blog/categories_controller.rb + app/controllers/refinery/blog/posts_controller.rb app/helpers - app/helpers/blog_posts_helper.rb + app/helpers/refinery + app/helpers/refinery/blog + app/helpers/refinery/blog/controller_helper.rb + app/helpers/refinery/blog_posts_helper.rb app/mailers - app/mailers/blog - app/mailers/blog/comment_mailer.rb + app/mailers/refinery + app/mailers/refinery/blog + app/mailers/refinery/blog/comment_mailer.rb app/models - app/models/blog - app/models/blog/comment_mailer.rb - app/models/blog_category.rb - app/models/blog_comment.rb - app/models/blog_post.rb - app/models/categorization.rb + app/models/refinery + app/models/refinery/blog + app/models/refinery/blog/comment_mailer.rb + app/models/refinery/blog_category.rb + app/models/refinery/blog_comment.rb + app/models/refinery/blog_post.rb + app/models/refinery/categorization.rb + app/sweepers + app/sweepers/refinery + app/sweepers/refinery/blog_sweeper.rb app/views - app/views/admin - app/views/admin/blog - app/views/admin/blog/_submenu.html.erb - app/views/admin/blog/categories - app/views/admin/blog/categories/_category.html.erb - app/views/admin/blog/categories/_form.html.erb - app/views/admin/blog/categories/_sortable_list.html.erb - app/views/admin/blog/categories/edit.html.erb - app/views/admin/blog/categories/index.html.erb - app/views/admin/blog/categories/new.html.erb - app/views/admin/blog/comments - app/views/admin/blog/comments/_comment.html.erb - app/views/admin/blog/comments/_sortable_list.html.erb - app/views/admin/blog/comments/index.html.erb - app/views/admin/blog/comments/show.html.erb - app/views/admin/blog/posts - app/views/admin/blog/posts/_form.css.erb - app/views/admin/blog/posts/_form.html.erb - app/views/admin/blog/posts/_form.js.erb - app/views/admin/blog/posts/_form_part.html.erb - app/views/admin/blog/posts/_post.html.erb - app/views/admin/blog/posts/_sortable_list.html.erb - app/views/admin/blog/posts/_teaser_part.html.erb - app/views/admin/blog/posts/edit.html.erb - app/views/admin/blog/posts/index.html.erb - app/views/admin/blog/posts/new.html.erb - app/views/admin/blog/posts/uncategorized.html.erb - app/views/admin/blog/settings - app/views/admin/blog/settings/notification_recipients.html.erb - app/views/blog - app/views/blog/categories - app/views/blog/categories/show.html.erb - app/views/blog/comment_mailer - app/views/blog/comment_mailer/notification.html.erb - app/views/blog/posts - app/views/blog/posts/_comment.html.erb - app/views/blog/posts/_nav.html.erb - app/views/blog/posts/_post.html.erb - app/views/blog/posts/archive.html.erb - app/views/blog/posts/index.html.erb - app/views/blog/posts/index.rss.builder - app/views/blog/posts/show.html.erb - app/views/blog/posts/tagged.html.erb - app/views/blog/shared - app/views/blog/shared/_categories.html.erb - app/views/blog/shared/_post.html.erb - app/views/blog/shared/_posts.html.erb - app/views/blog/shared/_rss_feed.html.erb - app/views/blog/shared/_tags.html.erb - app/views/shared - app/views/shared/admin - app/views/shared/admin/_autocomplete.html.erb + app/views/refinery + app/views/refinery/admin + app/views/refinery/admin/blog + app/views/refinery/admin/blog/_submenu.html.erb + app/views/refinery/admin/blog/categories + app/views/refinery/admin/blog/categories/_category.html.erb + app/views/refinery/admin/blog/categories/_form.html.erb + app/views/refinery/admin/blog/categories/_sortable_list.html.erb + app/views/refinery/admin/blog/categories/edit.html.erb + app/views/refinery/admin/blog/categories/index.html.erb + app/views/refinery/admin/blog/categories/new.html.erb + app/views/refinery/admin/blog/comments + app/views/refinery/admin/blog/comments/_comment.html.erb + app/views/refinery/admin/blog/comments/_sortable_list.html.erb + app/views/refinery/admin/blog/comments/index.html.erb + app/views/refinery/admin/blog/comments/show.html.erb + app/views/refinery/admin/blog/posts + app/views/refinery/admin/blog/posts/_form.html.erb + app/views/refinery/admin/blog/posts/_form_part.html.erb + app/views/refinery/admin/blog/posts/_post.html.erb + app/views/refinery/admin/blog/posts/_sortable_list.html.erb + app/views/refinery/admin/blog/posts/_teaser_part.html.erb + app/views/refinery/admin/blog/posts/edit.html.erb + app/views/refinery/admin/blog/posts/index.html.erb + app/views/refinery/admin/blog/posts/new.html.erb + app/views/refinery/admin/blog/posts/uncategorized.html.erb + app/views/refinery/admin/blog/settings + app/views/refinery/admin/blog/settings/notification_recipients.html.erb + app/views/refinery/blog + app/views/refinery/blog/categories + app/views/refinery/blog/categories/show.html.erb + app/views/refinery/blog/comment_mailer + app/views/refinery/blog/comment_mailer/notification.html.erb + app/views/refinery/blog/posts + app/views/refinery/blog/posts/_comment.html.erb + app/views/refinery/blog/posts/_comments.html.erb + app/views/refinery/blog/posts/_nav.html.erb + app/views/refinery/blog/posts/_post.html.erb + app/views/refinery/blog/posts/archive.html.erb + app/views/refinery/blog/posts/index.html.erb + app/views/refinery/blog/posts/index.rss.builder + app/views/refinery/blog/posts/show.html.erb + app/views/refinery/blog/posts/tagged.html.erb + app/views/refinery/blog/shared + app/views/refinery/blog/shared/_body_content_right.html.erb + app/views/refinery/blog/shared/_categories.html.erb + app/views/refinery/blog/shared/_post.html.erb + app/views/refinery/blog/shared/_posts.html.erb + app/views/refinery/blog/shared/_rss_feed.html.erb + app/views/refinery/blog/shared/_tags.html.erb + app/views/refinery/blog/widgets + app/views/refinery/blog/widgets/_blog_archive.html.erb + app/views/refinery/shared + app/views/refinery/shared/admin + app/views/refinery/shared/admin/_autocomplete.html.erb changelog.md config config/locales + config/locales/bg.yml config/locales/cs.yml config/locales/de.yml config/locales/en.yml config/locales/es.yml config/locales/fr.yml config/locales/it.yml + config/locales/ja.yml config/locales/nb.yml config/locales/nl.yml config/locales/pl.yml @@ -115,88 +182,61 @@ Gem::Specification.new do |s| config/routes.rb db db/migrate - db/migrate/1_create_blog_structure.rb - db/migrate/2_add_user_id_to_blog_posts.rb - db/migrate/3_acts_as_taggable_on_migration.rb - db/migrate/4_create_seo_meta_for_blog.rb - db/migrate/5_add_cached_slugs.rb - db/migrate/6_add_custom_url_field_to_blog_posts.rb - db/migrate/7_add_custom_teaser_field_to_blog_posts.rb - db/seeds - db/seeds/refinerycms_blog.rb - features - features/authors.feature - features/category.feature - features/support - features/support/factories - features/support/factories/blog_categories.rb - features/support/factories/blog_comments.rb - features/support/factories/blog_posts.rb - features/support/paths.rb - features/support/step_definitions - features/support/step_definitions/authors_steps.rb - features/support/step_definitions/category_steps.rb - features/support/step_definitions/tags_steps.rb - features/tags.feature + db/migrate/20110803223522_create_blog_structure.rb + db/migrate/20110803223523_add_user_id_to_blog_posts.rb + db/migrate/20110803223524_acts_as_taggable_on_migration.rb + db/migrate/20110803223526_add_cached_slugs.rb + db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb + db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb + db/migrate/20110803223529_add_primary_key_to_categorizations.rb + db/seeds.rb + Gemfile + Guardfile lib lib/gemspec.rb lib/generators - lib/generators/refinerycms_blog_generator.rb + lib/generators/refinery + lib/generators/refinery/blog + lib/generators/refinery/blog/blog_generator.rb lib/refinery lib/refinery/blog + lib/refinery/blog/engine.rb lib/refinery/blog/tabs.rb lib/refinery/blog/version.rb + lib/refinery/blog.rb lib/refinerycms-blog.rb - public - public/images - public/images/refinerycms-blog - public/images/refinerycms-blog/icons - public/images/refinerycms-blog/icons/cog.png - public/images/refinerycms-blog/icons/comment.png - public/images/refinerycms-blog/icons/comment_cross.png - public/images/refinerycms-blog/icons/comment_tick.png - public/images/refinerycms-blog/icons/comments.png - public/images/refinerycms-blog/icons/down.gif - public/images/refinerycms-blog/icons/folder.png - public/images/refinerycms-blog/icons/folder_add.png - public/images/refinerycms-blog/icons/folder_edit.png - public/images/refinerycms-blog/icons/page.png - public/images/refinerycms-blog/icons/page_add.png - public/images/refinerycms-blog/icons/page_copy.png - public/images/refinerycms-blog/icons/up.gif - public/images/refinerycms-blog/rss-feed.png - public/javascripts - public/javascripts/refinery - public/javascripts/refinery/refinerycms-blog.js - public/javascripts/refinerycms-blog.js - public/stylesheets - public/stylesheets/refinery - public/stylesheets/refinery/refinerycms-blog.css - public/stylesheets/refinerycms-blog.css - public/stylesheets/ui-lightness - public/stylesheets/ui-lightness/images - public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png - public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png - public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png - public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png - public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png - public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png - public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png - public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png - public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png - public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png - public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png - public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png - public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png - public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png - public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css + Rakefile readme.md refinerycms-blog.gemspec + script + script/rails spec + spec/factories + spec/factories/blog_categories.rb + spec/factories/blog_comments.rb + spec/factories/blog_posts.rb spec/models - spec/models/blog_category_spec.rb - spec/models/blog_comment_spec.rb - spec/models/blog_post_spec.rb + spec/models/refinery + spec/models/refinery/blog_category_spec.rb + spec/models/refinery/blog_comment_spec.rb + spec/models/refinery/blog_post_spec.rb + spec/rcov.opts + spec/requests + spec/requests/refinery + spec/requests/refinery/admin + spec/requests/refinery/admin/blog + spec/requests/refinery/admin/blog/comments_spec.rb + spec/requests/refinery/admin/blog/posts_spec.rb + spec/requests/refinery/blog + spec/requests/refinery/blog/categories_spec.rb + spec/requests/refinery/blog/posts_spec.rb + spec/spec_helper.rb + spec/support + spec/support/database_cleaner.rb + spec/support/devise.rb + spec/support/refinery.rb + tasks + tasks/rspec.rake + todo.md ) - end diff --git a/script/rails b/script/rails new file mode 100755 index 0000000..4309856 --- /dev/null +++ b/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +ENGINE_PATH = File.expand_path('../..', __FILE__) +load File.expand_path('../../spec/dummy/script/rails', __FILE__) diff --git a/spec/factories/blog_categories.rb b/spec/factories/blog_categories.rb new file mode 100644 index 0000000..82f629b --- /dev/null +++ b/spec/factories/blog_categories.rb @@ -0,0 +1,5 @@ +FactoryGirl.define do + factory :blog_category, :class => Refinery::Blog::Category do + sequence(:title) { |n| "Shopping #{n}" } + end +end diff --git a/spec/factories/blog_comments.rb b/spec/factories/blog_comments.rb new file mode 100644 index 0000000..e0309b2 --- /dev/null +++ b/spec/factories/blog_comments.rb @@ -0,0 +1,19 @@ +FactoryGirl.define do + factory :blog_comment, :class => Refinery::Blog::Comment do + name "Joe Commenter" + sequence(:email) { |n| "person#{n}@example.com" } + body "Which one is the best for picking up new shoes?" + association :post, :factory => :blog_post + + trait :approved do + state 'approved' + end + + trait :rejected do + state 'rejected' + end + + factory :approved_comment, :traits => [:approved] + factory :rejected_comment, :traits => [:rejected] + end +end diff --git a/spec/factories/blog_posts.rb b/spec/factories/blog_posts.rb new file mode 100644 index 0000000..1ad2bd2 --- /dev/null +++ b/spec/factories/blog_posts.rb @@ -0,0 +1,13 @@ +FactoryGirl.define do + factory :blog_post, :class => Refinery::Blog::Post do + sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" } + body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it." + draft false + tag_list "chicago, shopping, fun times" + published_at Time.now + + factory :blog_post_draft do + draft true + end + end +end diff --git a/spec/models/blog_category_spec.rb b/spec/models/blog_category_spec.rb deleted file mode 100644 index 7792744..0000000 --- a/spec/models/blog_category_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'spec_helper' -Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory} - -describe BlogCategory do - before(:each) do - @blog_category = Factory.create(:blog_category) - end - - describe "validations" do - it "requires title" do - Factory.build(:blog_category, :title => "").should_not be_valid - end - - it "won't allow duplicate titles" do - Factory.build(:blog_category, :title => @blog_category.title).should_not be_valid - end - end - - describe "blog posts association" do - it "has a posts attribute" do - @blog_category.should respond_to(:posts) - end - - it "returns posts by published_at date in descending order" do - first_post = @blog_category.posts.create!({ :title => "Breaking News: Joe Sak is hot stuff you guys!!", :body => "True story.", :published_at => Time.now.yesterday }) - latest_post = @blog_category.posts.create!({ :title => "parndt is p. okay", :body => "For a Kiwi.", :published_at => Time.now }) - - @blog_category.posts.first.should == latest_post - end - - end - - describe "#post_count" do - it "returns post count in category" do - 2.times do - @blog_category.posts << Factory.create(:blog_post) - end - @blog_category.post_count.should == 2 - end - end -end diff --git a/spec/models/blog_comment_spec.rb b/spec/models/blog_comment_spec.rb deleted file mode 100644 index feb2860..0000000 --- a/spec/models/blog_comment_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'spec_helper' -Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory} - -describe BlogComment do - - context "wiring up" do - - before(:each) do - @comment = Factory.create(:blog_comment) - end - - it "saves" do - @comment.should_not be_nil - end - - it "has a blog post" do - @comment.post.should_not be_nil - end - - end -end diff --git a/spec/models/blog_post_spec.rb b/spec/models/blog_post_spec.rb deleted file mode 100644 index afe82cc..0000000 --- a/spec/models/blog_post_spec.rb +++ /dev/null @@ -1,217 +0,0 @@ -require 'spec_helper' -Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory} - -describe BlogPost do - let(:blog_post ) { Factory.create(:blog_post) } - - describe "validations" do - it "requires title" do - Factory.build(:blog_post, :title => "").should_not be_valid - end - - it "won't allow duplicate titles" do - Factory.build(:blog_post, :title => blog_post.title).should_not be_valid - end - - it "requires body" do - Factory.build(:blog_post, :body => nil).should_not be_valid - end - end - - describe "comments association" do - - it "have a comments attribute" do - blog_post.should respond_to(:comments) - end - - it "destroys associated comments" do - Factory.create(:blog_comment, :blog_post_id => blog_post.id) - blog_post.destroy - BlogComment.find_by_blog_post_id(blog_post.id).should == nil - end - end - - describe "categories association" do - it "have categories attribute" do - blog_post.should respond_to(:categories) - end - end - - describe "tags" do - it "acts as taggable" do - blog_post.should respond_to(:tag_list) - - #the factory has default tags, including 'chicago' - blog_post.tag_list.should include("chicago") - end - end - - describe "authors" do - it "are authored" do - BlogPost.instance_methods.map(&:to_sym).should include(:author) - end - end - - describe "by_archive scope" do - before do - @blog_post1 = Factory.create(:blog_post, :published_at => Date.new(2011, 3, 11)) - @blog_post2 = Factory.create(:blog_post, :published_at => Date.new(2011, 3, 12)) - - #2 months before - Factory.create(:blog_post, :published_at => Date.new(2011, 1, 10)) - end - - it "returns all posts from specified month" do - #check for this month - date = "03/2011" - BlogPost.by_archive(Time.parse(date)).count.should be == 2 - BlogPost.by_archive(Time.parse(date)).should == [@blog_post2, @blog_post1] - end - end - - describe "all_previous scope" do - before do - @blog_post1 = Factory.create(:blog_post, :published_at => Time.now - 2.months) - @blog_post2 = Factory.create(:blog_post, :published_at => Time.now - 1.month) - Factory.create(:blog_post, :published_at => Time.now) - end - - it "returns all posts from previous months" do - BlogPost.all_previous.count.should be == 2 - BlogPost.all_previous.should == [@blog_post2, @blog_post1] - end - end - - describe "live scope" do - before do - @blog_post1 = Factory.create(:blog_post, :published_at => Time.now.advance(:minutes => -2)) - @blog_post2 = Factory.create(:blog_post, :published_at => Time.now.advance(:minutes => -1)) - Factory.create(:blog_post, :draft => true) - Factory.create(:blog_post, :published_at => Time.now + 1.minute) - end - - it "returns all posts which aren't in draft and pub date isn't in future" do - BlogPost.live.count.should be == 2 - BlogPost.live.should == [@blog_post2, @blog_post1] - end - end - - describe "uncategorized scope" do - before do - @uncategorized_blog_post = Factory.create(:blog_post) - @categorized_blog_post = Factory.create(:blog_post) - - @categorized_blog_post.categories << Factory.create(:blog_category) - end - - it "returns uncategorized posts if they exist" do - BlogPost.uncategorized.should include @uncategorized_blog_post - BlogPost.uncategorized.should_not include @categorized_blog_post - end - end - - describe "#live?" do - it "returns true if post is not in draft and it's published" do - Factory.create(:blog_post).live?.should be_true - end - - it "returns false if post is in draft" do - Factory.create(:blog_post, :draft => true).live?.should be_false - end - - it "returns false if post pub date is in future" do - Factory.create(:blog_post, :published_at => Time.now.advance(:minutes => 1)).live?.should be_false - end - end - - describe "#next" do - before do - Factory.create(:blog_post, :published_at => Time.now.advance(:minutes => -1)) - @blog_post = Factory.create(:blog_post) - end - - it "returns next article when called on current article" do - BlogPost.last.next.should == @blog_post - end - end - - describe "#prev" do - before do - Factory.create(:blog_post) - @blog_post = Factory.create(:blog_post, :published_at => Time.now.advance(:minutes => -1)) - end - - it "returns previous article when called on current article" do - BlogPost.first.prev.should == @blog_post - end - end - - describe "#category_ids=" do - before do - @cat1 = Factory.create(:blog_category, :id => 1) - @cat2 = Factory.create(:blog_category, :id => 2) - @cat3 = Factory.create(:blog_category, :id => 3) - blog_post.category_ids = [1,2,"","",3] - end - - it "rejects blank category ids" do - blog_post.categories.count.should == 3 - end - - it "returns array of categories based on given ids" do - blog_post.categories.should == [@cat1, @cat2, @cat3] - end - end - - describe ".comments_allowed?" do - context "with RefinerySetting comments_allowed set to true" do - before do - RefinerySetting.set(:comments_allowed, { :scoping => 'blog', :value => true }) - end - - it "should be true" do - BlogPost.comments_allowed?.should be_true - end - end - - context "with RefinerySetting comments_allowed set to false" do - before do - RefinerySetting.set(:comments_allowed, { :scoping => 'blog', :value => false }) - end - - it "should be false" do - BlogPost.comments_allowed?.should be_false - end - end - end - - describe "custom teasers" do - it "should allow a custom teaser" do - Factory.create(:blog_post, :custom_teaser => 'This is some custom content').should be_valid - end - end - - describe ".teasers_enabled?" do - context "with RefinerySetting teasers_enabled set to true" do - before do - RefinerySetting.set(:teasers_enabled, { :scoping => 'blog', :value => true }) - end - - it "should be true" do - BlogPost.teasers_enabled?.should be_true - end - end - - context "with RefinerySetting teasers_enabled set to false" do - before do - RefinerySetting.set(:teasers_enabled, { :scoping => 'blog', :value => false }) - end - - it "should be false" do - BlogPost.teasers_enabled?.should be_false - end - end - - end - -end diff --git a/spec/models/refinery/blog/category_spec.rb b/spec/models/refinery/blog/category_spec.rb new file mode 100644 index 0000000..9c4a7d3 --- /dev/null +++ b/spec/models/refinery/blog/category_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +module Refinery + module Blog + describe Category do + let(:category) { FactoryGirl.create(:blog_category) } + + describe "validations" do + it "requires title" do + FactoryGirl.build(:blog_category, :title => "").should_not be_valid + end + + it "won't allow duplicate titles" do + FactoryGirl.build(:blog_category, :title => category.title).should_not be_valid + end + end + + describe "blog posts association" do + it "has a posts attribute" do + category.should respond_to(:posts) + end + + it "returns posts by published_at date in descending order" do + first_post = category.posts.create!({ :title => "Breaking News: Joe Sak is hot stuff you guys!!", :body => "True story.", :published_at => Time.now.yesterday }) + latest_post = category.posts.create!({ :title => "parndt is p. okay", :body => "For a Kiwi.", :published_at => Time.now }) + + category.posts.first.should == latest_post + end + + end + + describe "#post_count" do + it "returns post count in category" do + 2.times do + category.posts << FactoryGirl.create(:blog_post) + end + category.post_count.should == 2 + end + end + end + end +end
\ No newline at end of file diff --git a/spec/models/refinery/blog/comment_spec.rb b/spec/models/refinery/blog/comment_spec.rb new file mode 100644 index 0000000..3a77100 --- /dev/null +++ b/spec/models/refinery/blog/comment_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +module Refinery + module Blog + describe Comment do + context "wiring up" do + let(:comment) { FactoryGirl.create(:blog_comment) } + + it "saves" do + comment.should_not be_nil + end + + it "has a blog post" do + comment.post.should_not be_nil + end + end + end + end +end diff --git a/spec/models/refinery/blog/post_spec.rb b/spec/models/refinery/blog/post_spec.rb new file mode 100644 index 0000000..7167728 --- /dev/null +++ b/spec/models/refinery/blog/post_spec.rb @@ -0,0 +1,220 @@ +require 'spec_helper' + +module Refinery + module Blog + describe Post do + let(:post) { FactoryGirl.create(:blog_post) } + + describe "validations" do + it "requires title" do + FactoryGirl.build(:blog_post, :title => "").should_not be_valid + end + + it "won't allow duplicate titles" do + FactoryGirl.build(:blog_post, :title => post.title).should_not be_valid + end + + it "requires body" do + FactoryGirl.build(:blog_post, :body => nil).should_not be_valid + end + end + + describe "comments association" do + + it "have a comments attribute" do + post.should respond_to(:comments) + end + + it "destroys associated comments" do + FactoryGirl.create(:blog_comment, :blog_post_id => post.id) + post.destroy + Blog::Comment.where(:blog_post_id => post.id).should be_empty + end + end + + describe "categories association" do + it "have categories attribute" do + post.should respond_to(:categories) + end + end + + describe "tags" do + it "acts as taggable" do + post.should respond_to(:tag_list) + + #the factory has default tags, including 'chicago' + post.tag_list.should include("chicago") + end + end + + describe "authors" do + it "are authored" do + subject.class.instance_methods.map(&:to_sym).should include(:author) + end + end + + describe "by_archive scope" do + before do + @blog_post1 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 11)) + @blog_post2 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 12)) + + #2 months before + FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 1, 10)) + end + + it "returns all posts from specified month" do + #check for this month + date = "03/2011" + subject.class.by_archive(Time.parse(date)).count.should be == 2 + subject.class.by_archive(Time.parse(date)).should == [@blog_post2, @blog_post1] + end + end + + describe "all_previous scope" do + before do + @blog_post1 = FactoryGirl.create(:blog_post, :published_at => Time.now - 2.months) + @blog_post2 = FactoryGirl.create(:blog_post, :published_at => Time.now - 1.month) + FactoryGirl.create(:blog_post, :published_at => Time.now) + end + + it "returns all posts from previous months" do + subject.class.all_previous.count.should be == 2 + subject.class.all_previous.should == [@blog_post2, @blog_post1] + end + end + + describe "live scope" do + before do + @blog_post1 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -2)) + @blog_post2 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1)) + FactoryGirl.create(:blog_post, :draft => true) + FactoryGirl.create(:blog_post, :published_at => Time.now + 1.minute) + end + + it "returns all posts which aren't in draft and pub date isn't in future" do + subject.class.live.count.should be == 2 + subject.class.live.should == [@blog_post2, @blog_post1] + end + end + + describe "uncategorized scope" do + before do + @uncategorized_post = FactoryGirl.create(:blog_post) + @categorized_post = FactoryGirl.create(:blog_post) + + @categorized_post.categories << FactoryGirl.create(:blog_category) + end + + it "returns uncategorized posts if they exist" do + subject.class.uncategorized.should include @uncategorized_post + subject.class.uncategorized.should_not include @categorized_post + end + end + + describe "#live?" do + it "returns true if post is not in draft and it's published" do + FactoryGirl.create(:blog_post).live?.should be_true + end + + it "returns false if post is in draft" do + FactoryGirl.create(:blog_post, :draft => true).live?.should be_false + end + + it "returns false if post pub date is in future" do + FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => 1)).live?.should be_false + end + end + + describe "#next" do + before do + FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1)) + @blog_post = FactoryGirl.create(:blog_post) + end + + it "returns next article when called on current article" do + subject.class.last.next.should == @blog_post + end + end + + describe "#prev" do + before do + FactoryGirl.create(:blog_post) + @blog_post = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1)) + end + + it "returns previous article when called on current article" do + subject.class.first.prev.should == @blog_post + end + end + + describe "#category_ids=" do + before do + @cat1 = FactoryGirl.create(:blog_category, :id => 1) + @cat2 = FactoryGirl.create(:blog_category, :id => 2) + @cat3 = FactoryGirl.create(:blog_category, :id => 3) + post.category_ids = [1,2,"","",3] + end + + it "rejects blank category ids" do + post.categories.count.should == 3 + end + + it "returns array of categories based on given ids" do + post.categories.should == [@cat1, @cat2, @cat3] + end + end + + describe ".comments_allowed?" do + context "with Refinery::Setting comments_allowed set to true" do + before do + Refinery::Setting.set(:comments_allowed, { :scoping => 'blog', :value => true }) + end + + it "should be true" do + subject.class.comments_allowed?.should be_true + end + end + + context "with Refinery::Setting comments_allowed set to false" do + before do + Refinery::Setting.set(:comments_allowed, { :scoping => 'blog', :value => false }) + end + + it "should be false" do + subject.class.comments_allowed?.should be_false + end + end + end + + describe "custom teasers" do + it "should allow a custom teaser" do + FactoryGirl.create(:blog_post, :custom_teaser => 'This is some custom content').should be_valid + end + end + + describe ".teasers_enabled?" do + context "with Refinery::Setting teasers_enabled set to true" do + before do + Refinery::Setting.set(:teasers_enabled, { :scoping => 'blog', :value => true }) + end + + it "should be true" do + subject.class.teasers_enabled?.should be_true + end + end + + context "with Refinery::Setting teasers_enabled set to false" do + before do + Refinery::Setting.set(:teasers_enabled, { :scoping => 'blog', :value => false }) + end + + it "should be false" do + subject.class.teasers_enabled?.should be_false + end + end + + end + + end + end +end
\ No newline at end of file diff --git a/spec/rcov.opts b/spec/rcov.opts new file mode 100644 index 0000000..274ed51 --- /dev/null +++ b/spec/rcov.opts @@ -0,0 +1,2 @@ +--exclude "spec/*,gems/*" +--rails
\ No newline at end of file diff --git a/spec/requests/refinery/admin/blog/comments_spec.rb b/spec/requests/refinery/admin/blog/comments_spec.rb new file mode 100644 index 0000000..a7367e3 --- /dev/null +++ b/spec/requests/refinery/admin/blog/comments_spec.rb @@ -0,0 +1,124 @@ +require "spec_helper" + +module Refinery + describe "AdminBlog::Comments" do + login_refinery_user + + describe "#index" do + context "when has no new unapproved comments" do + before(:each) do + Blog::Comment.delete_all + visit refinery_admin_blog_comments_path + end + + it "should list no comments" do + visit refinery_admin_blog_comments_path + + page.should have_content('there are no new comments') + end + end + + context "when has new unapproved comments" do + let!(:blog_comment) { FactoryGirl.create(:blog_comment) } + before(:each) { visit refinery_admin_blog_comments_path } + + it "should list comments" do + page.should have_content(blog_comment.body) + page.should have_content(blog_comment.name) + end + + it "should allow me to approve a comment" do + click_link "Approve this comment" + + page.should have_content("has been approved") + end + + it "should allow me to reject a comment" do + click_link "Reject this comment" + + page.should have_content("has been rejected") + end + end + end + + describe "#approved" do + context "when has no approved comments" do + before(:each) do + Blog::Comment.delete_all + visit approved_refinery_admin_blog_comments_path + end + + it "should list no comments" do + page.should have_content('there are no approved comments') + end + end + + context "when has approved comments" do + let!(:blog_comment) do + FactoryGirl.create(:blog_comment, + :state => 'approved') + end + before(:each) { visit approved_refinery_admin_blog_comments_path } + + it "should list comments" do + page.should have_content(blog_comment.body) + page.should have_content(blog_comment.name) + end + + it "should allow me to reject a comment" do + click_link "Reject this comment" + + page.should have_content("has been rejected") + end + end + end + + describe "#rejected" do + context "when has no rejected comments" do + before(:each) do + Blog::Comment.delete_all + visit rejected_refinery_admin_blog_comments_path + end + + it "should list no comments" do + page.should have_content('there are no rejected comments') + end + end + + context "when has rejected comments" do + let!(:blog_comment) do + FactoryGirl.create(:blog_comment, + :state => 'rejected') + end + before(:each) { visit rejected_refinery_admin_blog_comments_path } + + it "should list comments" do + page.should have_content(blog_comment.body) + page.should have_content(blog_comment.name) + end + + it "should allow me to approve a comment" do + click_link "Approve this comment" + + page.should have_content("has been approved") + end + end + end + + describe "#show" do + let!(:blog_comment) { FactoryGirl.create(:blog_comment) } + before(:each) { visit refinery_admin_blog_comment_path(blog_comment) } + + it "should display the comment" do + page.should have_content(blog_comment.body) + page.should have_content(blog_comment.name) + end + + it "should allow me to approve the comment" do + click_link "Approve this comment" + + page.should have_content("has been approved") + end + end + end +end diff --git a/spec/requests/refinery/admin/blog/posts_spec.rb b/spec/requests/refinery/admin/blog/posts_spec.rb new file mode 100644 index 0000000..08fbab9 --- /dev/null +++ b/spec/requests/refinery/admin/blog/posts_spec.rb @@ -0,0 +1,143 @@ +require "spec_helper" + +module Refinery + describe "AdminBlog::Posts" do + login_refinery_user + + let!(:blog_category) { FactoryGirl.create(:blog_category, :title => "Video Games") } + + context "when no blog posts" do + before(:each) { Refinery::Blog::Post.destroy_all } + + describe "blog post listing" do + before(:each) { visit refinery_admin_blog_posts_path } + + it "invites to create new post" do + page.should have_content("There are no Blog Posts yet. Click \"Create new post\" to add your first blog post.") + end + end + + describe "new blog post form" do + before(:each) do + visit refinery_admin_blog_posts_path + click_link "Create new post" + end + + it "should have Tags" do + page.should have_content("Tags") + end + + it "should have Video Games" do + page.should have_content(blog_category.title) + end + + describe "create blog post" do + before(:each) do + fill_in "Title", :with => "This is my blog post" + fill_in "blog_post_body", :with => "And I love it" + check blog_category.title + click_button "Save" + end + + it "should succeed" do + page.should have_content("was successfully added.") + end + + it "should be the only blog post" do + ::Refinery::Blog::Post.all.size.should eq(1) + end + + it "should belong to me" do + ::Refinery::Blog::Post.first.author.login.should eq(::Refinery::User.last.login) + end + + it "should save categories" do + ::Refinery::Blog::Post.last.categories.count.should eq(1) + ::Refinery::Blog::Post.last.categories.first.title.should eq(blog_category.title) + end + end + + describe "create blog post with tags" do + before(:each) do + @tag_list = "chicago, bikes, beers, babes" + fill_in "Title", :with => "This is a tagged blog post" + fill_in "blog_post_body", :with => "And I also love it" + fill_in "Tags", :with => @tag_list + click_button "Save" + end + + it "should succeed" do + page.should have_content("was successfully added.") + end + + it "should be the only blog post" do + ::Refinery::Blog::Post.all.size.should eq(1) + end + + it "should have the specified tags" do + ::Refinery::Blog::Post.last.tag_list.should eq(@tag_list.split(', ')) + end + end + end + end + + context "when has blog posts" do + let!(:blog_post) { FactoryGirl.create(:blog_post) } + + describe "blog post listing" do + before(:each) { visit refinery_admin_blog_posts_path } + + describe "edit blog post" do + it "should succeed" do + page.should have_content(blog_post.title) + + click_link("Edit this blog post") + current_path.should == edit_refinery_admin_blog_post_path(blog_post) + + fill_in "Title", :with => "hax0r" + click_button "Save" + + page.should_not have_content(blog_post.title) + page.should have_content("'hax0r' was successfully updated.") + end + end + + describe "deleting blog post" do + it "should succeed" do + page.should have_content(blog_post.title) + + click_link "Remove this blog post forever" + + page.should have_content("'#{blog_post.title}' was successfully removed.") + end + end + + describe "view live" do + it "redirects to blog post in the frontend" do + click_link "View this blog post live" + + current_path.should == blog_post_path(blog_post) + page.should have_content(blog_post.title) + end + end + end + + context "when uncategorized post" do + it "shows up in the list" do + visit uncategorized_refinery_admin_blog_posts_path + page.should have_content(blog_post.title) + end + end + + context "when categorized post" do + it "won't show up in the list" do + blog_post.categories << blog_category + blog_post.save! + + visit uncategorized_refinery_admin_blog_posts_path + page.should_not have_content(blog_post.title) + end + end + end + end +end diff --git a/spec/requests/refinery/blog/categories_spec.rb b/spec/requests/refinery/blog/categories_spec.rb new file mode 100644 index 0000000..48a3417 --- /dev/null +++ b/spec/requests/refinery/blog/categories_spec.rb @@ -0,0 +1,25 @@ +require "spec_helper" + +module Refinery + describe "BlogCategories" do + login_refinery_user + + context "has one category and post" do + before(:each) do + @blog_post = FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post") + @blog_category = FactoryGirl.create(:blog_category, :title => "Video Games") + @blog_post.categories << @blog_category + @blog_post.save! + end + + describe "show categories blog posts" do + before(:each) { visit blog_category_path(@blog_category) } + + it "should displays categories blog posts" do + page.should have_content("Refinery CMS blog post") + page.should have_content("Video Games") + end + end + end + end +end diff --git a/spec/requests/refinery/blog/posts_spec.rb b/spec/requests/refinery/blog/posts_spec.rb new file mode 100644 index 0000000..f2c94b0 --- /dev/null +++ b/spec/requests/refinery/blog/posts_spec.rb @@ -0,0 +1,109 @@ +require "spec_helper" + +module Refinery + describe "Blog::Posts" do + login_refinery_user + + context "when has blog posts" do + let!(:blog_post) { FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post") } + + it "should display blog post" do + visit blog_post_path(blog_post) + + page.should have_content(blog_post.title) + end + + it "should display the blog rss feed" do + get blog_rss_feed_path + + response.should be_success + response.content_type.should eq("application/rss+xml") + end + end + + describe "list tagged posts" do + context "when has tagged blog posts" do + before(:each) do + @tag_name = "chicago" + @blog_post = FactoryGirl.create(:blog_post, + :title => "I Love my city", + :tag_list => @tag_name) + @tag = ::Refinery::Blog::Post.tag_counts_on(:tags).first + end + + it "should have one tagged post" do + visit tagged_posts_path(@tag.id, @tag_name.parameterize) + + page.should have_content(@tag_name) + page.should have_content(@blog_post.title) + end + end + end + + describe "#show" do + context "when has no comments" do + let(:blog_post) { FactoryGirl.create(:blog_post) } + + it "should display the blog post" do + visit blog_post_path(blog_post) + + page.should have_content(blog_post.title) + page.should have_content(blog_post.body) + end + end + + context "when has approved comments" do + let(:approved_comment) { FactoryGirl.create(:approved_comment) } + + it "should display the comments" do + visit blog_post_path(approved_comment.post) + + page.should have_content(approved_comment.body) + page.should have_content("Posted by #{approved_comment.name}") + end + end + + context "when has rejected comments" do + let(:rejected_comment) { FactoryGirl.create(:rejected_comment) } + + it "should not display the comments" do + visit blog_post_path(rejected_comment.post) + + page.should_not have_content(rejected_comment.body) + end + end + + context "when has new comments" do + let(:blog_comment) { FactoryGirl.create(:blog_comment) } + + it "should not display the comments" do + visit blog_post_path(blog_comment.post) + + page.should_not have_content(blog_comment.body) + end + end + end + + describe "#show draft preview" do + let(:blog_post) { FactoryGirl.create(:blog_post_draft) } + + context "when logged in as admin" do + it "should display the draft notification" do + visit blog_post_path(blog_post) + + page.should have_content('This page is NOT live for public viewing.') + end + end + + context "when not logged in as an admin" do + before(:each) { visit destroy_refinery_user_session_path } + + it "should not display the blog post" do + visit blog_post_path(blog_post) + + page.should have_content("The page you were looking for doesn't exist (404)") + end + end + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..ea550e2 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,38 @@ +require 'rubygems' + +def load_all(*patterns) + patterns.each { |pattern| Dir[pattern].sort.each { |path| load File.expand_path(path) } } +end + +def setup_environment + # Configure Rails Environment + ENV["RAILS_ENV"] = 'test' + require File.expand_path("../dummy/config/environment.rb", __FILE__) + + require 'rspec/rails' + require 'capybara/rspec' + require 'factory_girl_rails' + + Rails.backtrace_cleaner.remove_silencers! + + RSpec.configure do |config| + config.mock_with :rspec + end +end + +def each_run + FactoryGirl.reload + ActiveSupport::Dependencies.clear + + load_all 'spec/support/**/*.rb' + load_all 'spec/factories/**/*.rb' +end + +# If spork is available in the Gemfile it'll be used but we don't force it. +unless (begin; require 'spork'; rescue LoadError; nil end).nil? + Spork.prefork { setup_environment } + Spork.each_run { each_run } +else + setup_environment + each_run +end diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb new file mode 100644 index 0000000..40acbc9 --- /dev/null +++ b/spec/support/database_cleaner.rb @@ -0,0 +1,17 @@ +require 'database_cleaner' + +RSpec.configure do |config| + config.use_transactional_fixtures = false + + config.before(:suite) do + DatabaseCleaner.strategy = :truncation + end + + config.before(:each) do + DatabaseCleaner.start + end + + config.after(:each) do + DatabaseCleaner.clean + end +end diff --git a/spec/support/devise.rb b/spec/support/devise.rb new file mode 100644 index 0000000..9dc6823 --- /dev/null +++ b/spec/support/devise.rb @@ -0,0 +1,8 @@ +require 'devise' + +RSpec.configure do |config| + config.mock_with :rspec + config.use_transactional_fixtures = false + + config.include Devise::TestHelpers, :type => :controller +end diff --git a/spec/support/refinery.rb b/spec/support/refinery.rb new file mode 100644 index 0000000..d761787 --- /dev/null +++ b/spec/support/refinery.rb @@ -0,0 +1,6 @@ +require 'refinerycms-testing' + +RSpec.configure do |config| + config.extend Refinery::Testing::ControllerMacros::Authentication, :type => :controller + config.extend Refinery::Testing::RequestMacros::Authentication, :type => :request +end diff --git a/tasks/rspec.rake b/tasks/rspec.rake new file mode 100644 index 0000000..a7a9ae0 --- /dev/null +++ b/tasks/rspec.rake @@ -0,0 +1,6 @@ +require 'rspec/core/rake_task' + +desc "Run specs" +RSpec::Core::RakeTask.new do |t| + t.pattern = "./spec" +end
\ No newline at end of file |