diff --git a/.gitignore b/.gitignore index 9c1a2c5..02200c0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ doc/* *.autobackupbyrefinery.* /refinerycms-blog*.gem .autotest +spec/dummy # Mac .DS_Store @@ -42,3 +43,12 @@ nbproject # Capybara Bug capybara-*html + +# rvm +.rvmrc + +#rbenv +.rbenv-version + +Gemfile.lock +.rbx \ No newline at end of file diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..53607ea --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--colour diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f240b90 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +before_script: + - "bundle exec rake refinery:testing:dummy_app > /dev/null" +script: "bundle exec rake spec" +notifications: + email: + - parndt@gmail.com + - ugis.ozolss@gmail.com + - joe@joesak.com + - jamie@enmasse.com +env: + - DB=postgresql + - DB=mysql +matrix: + allow_failures: + - rvm: rbx-19mode +rvm: + - 1.8.7 + - 1.9.3 + - rbx-19mode + - jruby diff --git a/Gemfile b/Gemfile index 273aa39..f9da5c3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,70 @@ -source 'http://rubygems.org' +source "http://rubygems.org" + +gemspec + +gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git' +gem 'refinerycms-i18n', :git => 'git://github.com/parndt/refinerycms-i18n.git' +gem 'refinerycms-settings', :git => 'git://github.com/parndt/refinerycms-settings.git' group :development, :test do - gem 'sqlite3' - gem 'mysql2' - gem 'pg' -end \ No newline at end of file + require 'rbconfig' + + gem 'refinerycms-testing', :git => 'git://github.com/resolve/refinerycms.git' + + platforms :jruby do + gem 'activerecord-jdbcsqlite3-adapter' + gem 'activerecord-jdbcmysql-adapter' + gem 'activerecord-jdbcpostgresql-adapter' + gem 'jruby-openssl' + end + + unless defined?(JRUBY_VERSION) + gem 'sqlite3' + gem 'mysql2' + gem 'pg' + end + + 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' + gem 'therubyracer', '~> 0.9.9' + 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 + +# Refinery/rails should pull in the proper versions of these +group :assets do + gem 'sass-rails' + gem 'coffee-rails' + 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..743f388 --- /dev/null +++ b/Rakefile @@ -0,0 +1,19 @@ +#!/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 +Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH) + +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 similarity index 100% rename from public/images/refinerycms-blog/icons/cog.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/comment.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/comment_cross.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/comment_tick.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/comments.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/down.gif rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/folder.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/folder_add.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/folder_edit.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/page.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/page_add.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/page_copy.png rename to 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 similarity index 100% rename from public/images/refinerycms-blog/icons/up.gif rename to 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 similarity index 100% rename from public/images/refinerycms-blog/rss-feed.png rename to 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 diff --git a/public/javascripts/refinery/refinerycms-blog.js b/app/assets/javascripts/refinery/blog/backend.js similarity index 50% rename from public/javascripts/refinery/refinerycms-blog.js rename to 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 similarity index 100% rename from public/javascripts/refinerycms-blog.js rename to 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 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 similarity index 87% rename from public/stylesheets/refinerycms-blog.css rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png rename to 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 similarity index 100% rename from public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css rename to 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 diff --git a/app/controllers/.gitkeep b/app/controllers/.gitkeep new file mode 100644 index 0000000..e69de29 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 => "" - 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 => "", - :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/blog/admin/categories_controller.rb b/app/controllers/refinery/blog/admin/categories_controller.rb new file mode 100644 index 0000000..0a3b7b9 --- /dev/null +++ b/app/controllers/refinery/blog/admin/categories_controller.rb @@ -0,0 +1,12 @@ +module Refinery + module Blog + module Admin + class CategoriesController < ::Refinery::AdminController + + crudify :'refinery/blog/category', + :order => 'title ASC' + + end + end + end +end diff --git a/app/controllers/refinery/blog/admin/comments_controller.rb b/app/controllers/refinery/blog/admin/comments_controller.rb new file mode 100644 index 0000000..8565b28 --- /dev/null +++ b/app/controllers/refinery/blog/admin/comments_controller.rb @@ -0,0 +1,49 @@ +module Refinery + module Blog + module Admin + class CommentsController < ::Refinery::AdminController + + cache_sweeper Refinery::BlogSweeper + + crudify :'refinery/blog/comment', + :title_attribute => :name, + :order => 'published_at DESC' + + def index + @comments = Refinery::Blog::Comment.unmoderated.page(params[:page]) + + render :action => 'index' + end + + def approved + unless params[:id].present? + @comments = Refinery::Blog::Comment.approved.page(params[:page]) + + render :action => 'index' + else + @comment = Refinery::Blog::Comment.find(params[:id]) + @comment.approve! + flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name) + + redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil) + end + end + + def rejected + unless params[:id].present? + @comments = Refinery::Blog::Comment.rejected.page(params[:page]) + + render :action => 'index' + else + @comment = Refinery::Blog::Comment.find(params[:id]) + @comment.reject! + flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name) + + redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil) + end + end + + end + end + end +end diff --git a/app/controllers/refinery/blog/admin/posts_controller.rb b/app/controllers/refinery/blog/admin/posts_controller.rb new file mode 100644 index 0000000..b379a24 --- /dev/null +++ b/app/controllers/refinery/blog/admin/posts_controller.rb @@ -0,0 +1,90 @@ +module Refinery + module Blog + module Admin + class PostsController < ::Refinery::AdminController + + cache_sweeper Refinery::BlogSweeper + + crudify :'refinery/blog/post', + :order => 'published_at DESC' + + before_filter :find_all_categories, + :only => [:new, :edit, :create, :update] + + before_filter :check_category_ids, :only => :update + + def uncategorized + @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 new + @post = ::Refinery::Blog::Post.new(:author => current_refinery_user) + 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[:post].merge!({ + :position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1) + }) + end + + if (@post = Refinery::Blog::Post.create(params[:post])).valid? + (request.xhr? ? flash.now : flash).notice = t( + 'refinery.crudify.created', + :what => "'#{@post.title}'" + ) + + unless from_dialog? + unless params[:continue_editing] =~ /true|on|1/ + redirect_back_or_default(refinery.blog_admin_posts_path) + else + unless request.xhr? + redirect_to :back + else + render "/shared/message" + end + end + else + render :text => "" + end + else + unless request.xhr? + render :action => 'new' + else + render :partial => "/refinery/admin/error_messages", + :locals => { + :object => @post, + :include_object_name => true + } + end + end + end + + protected + def find_all_categories + @categories = Refinery::Blog::Category.find(:all) + end + + def check_category_ids + params[:post][:category_ids] ||= [] + end + end + end + end +end diff --git a/app/controllers/refinery/blog/admin/settings_controller.rb b/app/controllers/refinery/blog/admin/settings_controller.rb new file mode 100644 index 0000000..68daa19 --- /dev/null +++ b/app/controllers/refinery/blog/admin/settings_controller.rb @@ -0,0 +1,55 @@ +module Refinery + module Blog + module Admin + 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 => 'refinery.blog.admin.settings.notification_recipients', + :recipients => Refinery::Blog::Comment::Notification.recipients) + unless request.xhr? or from_dialog? + redirect_back_or_default(refinery.blog_admin_posts_path) + else + render :text => "", + :layout => false + end + end + end + + def moderation + enabled = Refinery::Blog::Comment::Moderation.toggle! + unless request.xhr? + redirect_back_or_default(refinery.blog_admin_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(refinery.blog_admin_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(refinery.blog_admin_posts_path) + else + render :json => {:enabled => enabled}, + :layout => false + end + end + + end + end + end +end \ No newline at end of file diff --git a/app/controllers/refinery/blog/blog_controller.rb b/app/controllers/refinery/blog/blog_controller.rb new file mode 100644 index 0000000..54a8b03 --- /dev/null +++ b/app/controllers/refinery/blog/blog_controller.rb @@ -0,0 +1,17 @@ +module Refinery + module Blog + class BlogController < ::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..467726e --- /dev/null +++ b/app/controllers/refinery/blog/categories_controller.rb @@ -0,0 +1,12 @@ +module Refinery + module Blog + class CategoriesController < BlogController + + def show + @category = Refinery::Blog::Category.find(params[:id]) + @posts = @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..caa46ec --- /dev/null +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -0,0 +1,85 @@ +module Refinery + module Blog + class PostsController < BlogController + + caches_page :index, :unless => proc {|c| c.refinery_user_signed_in? || c.flash.any? || params[:page].present? } + + 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. + (@posts = Post.live.includes(:comments, :categories).all) if request.format.rss? + respond_with (@posts) do |format| + format.html + format.rss + end + end + + def show + @comment = Comment.new + + @canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical? + + @post.increment!(:access_count, 1) + + respond_with (@post) do |format| + format.html { present(@post) } + format.js { render :partial => 'post', :layout => false } + end + end + + def comment + if (@comment = @post.comments.create(params[:comment])).valid? + if Comment::Moderation.enabled? or @comment.ham? + begin + CommentMailer.notification(@comment, request).deliver + rescue + logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" + end + end + + if Comment::Moderation.enabled? + flash[:notice] = t('thank_you_moderated', :scope => 'refinery.blog.posts.comments') + redirect_to refinery.blog_post_url(params[:id]) + else + flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments') + redirect_to refinery.blog_post_url(params[:id], + :anchor => "comment-#{@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') + @posts = Post.live.by_month(@archive_date).page(params[:page]) + else + date = "01/#{params[:year]}" + @archive_date = Time.parse(date) + @date_title = @archive_date.strftime('%Y') + @posts = Post.live.by_year(@archive_date).page(params[:page]) + end + respond_with (@posts) + end + + def tagged + @tag = ActsAsTaggableOn::Tag.find(params[:tag_id]) + @tag_name = @tag.name + @posts = Post.tagged_with(@tag_name).page(params[:page]) + end + + protected + 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 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 = '

' - html << t('archives', :scope => 'blog.shared') - html << '

' - 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..bf4926b --- /dev/null +++ b/app/helpers/refinery/blog/controller_helper.rb @@ -0,0 +1,29 @@ +module Refinery + module Blog + module ControllerHelper + + protected + + def find_blog_post + unless (@post = Refinery::Blog::Post.find(params[:id])).try(:live?) + if refinery_user? and current_refinery_user.authorized_plugins.include?("refinerycms_blog") + @post = Refinery::Blog::Post.find(params[:id]) + else + error_404 + end + end + end + + def find_all_blog_posts + @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 + @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..dfb742a --- /dev/null +++ b/app/helpers/refinery/blog/posts_helper.rb @@ -0,0 +1,72 @@ +module Refinery + module Blog + module PostsHelper + 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::Blog.post_teaser_length, + :preserve_html_tags => true + }).html_safe + end + end + + def blog_archive_widget(dates=blog_archive_dates) + ArchiveWidget.new(dates, self).display + end + + def blog_archive_dates(cutoff=Time.now.beginning_of_month) + Refinery::Blog::Post.published_dates_older_than(cutoff) + end + + class ArchiveWidget + delegate :t, :link_to, :refinery, :render, :to => :view_context + attr_reader :view_context + + def initialize(dates, view_context, cutoff=3.years.ago.end_of_year) + @recent_dates, @old_dates = dates.sort_by {|date| -date.to_i }. + partition {|date| date > cutoff } + + @view_context = view_context + end + + def recent_links + @recent_dates.group_by {|date| [date.year, date.month] }. + map {|(year, month), dates| recent_link(year, month, dates.count) } + end + + def recent_link(year, month, count) + link_to "#{t("date.month_names")[month]} #{year} (#{count})", + refinery.blog_archive_posts_path(:year => year, :month => month) + end + + def old_links + @old_dates.group_by {|date| date.year }. + map {|year, dates| old_link(year, dates.size) } + end + + def old_link(year, count) + link_to "#{year} (#{count})", refinery.blog_archive_posts_path(:year => year) + end + + def links + recent_links + old_links + end + + def display + return "" if links.empty? + render "refinery/blog/widgets/blog_archive", :links => links + end + end + end + end +end 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]}\" " - 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..69a7da4 --- /dev/null +++ b/app/mailers/refinery/blog/comment_mailer.rb @@ -0,0 +1,14 @@ +module Refinery + module Blog + class CommentMailer < ActionMailer::Base + + def notification(comment, request) + @comment = comment + mail :subject => Blog::Comment::Notification.subject, + :to => Blog::Comment::Notification.recipients, + :from => "\"#{Refinery::Core.site_name}\" " + end + + end + end +end diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 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..2935c89 --- /dev/null +++ b/app/models/refinery/blog/category.rb @@ -0,0 +1,25 @@ +module Refinery + module Blog + class Category < ActiveRecord::Base + extend FriendlyId + friendly_id :title, :use => [:slugged] + + 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 + + attr_accessible :title + + def post_count + posts.live.count + end + + # how many items to show per page + self.per_page = Refinery::Blog.posts_per_page + + end + end +end diff --git a/app/models/refinery/blog/comment.rb b/app/models/refinery/blog/comment.rb new file mode 100644 index 0000000..3675e46 --- /dev/null +++ b/app/models/refinery/blog/comment.rb @@ -0,0 +1,135 @@ +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, :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 } + + class << self + def unmoderated + where(:state => nil) + end + + def approved + where(:state => 'approved') + end + + def rejected + where(:state => 'rejected') + end + end + + self.per_page = Refinery::Blog.comments_per_page + + 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 diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb new file mode 100644 index 0000000..c32b775 --- /dev/null +++ b/app/models/refinery/blog/post.rb @@ -0,0 +1,120 @@ +require 'acts-as-taggable-on' +require 'seo_meta' + +module Refinery + module Blog + class Post < ActiveRecord::Base + extend FriendlyId + friendly_id :friendly_id_source, :use => [:slugged] + + is_seo_meta if self.table_exists? + + default_scope :order => 'published_at DESC' + + belongs_to :author, :class_name => 'Refinery::User', :foreign_key => :user_id, :readonly => true + + has_many :comments, :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 + + validates :source_url, :url => { :if => 'Refinery::Blog.validate_source_url', + :update => true, + :allow_nil => true, + :allow_blank => true, + :verify => [:resolve_redirects]} + + attr_accessible :title, :body, :custom_teaser, :tag_list, :draft, :published_at, :custom_url, :author + attr_accessible :browser_title, :meta_keywords, :meta_description, :user_id, :category_ids + attr_accessible :source_url, :source_url_title + + self.per_page = Refinery::Blog.posts_per_page + + def next + self.class.next(self) + end + + def prev + self.class.previous(self) + end + + def live? + !draft and published_at <= Time.now + end + + def friendly_id_source + custom_url.presence || title + end + + class << self + def by_month(date) + where(:published_at => date.beginning_of_month..date.end_of_month) + end + + def by_archive(date) + Refinery.deprecate("Refinery::Blog::Post.by_archive(date)", {:replacement => "Refinery::Blog::Post.by_month(date)", :when => 2.2 }) + by_month(date) + end + + def by_year(date) + where(:published_at => date.beginning_of_year..date.end_of_year) + end + + def published_dates_older_than(date) + published_before(date).pluck(:published_at) + end + + def recent(count) + live.limit(count) + end + + def popular(count) + unscoped.order("access_count DESC").limit(count) + end + + def previous(item) + published_before(item.published_at).first + end + + def uncategorized + live.includes(:categories).where(:categories => { Refinery::Categorization.table_name => { :blog_category_id => nil } }) + end + + def next(current_record) + where(["published_at > ? and draft = ?", current_record.published_at, false]).first + end + + def published_before(date=Time.now) + where("published_at < ? and draft = ?", date, false) + end + alias_method :live, :published_before + + 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 + def self.enabled? + Refinery::Blog.share_this_key != "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + end + end + + end + end +end diff --git a/app/models/refinery/categorization.rb b/app/models/refinery/categorization.rb new file mode 100644 index 0000000..ec51ea7 --- /dev/null +++ b/app/models/refinery/categorization.rb @@ -0,0 +1,10 @@ +module Refinery + class Categorization < ActiveRecord::Base + + self.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 + + attr_accessible :blog_category_id, :blog_post_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 diff --git a/app/views/admin/blog/categories/edit.html.erb b/app/views/admin/blog/categories/edit.html.erb deleted file mode 100644 index 2872e82..0000000 --- a/app/views/admin/blog/categories/edit.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => "form" %> diff --git a/app/views/admin/blog/categories/index.html.erb b/app/views/admin/blog/categories/index.html.erb deleted file mode 100644 index 5d17d42..0000000 --- a/app/views/admin/blog/categories/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= render :partial => '/admin/blog/submenu' %> -
- <% if searching? %> -

<%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %>

- <% if @blog_categories.any? %> - <%= render :partial => "blog_categories", - :collection => @blog_categories %> - <% else %> -

<%= t('search_no_results', :scope => 'admin') %>

- <% end %> - <% else %> - <% if @blog_categories.any? %> - <%= will_paginate @blog_categories %> - - <%= render :partial => "sortable_list" %> - - <%= will_paginate @blog_categories %> - <% else %> -

- - <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.categories')) %> - -

- <% end %> - <% end %> -
diff --git a/app/views/admin/blog/categories/new.html.erb b/app/views/admin/blog/categories/new.html.erb deleted file mode 100644 index 2872e82..0000000 --- a/app/views/admin/blog/categories/new.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => "form" %> diff --git a/app/views/admin/blog/comments/index.html.erb b/app/views/admin/blog/comments/index.html.erb deleted file mode 100644 index aaec4ae..0000000 --- a/app/views/admin/blog/comments/index.html.erb +++ /dev/null @@ -1,35 +0,0 @@ -<%= render :partial => '/admin/blog/submenu' %> -
- <% if searching? %> -

<%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %>

- <% if @blog_comments.any? %> - <%=# will_paginate @blog_comments - %> - -
    - <%= render :partial => "blog_comments", - :collection => @blog_comments %> -
- - <%=# will_paginate @blog_comments - %> - <% else %> -

<%= t('search_no_results', :scope => 'admin') %>

- <% end %> - <% else %> - <% if @blog_comments.any? %> - <%=# will_paginate @blog_comments - %> - - <%= render :partial => "sortable_list" %> - - <%=# will_paginate @blog_comments - %> - <% else %> -

- <%= t('.no_items_yet', - :type => t(action_name.gsub('index', 'new'), :scope => 'admin.blog.submenu.comments').downcase) %> -

- <% end %> - <% end %> -
diff --git a/app/views/admin/blog/comments/show.html.erb b/app/views/admin/blog/comments/show.html.erb deleted file mode 100644 index d4c2186..0000000 --- a/app/views/admin/blog/comments/show.html.erb +++ /dev/null @@ -1,63 +0,0 @@ -
-

<%= t('.details')%>

-

- <%= t('.age') %>: <%= time_ago_in_words(@blog_comment.created_at) %> -

-

<%= t('.actions') %>

-
    -
  • - <%= link_to t('.back'), {:action => 'index'}, :class => "back_icon" %> -
  • -
  • - <%= link_to t('.reject'), rejected_admin_blog_comment_path(@blog_comment, :return_to => 'rejected'), - :class => 'comment_cross_icon' unless @blog_comment.rejected? %> -
  • -
  • - <%= link_to t('.approve'), approved_admin_blog_comment_path(@blog_comment, :return_to => 'approved'), - :class => 'comment_tick_icon' unless @blog_comment.approved? %> -
  • -
-
-
-

<%= t('.comment') %>

- - - - - - - - - - - - - - - - - -
- <%= t('.blog_post') %> - - <%= link_to @blog_comment.post.title, - blog_post_url(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), - :target => '_blank' %> -
- <%= t('.from') %> - - <%= @blog_comment.name %> [<%= mail_to @blog_comment.email, @blog_comment.email, {:title => t('.click_to_email')} %>] -
- <%= t('.date') %> - - <%= l(Date.parse(@blog_comment.created_at.to_s), :format => :long) %> -
- <%= t('.message') %> - -

- <%= @blog_comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "

") %> -

-
-
- -<% 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 @@ - 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 @@ - diff --git a/app/views/admin/blog/posts/_post.html.erb b/app/views/admin/blog/posts/_post.html.erb deleted file mode 100644 index a7f09e0..0000000 --- a/app/views/admin/blog/posts/_post.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -
  • - - <%= post.title %> - - <%= post.published_at.try(:strftime, '%b %d, %Y') || 'draft' %> - <%= " by #{post.author.username}" if post.author.present? %> - - - - <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post), - :title => t('.view_live_html'), - :target => "_blank" %> - <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_blog_post_path(post), - :title => t('.edit') %> - <%= link_to refinery_icon_tag("delete.png"), admin_blog_post_path(post), - :class => "cancel confirm-delete", - :title => t('.delete'), - :method => :delete, - :confirm => t('message', :scope => 'shared.admin.delete', :title => post.title) %> - -
  • diff --git a/app/views/admin/blog/posts/edit.html.erb b/app/views/admin/blog/posts/edit.html.erb deleted file mode 100644 index 2872e82..0000000 --- a/app/views/admin/blog/posts/edit.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => "form" %> diff --git a/app/views/admin/blog/posts/index.html.erb b/app/views/admin/blog/posts/index.html.erb deleted file mode 100644 index 90a6a6e..0000000 --- a/app/views/admin/blog/posts/index.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -<%= render :partial => '/admin/blog/submenu' %> -
    - <% if searching? %> -

    <%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %>

    - <% if @blog_posts.any? %> -
      - <%= render :partial => "post", - :collection => @blog_posts %> -
    - <% else %> -

    <%= t('no_results', :scope => 'shared.admin.search') %>

    - <% end %> - <% else %> - <% if @blog_posts.any? %> - <%= will_paginate @blog_posts %> - - <%= render :partial => "sortable_list" %> - - <%= will_paginate @blog_posts %> - <% else %> -

    - - <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %> - -

    - <% end %> - <% end %> -
    diff --git a/app/views/admin/blog/posts/new.html.erb b/app/views/admin/blog/posts/new.html.erb deleted file mode 100644 index 2872e82..0000000 --- a/app/views/admin/blog/posts/new.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => "form" %> diff --git a/app/views/admin/blog/posts/uncategorized.html.erb b/app/views/admin/blog/posts/uncategorized.html.erb deleted file mode 100644 index 19d9e20..0000000 --- a/app/views/admin/blog/posts/uncategorized.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= render :partial => '/admin/blog/submenu' %> -
    - <% if searching? %> -

    <%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %>

    - <% if @blog_posts.any? %> - <%= render :partial => "blog_posts", - :collection => @blog_posts %> - <% else %> -

    <%= t('search_no_results', :scope => 'admin') %>

    - <% end %> - <% else %> - <% if @blog_posts.any? %> - <%= will_paginate @blog_posts %> - - <%= render :partial => "sortable_list" %> - - <%= will_paginate @blog_posts %> - <% else %> -

    - - <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %> - -

    - <% end %> - <% end %> -
    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? %> -
    - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> -
    - <% else %> -

    - <%= t('.no_posts') %> -

    - <% 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 @@ - diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb deleted file mode 100644 index 12978d3..0000000 --- a/app/views/blog/posts/_post.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<% flash.each do |key, value| %> -
    - <%= value %> -
    -<% end %> -
    -
    -

    <%= @blog_post.title %>

    -
    - - <%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>. - <% if (categories = @blog_post.categories).any? %> - - <% end %> -
    -
    - <%= @blog_post.body.html_safe %> - - <% if BlogPost::ShareThis.enabled? %> - - <% end %> -
    -<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%> -<%= render 'nav' if next_or_previous?(@blog_post) %> 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 %> -

    <%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %>

    - <% if @blog_posts.any? %> -
    - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> -
    - <% else %> -

    <%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %>

    - <% 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? %> -
    - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> -
    - <% else %> -

    <%= t('.no_blog_articles_yet') %>

    - <% 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/index.rss.builder b/app/views/blog/posts/index.rss.builder deleted file mode 100644 index 51fa4da..0000000 --- a/app/views/blog/posts/index.rss.builder +++ /dev/null @@ -1,17 +0,0 @@ -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 - - @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) - end - end - end -end \ No newline at end of file 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 %> -
    - <%= render 'post' %> -
    - - <% if BlogPost.comments_allowed? %> - - <% 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') %> - - -<% 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? %> -
    - <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> -
    - <% else %> -

    <%= t('.no_blog_articles_yet') %>

    - <% 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/_post.html.erb b/app/views/blog/shared/_post.html.erb deleted file mode 100644 index 6cda22d..0000000 --- a/app/views/blog/shared/_post.html.erb +++ /dev/null @@ -1,46 +0,0 @@ -<% if post.live? %> -
    -
    -

    <%= link_to post.title, blog_post_url(post) %>

    -
    - - <%= "#{t('by', :scope => 'blog.posts.show')} #{post.author.username}" if post.author.present? %>. - <% if (categories = post.categories).any? %> - - <% end %> - <% if (tags = post.tags).any? %> - - <% end %> -
    -
    -
    - <% if blog_post_teaser_enabled? %> - <%= blog_post_teaser(post) %> - <% else %> - <%= post.body.html_safe %> - <% end %> -
    -
    -

    - <%= link_to t('read_more', :scope => 'blog.shared.posts'), blog_post_url(post) if blog_post_teaser_enabled? %> -

    - -
    -
    -<% end %> diff --git a/app/views/blog/shared/_posts.html.erb b/app/views/blog/shared/_posts.html.erb deleted file mode 100644 index 24a8199..0000000 --- a/app/views/blog/shared/_posts.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% if @blog_posts.many? %> -

    <%= t('.other') %>

    - -<% end %> \ No newline at end of file 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 @@ -

    <%= t('.title') %>

    -<%= link_to t('.subscribe'), blog_rss_feed_url, :id => "rss_feed_subscribe"%> diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/refinery/blog/admin/_submenu.html.erb similarity index 50% rename from app/views/admin/blog/_submenu.html.erb rename to app/views/refinery/blog/admin/_submenu.html.erb index 25f437b..ba34188 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/refinery/blog/admin/_submenu.html.erb @@ -1,9 +1,9 @@ -<% 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/categories/_category.html.erb b/app/views/refinery/blog/admin/categories/_category.html.erb similarity index 60% rename from app/views/admin/blog/categories/_category.html.erb rename to app/views/refinery/blog/admin/categories/_category.html.erb index 191f649..b7d352f 100644 --- a/app/views/admin/blog/categories/_category.html.erb +++ b/app/views/refinery/blog/admin/categories/_category.html.erb @@ -5,12 +5,12 @@ <%= link_to refinery_icon_tag("application_edit.png"), - edit_admin_blog_category_path(category, :dialog => true, :height => 325), + refinery.edit_blog_admin_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"), refinery.blog_admin_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) %> diff --git a/app/views/admin/blog/categories/_form.html.erb b/app/views/refinery/blog/admin/categories/_form.html.erb similarity index 57% rename from app/views/admin/blog/categories/_form.html.erb rename to app/views/refinery/blog/admin/categories/_form.html.erb index bfcbc7b..b1cf16c 100644 --- a/app/views/admin/blog/categories/_form.html.erb +++ b/app/views/refinery/blog/admin/categories/_form.html.erb @@ -1,5 +1,5 @@ -<%= form_for [:admin, @blog_category] do |f| -%> - <%= render :partial => "/shared/admin/error_messages", +<%= form_for [refinery, :blog_admin, @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' -%> - <%= 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.blog.admin.categories.category') } %> <% end %> diff --git a/app/views/admin/blog/comments/_sortable_list.html.erb b/app/views/refinery/blog/admin/categories/_sortable_list.html.erb similarity index 57% rename from app/views/admin/blog/comments/_sortable_list.html.erb rename to app/views/refinery/blog/admin/categories/_sortable_list.html.erb index e141dee..8040dc0 100644 --- a/app/views/admin/blog/comments/_sortable_list.html.erb +++ b/app/views/refinery/blog/admin/categories/_sortable_list.html.erb @@ -1,7 +1,7 @@ -<%= 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/refinery/blog/admin/categories/edit.html.erb b/app/views/refinery/blog/admin/categories/edit.html.erb new file mode 100644 index 0000000..e0f80e7 --- /dev/null +++ b/app/views/refinery/blog/admin/categories/edit.html.erb @@ -0,0 +1 @@ +<%= render "form" %> diff --git a/app/views/refinery/blog/admin/categories/index.html.erb b/app/views/refinery/blog/admin/categories/index.html.erb new file mode 100644 index 0000000..451abc5 --- /dev/null +++ b/app/views/refinery/blog/admin/categories/index.html.erb @@ -0,0 +1,27 @@ +<%= render '/refinery/blog/admin/submenu' %> +
    + <% if searching? %> +

    <%= t('results_for', :scope => 'refinery.admin.search', + :query => params[:search]) %>

    + <% if @categories.any? %> + <%= render :partial => "blog_categories", + :collection => @categories %> + <% else %> +

    <%= t('no_results', :scope => 'refinery.admin.search') %>

    + <% end %> + <% else %> + <% if @categories.any? %> + <%= will_paginate @categories %> + + <%= render "sortable_list" %> + + <%= will_paginate @categories %> + <% else %> +

    + + <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.blog.admin.submenu.categories')) %> + +

    + <% end %> + <% end %> +
    diff --git a/app/views/refinery/blog/admin/categories/new.html.erb b/app/views/refinery/blog/admin/categories/new.html.erb new file mode 100644 index 0000000..e0f80e7 --- /dev/null +++ b/app/views/refinery/blog/admin/categories/new.html.erb @@ -0,0 +1 @@ +<%= render "form" %> diff --git a/app/views/admin/blog/comments/_comment.html.erb b/app/views/refinery/blog/admin/comments/_comment.html.erb similarity index 60% rename from app/views/admin/blog/comments/_comment.html.erb rename to app/views/refinery/blog/admin/comments/_comment.html.erb index 547b9e4..c007294 100644 --- a/app/views/admin/blog/comments/_comment.html.erb +++ b/app/views/refinery/blog/admin/comments/_comment.html.erb @@ -5,16 +5,16 @@ <%= link_to refinery_icon_tag("application_go.png"), - blog_post_url(comment.post, :anchor => "comment-#{comment.to_param}"), + refinery.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'), refinery.blog_admin_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')), + refinery.rejected_blog_admin_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')), + refinery.approved_blog_admin_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), :title => t('.approve') unless comment.approved? %> diff --git a/app/views/admin/blog/categories/_sortable_list.html.erb b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb similarity index 57% rename from app/views/admin/blog/categories/_sortable_list.html.erb rename to app/views/refinery/blog/admin/comments/_sortable_list.html.erb index df6a39b..9f8bbbc 100644 --- a/app/views/admin/blog/categories/_sortable_list.html.erb +++ b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb @@ -1,7 +1,7 @@ -<%= 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/refinery/blog/admin/comments/index.html.erb b/app/views/refinery/blog/admin/comments/index.html.erb new file mode 100644 index 0000000..53c368e --- /dev/null +++ b/app/views/refinery/blog/admin/comments/index.html.erb @@ -0,0 +1,30 @@ +<%= render '/refinery/blog/admin/submenu' %> +
    + <% if searching? %> +

    <%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %>

    + <% if @comments.any? %> + <%= will_paginate @comments %> + +
      + <%= render :partial => "blog_comments", + :collection => @comments %> +
    + + <%= will_paginate @comments %> + <% else %> +

    <%= t('search_no_results', :scope => 'admin') %>

    + <% end %> + <% else %> + <% if @comments.any? %> + <%= will_paginate @comments %> + + <%= render "sortable_list" %> + + <%= will_paginate @comments %> + <% else %> +

    + <%= t('.no_items_yet', :type => action_name.gsub('index', 'new').downcase) %> +

    + <% end %> + <% end %> +
    diff --git a/app/views/refinery/blog/admin/comments/show.html.erb b/app/views/refinery/blog/admin/comments/show.html.erb new file mode 100644 index 0000000..2246c2f --- /dev/null +++ b/app/views/refinery/blog/admin/comments/show.html.erb @@ -0,0 +1,63 @@ +
    +

    <%= t('.details')%>

    +

    + <%= t('.age') %>: <%= time_ago_in_words(@comment.created_at) %> +

    +

    <%= t('.actions') %>

    +
      +
    • + <%= link_to t('.back'), refinery.blog_admin_comments_path, :class => "back_icon" %> +
    • +
    • + <%= link_to t('.reject'), refinery.rejected_blog_admin_comment_path(@comment, :return_to => 'rejected'), + :class => 'comment_cross_icon' unless @comment.rejected? %> +
    • +
    • + <%= link_to t('.approve'), refinery.approved_blog_admin_comment_path(@comment, :return_to => 'approved'), + :class => 'comment_tick_icon' unless @comment.approved? %> +
    • +
    +
    +
    +

    <%= t('.comment') %>

    + + + + + + + + + + + + + + + + + +
    + <%= t('.blog_post') %> + + <%= link_to @comment.post.title, + refinery.blog_post_path(@comment.post, :anchor => "comment-#{@comment.to_param}"), + :target => '_blank' %> +
    + <%= t('.from') %> + + <%= @comment.name %> [<%= mail_to @comment.email, @comment.email, {:title => t('.click_to_email')} %>] +
    + <%= t('.date') %> + + <%= l(Date.parse(@comment.created_at.to_s), :format => :long) %> +
    + <%= t('.message') %> + +

    + <%= @comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "

    ") %> +

    +
    +
    + +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/backend') %> diff --git a/app/views/admin/blog/posts/_form.html.erb b/app/views/refinery/blog/admin/posts/_form.html.erb similarity index 50% rename from app/views/admin/blog/posts/_form.html.erb rename to app/views/refinery/blog/admin/posts/_form.html.erb index c891b63..a977754 100644 --- a/app/views/admin/blog/posts/_form.html.erb +++ b/app/views/refinery/blog/admin/posts/_form.html.erb @@ -1,5 +1,5 @@ -<%= form_for [:admin, @blog_post] do |f| -%> - <%= render :partial => "/shared/admin/error_messages", +<%= form_for [refinery, :blog_admin, @post] do |f| -%> + <%= render :partial => "/refinery/admin/error_messages", :locals => { :object => f.object, :include_object_name => true @@ -9,15 +9,22 @@ <%= f.label :title -%> <%= f.text_field :title, :class => 'larger widest' -%> + +
    +

    + <%= f.check_box :draft %> + <%= f.label :draft, t('.save_as_draft'), :class => "stripped" %> +

    +
    • - <%= 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" %>
    • - <%= 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" %>
    • <% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %>
    • @@ -25,55 +32,42 @@
    • <% end %>
    - +
    - <% part_index = -1 %> - <%= render :partial => 'form_part', - :locals => { - :f => f, - :part_index => (part_index += 1), - } -%> - <%= render :partial => 'teaser_part', - :locals => { - :f => f, - :part_index => (part_index += 1), - } if f.object.respond_to?(:custom_teaser) -%> + <%= render 'form_part', :f => f, :part_index => (part_index += 1) -%> + <%= render 'teaser_part', :f => f, :part_index => (part_index += 1) if f.object.respond_to?(:custom_teaser) -%> <% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %>
    - <%= render :partial => tab.partial, :locals => {:f => f} %> + <%= render tab.partial, :f => f %>
    <% end %>
    - +
    - <%= 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' -%>
    - +

    <%= link_to t('.advanced_options'), "#", :id => 'toggle_advanced_options', :title => t('.toggle_advanced_options') %>

    - - <%= f.check_box :draft %> - <%= f.label :draft, t('.save_as_draft'), :class => "stripped" %> -
    - <%= render :partial => '/seo_meta/form', :locals => {:form => f} %> + <%= render '/seo_meta/form', :form => f %>
    - <%= 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.blog.admin.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 => refinery.tags_blog_admin_posts_url %> diff --git a/app/views/admin/blog/posts/_form_part.html.erb b/app/views/refinery/blog/admin/posts/_form_part.html.erb similarity index 100% rename from app/views/admin/blog/posts/_form_part.html.erb rename to app/views/refinery/blog/admin/posts/_form_part.html.erb diff --git a/app/views/refinery/blog/admin/posts/_post.html.erb b/app/views/refinery/blog/admin/posts/_post.html.erb new file mode 100644 index 0000000..fea3eb8 --- /dev/null +++ b/app/views/refinery/blog/admin/posts/_post.html.erb @@ -0,0 +1,25 @@ +
  • + + <%= post.title %> + + <%= " by #{post.author.username}" if post.author.present? %> + <% if post.draft? %> + <%= t('refinery.blog.admin.posts.post.draft') %> + <% else %> + <%= post.published_at.strftime('%b %d, %Y') %> + <% end %> + + + + <%= link_to refinery_icon_tag("application_go.png"), refinery.blog_post_path(post), + :title => t('.view_live_html'), + :target => "_blank" %> + <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_blog_admin_post_path(post), + :title => t('.edit') %> + <%= link_to refinery_icon_tag("delete.png"), refinery.blog_admin_post_path(post), + :class => "cancel confirm-delete", + :title => t('.delete'), + :method => :delete, + :confirm => t('message', :scope => 'refinery.admin.delete', :title => post.title) %> + +
  • diff --git a/app/views/admin/blog/posts/_sortable_list.html.erb b/app/views/refinery/blog/admin/posts/_sortable_list.html.erb similarity index 58% rename from app/views/admin/blog/posts/_sortable_list.html.erb rename to app/views/refinery/blog/admin/posts/_sortable_list.html.erb index 7ae0ad3..471d4f0 100644 --- a/app/views/admin/blog/posts/_sortable_list.html.erb +++ b/app/views/refinery/blog/admin/posts/_sortable_list.html.erb @@ -1,7 +1,7 @@ -<%= 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/blog/admin/posts/_teaser_part.html.erb similarity index 58% rename from app/views/admin/blog/posts/_teaser_part.html.erb rename to app/views/refinery/blog/admin/posts/_teaser_part.html.erb index 71d7d01..461a10c 100644 --- a/app/views/admin/blog/posts/_teaser_part.html.erb +++ b/app/views/refinery/blog/admin/posts/_teaser_part.html.erb @@ -2,9 +2,9 @@ <%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%>

    - <%= link_to t('copy_body', :scope => 'admin.blog.posts.form'), "#", + <%= link_to t('copy_body', :scope => 'refinery.blog.admin.posts.form'), "#", :id => 'copy_body_link', - :title => t('copy_body_help', :scope => 'admin.blog.posts.form') %> + :title => t('copy_body_help', :scope => 'refinery.blog.admin.posts.form') %>

    diff --git a/app/views/refinery/blog/admin/posts/edit.html.erb b/app/views/refinery/blog/admin/posts/edit.html.erb new file mode 100644 index 0000000..e0f80e7 --- /dev/null +++ b/app/views/refinery/blog/admin/posts/edit.html.erb @@ -0,0 +1 @@ +<%= render "form" %> diff --git a/app/views/refinery/blog/admin/posts/index.html.erb b/app/views/refinery/blog/admin/posts/index.html.erb new file mode 100644 index 0000000..19c4ccf --- /dev/null +++ b/app/views/refinery/blog/admin/posts/index.html.erb @@ -0,0 +1,27 @@ +<%= render '/refinery/blog/admin/submenu' %> +
    + <% if searching? %> +

    <%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %>

    + <% if @posts.any? %> +
      + <%= render :partial => "post", :collection => @posts %> +
    + <% else %> +

    <%= t('no_results', :scope => 'refinery.admin.search') %>

    + <% end %> + <% else %> + <% if @posts.any? %> + <%= will_paginate @posts %> + + <%= render "sortable_list" %> + + <%= will_paginate @posts %> + <% else %> +

    + + <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.blog.admin.submenu.posts')) %> + +

    + <% end %> + <% end %> +
    diff --git a/app/views/refinery/blog/admin/posts/new.html.erb b/app/views/refinery/blog/admin/posts/new.html.erb new file mode 100644 index 0000000..e0f80e7 --- /dev/null +++ b/app/views/refinery/blog/admin/posts/new.html.erb @@ -0,0 +1 @@ +<%= render "form" %> diff --git a/app/views/refinery/blog/admin/posts/uncategorized.html.erb b/app/views/refinery/blog/admin/posts/uncategorized.html.erb new file mode 100644 index 0000000..21e7c04 --- /dev/null +++ b/app/views/refinery/blog/admin/posts/uncategorized.html.erb @@ -0,0 +1,27 @@ +<%= render '/refinery/blog/admin/submenu' %> +
    + <% if searching? %> +

    <%= t('results_for', :scope => 'refinery.admin.search', + :query => params[:search]) %>

    + <% if @posts.any? %> + <%= render :partial => "blog_posts", + :collection => @posts %> + <% else %> +

    <%= t('no_results', :scope => 'refinery.admin.search') %>

    + <% end %> + <% else %> + <% if @posts.any? %> + <%= will_paginate @posts %> + + <%= render "sortable_list" %> + + <%= will_paginate @posts %> + <% else %> +

    + + <%= t('.no_items_yet') %> + +

    + <% end %> + <% end %> +
    diff --git a/app/views/admin/blog/settings/notification_recipients.html.erb b/app/views/refinery/blog/admin/settings/notification_recipients.html.erb similarity index 69% rename from app/views/admin/blog/settings/notification_recipients.html.erb rename to app/views/refinery/blog/admin/settings/notification_recipients.html.erb index 41e7f2d..132ab17 100644 --- a/app/views/admin/blog/settings/notification_recipients.html.erb +++ b/app/views/refinery/blog/admin/settings/notification_recipients.html.erb @@ -1,4 +1,4 @@ -<%= form_tag do %> +<%= form_tag refinery.notification_recipients_blog_admin_settings_path do %>
    @@ -14,11 +14,11 @@ <%= t('.example') %>

    - <%= render :partial => "/shared/admin/form_actions", + <%= render :partial => "/refinery/admin/form_actions", :locals => { :f => nil, :continue_editing => false, - :cancel_url => admin_blog_posts_url, + :cancel_url => refinery.blog_admin_posts_url, :hide_delete => true } %> <% end %> 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..3a4a617 --- /dev/null +++ b/app/views/refinery/blog/categories/show.html.erb @@ -0,0 +1,21 @@ +<% content_for :body_content_title, @category.title %> + +<% content_for :body do %> + <% if @posts.any? %> +
    + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> + <%= will_paginate @posts %> +
    + <% else %> +

    + <%= t('.no_posts') %> +

    + <% end %> +<% end %> + +<% content_for :side_body do %> + <%= render "/refinery/blog/shared/categories" %> +<% end %> + +<%= render "/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 similarity index 89% rename from app/views/blog/comment_mailer/notification.html.erb rename to app/views/refinery/blog/comment_mailer/notification.html.erb index 800f12c..8bf642e 100644 --- a/app/views/blog/comment_mailer/notification.html.erb +++ b/app/views/refinery/blog/comment_mailer/notification.html.erb @@ -12,6 +12,6 @@ <%=raw t('.comment_ends') %> <%=raw t('.closing_line') %>, -<%=raw RefinerySetting[:site_name] %> +<%=raw Refinery::Core.site_name %> <%=raw t('.ps') %> diff --git a/app/views/blog/posts/_comment.html.erb b/app/views/refinery/blog/posts/_comment.html.erb similarity index 59% rename from app/views/blog/posts/_comment.html.erb rename to 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) %>

    - <%= 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)) %>

    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..d662a1f --- /dev/null +++ b/app/views/refinery/blog/posts/_comments.html.erb @@ -0,0 +1,40 @@ + 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..eafd35e --- /dev/null +++ b/app/views/refinery/blog/posts/_nav.html.erb @@ -0,0 +1,17 @@ + diff --git a/app/views/refinery/blog/posts/_post.html.erb b/app/views/refinery/blog/posts/_post.html.erb new file mode 100644 index 0000000..9811dd2 --- /dev/null +++ b/app/views/refinery/blog/posts/_post.html.erb @@ -0,0 +1,37 @@ +<% flash.each do |key, value| %> +
    + <%= value %> +
    +<% end %> +
    +
    +

    <%= @post.title %>

    +
    + + <%= content_tag(:div, "#{t('by', :scope => 'refinery.blog.posts.show')} #{@post.author.username}", :class => "blog_author") if @post.author.present? %> + <% if @post.source_url.present? %> +
    + <%= "#{t('source', :scope => 'refinery.blog.posts.show')}: " %> + <%= link_to (@post.source_url_title.blank? ? @post.source_url : @post.source_url_title), @post.source_url %> +
    + <% end %> + <% if (categories = @post.categories).any? %> + + <% end %> +
    +
    + <%= @post.body.html_safe %> + + <% if Refinery::Blog::Post::ShareThis.enabled? %> + + <% end %> +
    +<%= render '/refinery/draft_page_message' unless @post.nil? or @post.live? -%> +<%= render 'nav' if next_or_previous?(@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..31b5c1e --- /dev/null +++ b/app/views/refinery/blog/posts/archive.html.erb @@ -0,0 +1,17 @@ +<% content_for :title, "#{t('.blog_archive_for', :date => @archive_date.strftime('%B %Y'))}" %> + +<% content_for :body do %> +

    <%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %>

    + <% if @posts.any? %> +
    + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> +
    + <% else %> +

    <%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %>

    + <% end %> +<% end %> + +<%= render '/refinery/blog/shared/body_content_right' %> + +<%= render "/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..772f2ec --- /dev/null +++ b/app/views/refinery/blog/posts/index.html.erb @@ -0,0 +1,20 @@ +<% content_for :body do %> + <%= raw @page.content_for(Refinery::Pages.default_parts.first.to_sym) if Refinery::Pages.default_parts.any? %> + + <% if @posts.any? %> +
    + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> + <%= will_paginate @posts %> +
    + <% else %> +

    <%= t('.no_blog_articles_yet') %>

    + <% end %> +<% end %> + +<% content_for :side_body_prepend do -%> + <%= raw @page.content_for(Refinery::Pages.default_parts.second.to_sym) %> +<% end if Refinery::Pages.default_parts.many? -%> +<%= render '/refinery/blog/shared/body_content_right' %> + +<%= render "/refinery/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/frontend') %> diff --git a/app/views/refinery/blog/posts/index.rss.builder b/app/views/refinery/blog/posts/index.rss.builder new file mode 100644 index 0000000..8ffacd4 --- /dev/null +++ b/app/views/refinery/blog/posts/index.rss.builder @@ -0,0 +1,17 @@ +xml.instruct! :xml, :version => "1.0" +xml.rss :version => "2.0" do + xml.channel do + xml.title Refinery::Core.site_name + xml.description Refinery::Core.site_name + " Blog Posts" + xml.link refinery.blog_root_url + + @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 refinery.blog_post_url(post) + end + end + end +end \ No newline at end of file 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..d7abd1e --- /dev/null +++ b/app/views/refinery/blog/posts/show.html.erb @@ -0,0 +1,21 @@ +<% content_for :body do %> +
    + <%= render 'post' %> +
    + + <% if Refinery::Blog::Post.comments_allowed? %> + <%= render 'comments'%> + <% end %> +<% end %> + +<%= render '/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') %> + + +<% 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..c22e55b --- /dev/null +++ b/app/views/refinery/blog/posts/tagged.html.erb @@ -0,0 +1,19 @@ +<% content_for :title, "#{t('.posts_tagged')} '#{@tag_name.titleize}'" %> + +<% content_for :body_content_title, "#{t('.posts_tagged')} “#{@tag_name.titleize}”".html_safe -%> + +<% content_for :body do %> + <% if @posts.any? %> +
    + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> + <%= will_paginate @posts %> +
    + <% else %> +

    <%= t('.no_blog_articles_yet') %>

    + <% end %> +<% end %> + +<%= render '/refinery/blog/shared/body_content_right' %> + +<%= render "/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..b614dca --- /dev/null +++ b/app/views/refinery/blog/shared/_body_content_right.html.erb @@ -0,0 +1,9 @@ +<% content_for :side_body do %> + <%= yield(:side_body_prepend) %> + <%= render "/refinery/blog/shared/rss_feed" %> + <%= render "/refinery/blog/shared/categories" %> + <%= render "/refinery/blog/shared/tags" %> + <%= render "/refinery/blog/shared/posts" %> + <%= blog_archive_widget %> + <%= yield(:side_body_append) %> +<% end %> diff --git a/app/views/blog/shared/_categories.html.erb b/app/views/refinery/blog/shared/_categories.html.erb similarity index 69% rename from app/views/blog/shared/_categories.html.erb rename to app/views/refinery/blog/shared/_categories.html.erb index 05cc53f..64f4ee6 100644 --- a/app/views/blog/shared/_categories.html.erb +++ b/app/views/refinery/blog/shared/_categories.html.erb @@ -1,9 +1,9 @@ -<% if @blog_categories.any? %> +<% if @categories.any? %>

    <%= t('.title') %>

      - <% @blog_categories.each do |category| %> + <% @categories.each do |category| %> > - <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %> + <%= link_to "#{category.title} (#{category.post_count})", refinery.blog_category_path(category) %> <% end %>
    diff --git a/app/views/refinery/blog/shared/_post.html.erb b/app/views/refinery/blog/shared/_post.html.erb new file mode 100644 index 0000000..5b90c8e --- /dev/null +++ b/app/views/refinery/blog/shared/_post.html.erb @@ -0,0 +1,48 @@ +<% if post.live? %> +
    +
    +

    <%= link_to post.title, refinery.blog_post_path(post) %>

    +
    + + <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{post.author.username}" if post.author.present? %>. + <% if (categories = post.categories).any? %> + + <% end %> + <% if (tags = post.tags).any? %> + + <% end %> +
    +
    +
    + <% if blog_post_teaser_enabled? %> + <%= blog_post_teaser(post) %> + <% else %> + <%= post.body.html_safe %> + <% end %> +
    +
    +

    + <% if blog_post_teaser_enabled? && post.custom_teaser.present? %> + <%= link_to t('read_more', :scope => 'refinery.blog.shared.posts'), refinery.blog_post_path(post) %> + <% end %> +

    + +
    +
    +<% end %> diff --git a/app/views/refinery/blog/shared/_posts.html.erb b/app/views/refinery/blog/shared/_posts.html.erb new file mode 100644 index 0000000..a8064c4 --- /dev/null +++ b/app/views/refinery/blog/shared/_posts.html.erb @@ -0,0 +1,10 @@ +<% if @posts.many? %> +

    <%= t('.other') %>

    +
      + <% @posts.each do |blog_post| %> +
    • + <%= link_to blog_post.title, refinery.blog_post_path(blog_post) %> +
    • + <% end %> +
    +<% end %> \ No newline at end of file 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..27ddf23 --- /dev/null +++ b/app/views/refinery/blog/shared/_rss_feed.html.erb @@ -0,0 +1,2 @@ +

    <%= t('.title') %>

    +<%= link_to t('.subscribe'), refinery.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 similarity index 59% rename from app/views/blog/shared/_tags.html.erb rename to app/views/refinery/blog/shared/_tags.html.erb index b0b11ee..af91d50 100644 --- a/app/views/blog/shared/_tags.html.erb +++ b/app/views/refinery/blog/shared/_tags.html.erb @@ -2,7 +2,7 @@

    <%= t('.title') %>

    <% 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..b3522c6 --- /dev/null +++ b/app/views/refinery/blog/widgets/_blog_archive.html.erb @@ -0,0 +1,10 @@ +
    +

    <%= t('archives', :scope => 'refinery.blog.shared') %>

    + +
    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" %> - -<% end %> \ No newline at end of file diff --git a/config/initializers/url_validator.rb b/config/initializers/url_validator.rb new file mode 100644 index 0000000..d956d04 --- /dev/null +++ b/config/initializers/url_validator.rb @@ -0,0 +1,84 @@ +require 'net/http' + +class UrlValidator < ActiveModel::EachValidator + + def validate_each(record, attribute, value) + url = value + + # Regex code by 'Arsenic' from http://snippets.dzone.com/posts/show/3654 + if url =~ /^ +( (https?):\/\/ )? +( [a-z\d]+([\-\.][a-z\d]+)*\.[a-z]{2,6} ) +( +(: +( \d{1,5} ) +)? +( \/.* )? +)? +$/ix + url = "http#{'s' if $7 == '81'}://#{url}" unless $1 + else + record.errors[attribute] << 'Not a valid URL' + end + + if options[:verify] + begin + url_response = RedirectFollower.new(url).resolve + url = url_response.url if options[:verify] == [:resolve_redirects] + rescue RedirectFollower::TooManyRedirects + record.errors[attribute] << 'URL is redirecting too many times' + rescue + record.errors[attribute] << 'could not be resolved' + end + end + + if options[:update] + value.replace url + end + end +end + +# Code below written by John Nunemaker +# See blog post at http://railstips.org/blog/archives/2009/03/04/following-redirects-with-nethttp/ +class RedirectFollower + class TooManyRedirects < StandardError; end + + attr_accessor :url, :body, :redirect_limit, :response + + def initialize(url, limit=5) + @url, @redirect_limit = url, limit + end + + def logger + @logger ||= Rails.logger + end + + def resolve + raise TooManyRedirects if redirect_limit < 0 + + self.response = Net::HTTP.get_response(URI.parse(url)) + + logger.info "redirect limit: #{redirect_limit}" + logger.info "response code: #{response.code}" + logger.debug "response body: #{response.body}" + + if response.kind_of?(Net::HTTPRedirection) + self.url = redirect_url + self.redirect_limit -= 1 + + logger.info "redirect found, headed to #{url}" + resolve + end + + self.body = response.body + self + end + + def redirect_url + if response['location'].nil? + response.body.match(/]+)\">/i)[1] + else + response['location'] + end + end +end diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 3044acd..400aa8a 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1,158 +1,158 @@ bg: - plugins: - refinerycms_blog: - title: Блог - admin: + refinery: + plugins: + refinerycms_blog: + title: Блог blog: - categories: - category: - edit: Редактиране на тази категория - delete: Изтриване на тази категория завинаги - index: - no_items_yet: 'Все още няма категории. Натиснете "%{create}", за да въведете нова.' - comments: - approved: 'Коментара от "%{author}" бе одобрен.' - comment: - view_live_html: 'Преглед на този коментар
    (ще се отвори се в нов прозорец)' - 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: 'Преглед на този публикация
    (ще се отвори се в нов прозорец)' - edit: Редактиране на тази публикация - delete: Изтриване на тази публикация завинаги - settings: - notification_recipients: - value: Изпращане на уведомления до - explanation: 'Всеки път, когато някой коментира публикация, Refinery ще изпраща е-писмо, за да уведоми, че съществува нов коментар.' - hint: 'При добавяне на коментар, Refinery ще Ви уведоми по е-пощата.' - example: "Въведете адреса(ите) на Вашата е-поща. Например: jack@work.com, jill@office.com" - updated: 'Уведомления бяха изпратени до "%{recipients}"' - submenu: + admin: + categories: + category: + edit: Редактиране на тази категория + delete: Изтриване на тази категория завинаги + index: + no_items_yet: 'Все още няма категории. Натиснете "%{create}", за да въведете нова.' + comments: + approved: 'Коментара от "%{author}" бе одобрен.' + comment: + view_live_html: 'Преглед на този коментар
    (ще се отвори се в нов прозорец)' + 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: 'Преглед на този публикация
    (ще се отвори се в нов прозорец)' + edit: Редактиране на тази публикация + delete: Изтриване на тази публикация завинаги + settings: + 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: Коментари + comment_mailer: + notification: + greeting: Здравейте + you_recieved_new_comment: Току що получихте нов коментар на Вашия уебсайт. + comment_starts: --- Начало на коментара --- + comment_ends: --- Край на коментара --- + from: От + email: Е-поща + message: Съобщение + closing_line: Поздрави + ps: 'П.П. Всички Ваши коментари се съхраняват от Refinery в секция "Блог" в подменю "Коментари" и могат да бъдат прегледани по-късно.' + shared: categories: title: Категории - manage: Управление - new: Добавяне на нова категория - comments: - title: Коментари - title_with_count: 'Коментари (%{new_count} нови)' - new: Нови - unmoderated: Нови - approved: Одобрени - rejected: Отхвърлени + rss_feed: + title: RSS хранилка + subscribe: Абониране 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: - 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: Обратно към началото на блога + other: Други публикации + created_at: 'Публикувано на %{when}' + read_more: Цялата публикация 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}. Очаквайте скоро.' + 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: Обратно към началото на блога + 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..28b0fb4 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1,128 +1,128 @@ cs: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (otevře nové okno)' - 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
    (otevře jej v novém okně)' - 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: + admin: + 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
    (otevře nové okno)' + 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
    (otevře jej v novém okně)' + 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: + 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 + 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 - 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ý + rss_feed: + title: RSS zdroj článků + subscribe: Přihlásit k odběru 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: - 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 + other: Další články + created_at: 'Publikován %{when}' + read_more: Celý článek 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}.' + 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 + 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..30cdc54 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,130 +1,130 @@ de: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (öffnet sich in einem neuen Fenster)' - 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
    (öffnet sich in einem neuen Fenster)' - 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: + admin: + 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
    (öffnet sich in einem neuen Fenster)' + 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
    (öffnet sich in einem neuen Fenster)' + 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: + 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 + 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 - manage: Verwalten - new: Neue Kategorie anlegen - comments: - title: Kommentare - title_with_count: 'Kommentare (%{new_count} neu)' - new: Neu - unmoderated: Neu - approved: Genehmigt - rejected: Abgelehnt + rss_feed: + title: RSS Feed + subscribe: Abonnieren 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: - 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 + other: Andere Artikel + created_at: 'Verfasst am %{when}' + read_more: Mehr lesen 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.' + 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 + 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..1d40e6d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,159 +1,167 @@ en: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (opens in a new window)' - 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
    (opens in a new window)' - 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: + admin: + 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
    (opens in a new window)' + 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. + source_url: Source Url + source_url_help: Stores the url for the source of the post material. + source_url_title: Source Url Title + source_url_title_help: Title for the source url for the post. + author: Author + author_help: Set which user this post will show as the author. + 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
    (opens in a new window)' + edit: Edit this blog post + delete: Remove this blog post forever + draft: Draft + 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: + 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 + 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 - manage: Manage - new: Create new category - comments: - title: Comments - title_with_count: 'Comments (%{new_count} new)' - new: New - unmoderated: New - approved: Approved - rejected: Rejected + rss_feed: + title: RSS Feed + subscribe: Subscribe 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: - 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 + other: Other Posts + created_at: 'Posted on %{when}' + read_more: Read more 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.' + 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 + 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 + source: Source + tagged: + no_blog_articles_yet: There are no blog articles posted yet. Stay tuned. + posts_tagged: Posts tagged + archive: + blog_archive_for: '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..8c275a7 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,159 +1,128 @@ es: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (se abrirá en una ventana nueva)' - 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 + admin: + 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
    (se abrirá en una ventana nueva)' + 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
    (se abrirá en una ventana nueva)' + 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 + 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
    (se abrirá en una ventana nueva)' - 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: - categories: - title: Categorías - rss_feed: - title: Feed RSS - subscribe: Suscribirse - 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' + other: Otras entradas + created_at: 'Enviado hace %{when}' + read_more: Leer más 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 + singular: comentario + none: no hay comentarios + archives: Archivos + 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' + 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..661dd9f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1,154 +1,154 @@ fr: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (Ouvre une nouvelle fenêtre)' - 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
    (Ouvre une nouvelle fenêtre)' - 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: + admin: + 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
    (Ouvre une nouvelle fenêtre)' + 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
    (Ouvre une nouvelle fenêtre)' + 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: + 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 + 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 - 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é + rss_feed: + title: Flux RSS + subscribe: Souscrire 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: - 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 + other: Autres articles + created_at: 'Écrit le %{when}' + read_more: Lire la suite + by: 'par' 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." + 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 + 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..11fa53a 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1,156 +1,156 @@ it: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    live (si apre in una nuova finestra)
    ' - 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
    (si aprirà in una nuova finestra)' - 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: + admin: + 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
    live (si apre in una nuova finestra)
    ' + 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
    (si aprirà in una nuova finestra)' + 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: + 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 + 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 - 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 + rss_feed: + title: RSS Feed + subscribe: Iscriviti 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: - 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: + other: Altri Articoli + created_at: 'Pubblicato il %{when}' + read_more: Continua a leggere 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. + 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: + 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/ja.yml b/config/locales/ja.yml index 65508ce..1ffd25f 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -3,8 +3,8 @@ ja: plugins: refinerycms_blog: title: ブログ - admin: - blog: + blog: + admin: categories: category: edit: このカテゴリを編集 @@ -80,7 +80,6 @@ ja: moderation: 管理する update_notified: 通知者を変更・更新する comments: コメント - blog: comment_mailer: notification: greeting: こんにちわ diff --git a/config/locales/nb.yml b/config/locales/nb.yml index c71bd25..5ee8057 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -1,30 +1,31 @@ nb: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (åpner i et nytt vindu)' - edit: Rediger denne blog post - delete: Fjern denne blog post permanent - submenu: - comments: - new: ny + admin: 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
    (åpner i et nytt vindu)' + 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..6842d4a 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1,134 +1,134 @@ nl: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (opent in een nieuw venster)' - 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
    (opent in een nieuw venster)' - 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: + admin: + 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
    (opent in een nieuw venster)' + 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
    (opent in een nieuw venster)' + 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: + 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 + 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 - 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 + rss_feed: + title: RSS Feed + subscribe: Aanmelden 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: - 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 + other: Andere posts + created_at: 'Gepost op %{when}' + read_more: Lees verder 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.' + 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 + 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..ade7e83 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1,134 +1,134 @@ pl: + refinery: + plugins: + refinerycms_blog: + title: Blog + blog: + admin: + 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
    (otwiera w nowym oknie)' + 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
    (otwiera w nowym oknie)' + 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: + 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 + 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: + 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 + 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: - blog_comment: + refinery/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
    (otwiera w nowym oknie)' - 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
    (otwiera w nowym oknie)' - 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: - 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: - 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 - 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}.' diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 6f7fd2d..f5fe701 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1,138 +1,138 @@ pt-BR: - plugins: - refinerycms_blog: - title: Blog - activerecord: - attributes: - blog_post: - title: Título - body: Corpo - blog_comment: - name: Nome - message: Mensagem - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (será aberto em outra janela)' - 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
    (será aberto em outra janela)' - 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: + admin: + 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
    (será aberto em outra janela)' + 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
    (será aberto em outra janela)' + 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: + 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 + 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 - 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 + rss_feed: + title: Feed RSS + subscribe: Assinar 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: - 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 + other: Últimos posts + created_at: 'Postado em %{when}' + read_more: Continue lendo... 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 + 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 + 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..b6d9d0b 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,128 +1,128 @@ ru: - plugins: - refinerycms_blog: - title: Блог - admin: + refinery: + plugins: + refinerycms_blog: + title: Блог blog: - categories: - category: - edit: Редактировать эту категорию - delete: Удалить эту категорию навсегда - index: - no_items_yet: 'Категории пока не созданы. Нажмите "%{create}", чтобы добавить вашу первую категорию.' - comments: - approved: 'Комментарий от "%{author}" был опубликован.' - comment: - view_live_html: Посмотреть комментарий на сайте
    (откроется в новом окне) - 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: Посмотреть запись на сайте
    (откроется в новом окне) - edit: Редактировать запись - delete: Удалить запись - settings: - notification_recipients: - value: Отправлять уведомления - explanation: 'При появлении новых комментариев Refinery пришлет уведомление на email.' - hint: 'При появлении новых комментариев Refinery пришлет уведомление на email.' - example: "Введите адреса эл. почты, например: jack@work.com, jill@office.com" - updated: 'Получателем уведомлений является "%{recipients}"' - submenu: + admin: + categories: + category: + edit: Редактировать эту категорию + delete: Удалить эту категорию навсегда + index: + no_items_yet: 'Категории пока не созданы. Нажмите "%{create}", чтобы добавить вашу первую категорию.' + comments: + approved: 'Комментарий от "%{author}" был опубликован.' + comment: + view_live_html: Посмотреть комментарий на сайте
    (откроется в новом окне) + 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: Посмотреть запись на сайте
    (откроется в новом окне) + edit: Редактировать запись + delete: Удалить запись + settings: + 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: Комментарии + 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: Категории - manage: Редактировать категории - new: Создать новую категорию - comments: - title: Комментарии - title_with_count: 'Комментарии (%{new_count} новых)' - new: Новые - unmoderated: Новые - approved: Принятые - rejected: Отклоненные + rss_feed: + title: RSS-лента + subscribe: Подписаться 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: - 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: Вернуться к списку записей + other: Другие записи + created_at: 'Опубликовано %{when}' + read_more: Читать дальше comments: - title: Комментарии - add: Написать комментарий - other: Другие записи - filed_in: Категория - submit: Отправить комментарий - archive: - blog_archive_for: 'Архив %{date}' - no_blog_articles_posted: 'Ни одной записи за %{date} не опубликовано. Следите за новостями.' + 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: Вернуться к списку записей + 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..99888af 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1,128 +1,128 @@ sk: - plugins: - refinerycms_blog: - title: Blog - admin: + refinery: + plugins: + refinerycms_blog: + title: Blog 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
    (otvorí nové okno)' - 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 + admin: + 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
    (otvorí nové okno)' + 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
    (otvorí ho v novom okne)' + 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 + 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
    (otvorí ho v novom okne)' - 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: - categories: - title: Kategórie - rss_feed: - title: RSS zdroj článkov - subscribe: Prihlásiť k odberu - 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 + other: Ďaľšie články + created_at: 'Publikovaný %{when}' + read_more: Celý článok 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}.' + singular: komentár + none: Niesu tu žiadne komentáre + archives: Archív + categories: + show: + no_posts: Niesu 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 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/sv.yml b/config/locales/sv.yml new file mode 100644 index 0000000..24f1bac --- /dev/null +++ b/config/locales/sv.yml @@ -0,0 +1,167 @@ +sv: + refinery: + plugins: + refinerycms_blog: + title: Blogg + blog: + admin: + categories: + category: + edit: Editera kategori + delete: Radera kategori + index: + no_items_yet: 'Det finns inga kategorier än. Klicka på "%{create}" för att lägga till den första kategorin.' + comments: + approved: 'Kommentaren från "%{author}" Har godkänts.' + comment: + view_live_html: 'Visa kommentaren på webbplatsen.
    (öppnas i ett nytt fönster)' + read: Läs denna kommentar + reject: Avslå kommentar + approve: Godkänn kommentar + rejected: 'Kommentaren från "%{author}" har avslagits.' + index: + no_items_yet: 'Det finns inga %{type} kommentarer.' + show: + comment: Kommentar + blog_post: Blogg post + from: Postat av + date: Postat + message: Kommentar + details: Detaljer + age: Ålder + actions: Actions + back: Tillbaka till alla kommentarer + reject: Avslå denna kommentar + approve: Godkänn denna kommentar + posts: + form: + advanced_options: Avancerat + toggle_advanced_options: Klicka för att ställa in metataggar och menyinställningar + save_as_draft: Spara som utkast + published_at: Publiceringsdatum + custom_url: Anpassad URL + custom_url_help: Skapa URL för bloggposten med denna text istället för ttieln + source_url: Källans URL + source_url_help: Sparar URL för postens källa + source_url_title: Källhänvisning (titel) + source_url_title_help: Källhänvisning för posten (URL). + author: Författare + author_help: Ställ in författare för denna post. + copy_body: Kopiera innehåll i posten till en teaser. + copy_body_help: Kopierar inneållet i posten till en teaser, lämna tom om du vill att det ska ske automatiskt. + index: + no_items_yet: 'Det finns inga poster än. Klicka "%{create}" för att lägga till din första post.' + uncategorized: + no_items_yet: 'Det finns inga okategoriserade poster.' + post: + view_live_html: 'Visa denna post i en webbläsare
    (öppnas i ett nytt fönster)' + edit: Redigera denna bloggpost + delete: Ta bort denna bloggpost + draft: Utkast + settings: + notification_recipients: + value: Skicka notis till + explanation: 'Varje gång någon kommenterar på en post, skickas ett mail om kommentaren.' + hint: 'När en kommentar läggs till, så skickar vi en notis till dig.' + example: "Lägg till epostadress(er) i detta format: kalle@home.se, pelle@work.com" + updated: 'Notiser har blivit skickade till: "%{recipients}"' + submenu: + categories: + title: Kategorier + manage: Hantera + new: Skapa ny kategori + comments: + title: Kommentarer + title_with_count: 'Det finns (%{new_count} nya kommentarer)' + new: Ny + unmoderated: Ny + approved: Godkänd + rejected: Avslagen + posts: + title: Poster + manage: Hantera poster + new: Skapa ny post + uncategorized: Okategoriserade poster + settings: + title: Inställningar + moderation: Moderering + update_notified: Uppdarea vilka som får notiser + comments: Kommentarer + teasers: Teasers + comment_mailer: + notification: + greeting: Hej! + you_recieved_new_comment: Du har fått en ny kommentar på bloggenYou just received a new comment on your website. + comment_starts: --- kommentar --- + comment_ends: --- // kommentar --- + from: Från + email: E-post + message: Meddelande + closing_line: Vänliga hälsningar + ps: 'P.S. Alla dina kommentarer finns lagrade i bloggsektionen av ditt CMS i undermenyn kommentarer, om du vill se dem senare.' + shared: + categories: + title: Kategorier + rss_feed: + title: RSS + subscribe: Prenumerera + posts: + other: Övriga poster + created_at: 'Postat den %{when}' + read_more: Läs mer + comments: + singular: Kommentar + none: Inga kommentarer + archives: Arkiv + tags: + title: "Taggar" + categories: + show: + no_posts: Det finns inga poster än. + posts: + post: + filed_in: Kategoriserat som + comment: kommentar + comments: + by: 'Postad av %{who}' + time_ago: 'för %{time} sedan' + thank_you: 'Tack för din kommentar.' + thank_you_moderated: 'Tack för din kommentar. Ditt meddelande har placerats i modereringskön och kommer snart att bli publicerat.' + index: + no_blog_articles_yet: Det finns inga bloggposter än. + show: + blog_home: Blogg hem + comments: + title: Kommentarer + add: Kommentera + other: Andra bloggposter + filed_in: Kategoriserat i + tagged: Taggar + submit: Skicka kommentar + name: Namn + email: E-post + message: Meddelande + by: av + source: Källa + tagged: + no_blog_articles_yet: Det finns inga bloggposter än. + posts_tagged: Poster taggade med + archive: + blog_archive_for: 'Arkiv för %{date}' + no_blog_articles_posted: 'Det finns inga artiklar för %{date}.' + activerecord: + models: + refinery/blog_category: Kategori + refinery/blog_comment: Kommentarer + refinery/blog_post: Bloggposter + attributes: + refinery/blog_category: + title: Titel + refinery/blog_comment: + name: Namn + email: E-post + message: Meddelande + refinery/blog_post: + title: Titel + body: Innehåll + teaser: Teaser diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index a3cafe5..894140d 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1,128 +1,128 @@ zh-CN: - plugins: - refinerycms_blog: - title: 博客 - admin: + refinery: + plugins: + refinerycms_blog: + title: 博客 blog: - categories: - category: - edit: 编辑此类别 - delete: 永久删除此类别 - index: - no_items_yet: '没有此类别。 点击 "%{create}" 添加第一次类别。' - comments: - approved: '评论来自 "%{author}" 已被审批。' - comment: - view_live_html: '查看此评论
    (opens in a new window)' - 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: '查看此博
    (opens in a new window)' - edit: 编辑此博 - delete: 永久删除此博 - settings: - notification_recipients: - value: 发送通知 - explanation: '每次有人发表评论,发送邮件告知有新评论。' - hint: '增加新评论时,将会发送邮件告知您。' - example: "输入您的邮件地址,如: jack@work.com, jill@office.com" - updated: '通知收件人已被设为 "%{recipients}"' - submenu: + admin: + categories: + category: + edit: 编辑此类别 + delete: 永久删除此类别 + index: + no_items_yet: '没有此类别。 点击 "%{create}" 添加第一次类别。' + comments: + approved: '评论来自 "%{author}" 已被审批。' + comment: + view_live_html: '查看此评论
    (opens in a new window)' + 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: '查看此博
    (opens in a new window)' + edit: 编辑此博 + delete: 永久删除此博 + settings: + 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: 评论 + 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: 分类 - manage: 管理 - new: 创建新的类别 - comments: - title: 评论 - title_with_count: '评论 (%{new_count} new)' - new: 新 - unmoderated: 新 - approved: 批准 - rejected: 驳回 + rss_feed: + title: RSS源 + subscribe: 订阅 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: - 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: 博客首页 + other: 其他博文 + created_at: '发表于 %{when}' + read_more: 阅读更多 comments: - title: 评论 - add: 发表评论 - other: 其他博文 - filed_in: 用户体验 - submit: 发送评论 - archive: - blog_archive_for: '博客存档 %{date}' - no_blog_articles_posted: '没有发布文章 %{date}。敬请关注。' + 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: 博客首页 + 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..fd7272d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,45 +1,49 @@ -::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' +Refinery::Core::Engine.routes.draw do + namespace :blog do + root :to => "posts#index" + resources :posts, :only => [:show] + + match 'feed.rss', :to => 'posts#index', :as => 'rss_feed', :defaults => {:format => "rss"} + match 'categories/:id', :to => 'categories#show', :as => 'category' + match ':id/comments', :to => 'posts#comment', :as => 'comments' + get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_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 + namespace :blog, :path => '' do + namespace :admin, :path => 'refinery' do + scope :path => '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..010102f --- /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::Blog::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 similarity index 95% rename from db/migrate/3_acts_as_taggable_on_migration.rb rename to 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/20120103055909_add_source_url_to_blog_posts.rb b/db/migrate/20120103055909_add_source_url_to_blog_posts.rb new file mode 100644 index 0000000..cd6fd27 --- /dev/null +++ b/db/migrate/20120103055909_add_source_url_to_blog_posts.rb @@ -0,0 +1,7 @@ +class AddSourceUrlToBlogPosts < ActiveRecord::Migration + def change + add_column Refinery::Blog::Post.table_name, :source_url, :string + add_column Refinery::Blog::Post.table_name, :source_url_title, :string + + end +end diff --git a/db/migrate/20120223022021_add_access_count_to_posts.rb b/db/migrate/20120223022021_add_access_count_to_posts.rb new file mode 100644 index 0000000..02cd131 --- /dev/null +++ b/db/migrate/20120223022021_add_access_count_to_posts.rb @@ -0,0 +1,8 @@ +class AddAccessCountToPosts < ActiveRecord::Migration + def change + add_column Refinery::Blog::Post.table_name, :access_count, :integer, :default => 0 + + add_index Refinery::Blog::Post.table_name, :access_count + + end +end \ No newline at end of file diff --git a/db/migrate/20120227022021_add_slug_to_posts_and_categories.rb b/db/migrate/20120227022021_add_slug_to_posts_and_categories.rb new file mode 100644 index 0000000..87d1291 --- /dev/null +++ b/db/migrate/20120227022021_add_slug_to_posts_and_categories.rb @@ -0,0 +1,9 @@ +class AddSlugToPostsAndCategories < ActiveRecord::Migration + def change + add_column Refinery::Blog::Post.table_name, :slug, :string + add_index Refinery::Blog::Post.table_name, :slug + + add_column Refinery::Blog::Category.table_name, :slug, :string + add_index Refinery::Blog::Category.table_name, :slug + end +end \ No newline at end of file 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/refinerycms_blog.rb b/db/seeds.rb similarity index 61% rename from db/seeds/refinerycms_blog.rb rename to db/seeds.rb index 0be2a06..91018db 100644 --- a/db/seeds/refinerycms_blog.rb +++ b/db/seeds.rb @@ -1,20 +1,19 @@ -::User.find(:all).each do |user| +Refinery::User.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) +end if defined?(Refinery::User) -if defined?(::Page) - page = ::Page.create( +if defined?(Refinery::Page) and !Refinery::Page.exists?(:link_url => '/blog') + page = Refinery::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| + Refinery::Pages.default_parts.each do |default_page_part| page.parts.create(:title => default_page_part, :body => nil) end -end \ No newline at end of file +end 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 deleted file mode 100644 index 3562315..0000000 --- a/lib/gemspec.rb +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env ruby -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$}} - -gemspec = < 1.0.3' - s.add_dependency 'filters_spam', '~> 0.2' - s.add_dependency 'acts-as-taggable-on' - s.add_dependency 'seo_meta', '~> 1.1.0' - - # Development dependencies - s.add_development_dependency 'factory_girl' - - s.files = %w( - #{files.join("\n ")} - ) - #{"s.test_files = %w( - #{Dir.glob("test/**/*.rb").join("\n ")} - )" if File.directory?("test")} -end -EOF - -File.open(File.expand_path("../../refinerycms-blog.gemspec", __FILE__), 'w').puts(gemspec) diff --git a/lib/generators/refinery/blog/blog_generator.rb b/lib/generators/refinery/blog/blog_generator.rb new file mode 100644 index 0000000..26e37d3 --- /dev/null +++ b/lib/generators/refinery/blog/blog_generator.rb @@ -0,0 +1,27 @@ +module Refinery + class BlogGenerator < Rails::Generators::Base + + source_root File.expand_path("../templates", __FILE__) + + def generate_blog_initializer + template "config/initializers/refinery/blog.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "blog.rb") + end + + def rake_db + rake("refinery_blog:install:migrations") + rake("refinery_settings:install:migrations") + end + + def append_load_seed_data + create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb')) + append_file 'db/seeds.rb', :verbose => true do + <<-EOH + +# Added by Refinery CMS Blog engine +Refinery::Blog::Engine.load_seed + EOH + end + end + + end +end diff --git a/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb b/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb new file mode 100644 index 0000000..ac340d7 --- /dev/null +++ b/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb @@ -0,0 +1,11 @@ +Refinery::Blog.configure do |config| + # config.validate_source_url = <%= Refinery::Blog.validate_source_url.inspect %> + + # config.comments_per_page = <%= Refinery::Blog.comments_per_page.inspect %> + + # config.posts_per_page = <%= Refinery::Blog.posts_per_page.inspect %> + + # config.post_teaser_length = <%= Refinery::Blog.post_teaser_length.inspect %> + + # config.share_this_key = <%= Refinery::Blog.share_this_key.inspect %> +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..52f73e0 --- /dev/null +++ b/lib/refinery/blog.rb @@ -0,0 +1,38 @@ +require 'refinerycms-core' +require 'refinerycms-settings' +require 'filters_spam' +require 'rails_autolink' +require 'acts_as_indexed' + +module Refinery + autoload :BlogGenerator, 'generators/refinery/blog/blog_generator' + + module Blog + require 'refinery/blog/engine' + require 'refinery/blog/configuration' + + 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 + end + end +end diff --git a/lib/refinery/blog/configuration.rb b/lib/refinery/blog/configuration.rb new file mode 100644 index 0000000..0f00501 --- /dev/null +++ b/lib/refinery/blog/configuration.rb @@ -0,0 +1,14 @@ +module Refinery + module Blog + include ActiveSupport::Configurable + + config_accessor :validate_source_url, :comments_per_page, :posts_per_page, + :post_teaser_length, :share_this_key + + self.validate_source_url = false + self.comments_per_page = 10 + self.posts_per_page = 10 + self.post_teaser_length = 250 + self.share_this_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + end +end diff --git a/lib/refinery/blog/engine.rb b/lib/refinery/blog/engine.rb new file mode 100644 index 0000000..f81e110 --- /dev/null +++ b/lib/refinery/blog/engine.rb @@ -0,0 +1,23 @@ +module Refinery + module Blog + class Engine < Rails::Engine + include Refinery::Engine + + isolate_namespace Refinery::Blog + + initializer "register refinerycms_blog plugin" do + Refinery::Plugin.register do |plugin| + plugin.pathname = root + plugin.name = "refinerycms_blog" + plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.blog_admin_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..25ffc26 100644 --- a/lib/refinery/blog/version.rb +++ b/lib/refinery/blog/version.rb @@ -1,17 +1,18 @@ module Refinery module Blog class Version - @major = 1 - @minor = 6 - @tiny = 2 + @major = 2 + @minor = 1 + @tiny = 0 + @build = 'dev' class << self - attr_reader :major, :minor, :tiny + attr_reader :major, :minor, :tiny, :build def to_s - [@major, @minor, @tiny].compact.join('.') + [@major, @minor, @tiny, @build].compact.join('.') end end end end -end \ No newline at end of file +end 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; -} diff --git a/readme.md b/readme.md index 32bf487..dfb2b64 100644 --- a/readme.md +++ b/readme.md @@ -2,29 +2,59 @@ 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.2.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: * Comment moderation -* [ShareThis.com](http://sharethis.com) support on posts. Set your key in Refinery's settings area to enable this. +* [ShareThis.com](http://sharethis.com) support on posts. To enable, set your key in Refinery's settings area. ## Requirements -Refinery CMS version 1.0.0 or above. +Refinery CMS version 2.0.1 or above. ## Install Open up your ``Gemfile`` and add at the bottom this line: - gem 'refinerycms-blog', '~> 1.6.1' +```ruby +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. +Run database migrations: - rake db:migrate \ No newline at end of file + rake db:migrate + +Finally seed your database and you're done. + + rake db:seed + +## 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 + +## More Information +* Check out our [Website](http://refinerycms.com/) +* Documentation is available in the [guides](http://refinerycms.com/guides) +* Questions can be asked on our [Google Group](http://group.refinerycms.org) +* Questions can also be asked in our IRC room, [#refinerycms on freenode](irc://irc.freenode.net/refinerycms) \ No newline at end of file diff --git a/refinerycms-blog.gemspec b/refinerycms-blog.gemspec index 51682fb..3449c93 100644 --- a/refinerycms-blog.gemspec +++ b/refinerycms-blog.gemspec @@ -1,202 +1,27 @@ +# Encoding: UTF-8 +$:.push File.expand_path('../lib', __FILE__) +require 'refinery/blog/version' + +version = Refinery::Blog::Version.to_s + Gem::Specification.new do |s| s.name = %q{refinerycms-blog} - s.version = %q{1.6.2} - 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.summary = %q{Ruby on Rails blogging engine for RefineryCMS.} + s.version = version + s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with Refinery CMS.} + s.summary = %q{Ruby on Rails blogging engine for Refinery CMS.} s.email = %q{info@refinerycms.com} s.homepage = %q{http://refinerycms.com/blog} s.authors = ['Resolve Digital', 'Neoteric Design'] s.require_paths = %w(lib) + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- spec/*`.split("\n") + # Runtime dependencies - s.add_dependency 'refinerycms-core', '~> 1.0.3' - s.add_dependency 'filters_spam', '~> 0.2' + s.add_dependency 'refinerycms-core', '~> 2.1.0.dev' + s.add_dependency 'refinerycms-settings', '~> 2.1.0.dev' + s.add_dependency 'filters_spam', '~> 0.2' s.add_dependency 'acts-as-taggable-on' - s.add_dependency 'seo_meta', '~> 1.1.0' - - # Development dependencies - s.add_development_dependency 'factory_girl' - - s.files = %w( - app - 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/helpers - app/helpers/blog_posts_helper.rb - app/mailers - app/mailers/blog - app/mailers/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/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 - changelog.md - config - config/locales - 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/nb.yml - config/locales/nl.yml - config/locales/pl.yml - config/locales/pt-BR.yml - config/locales/ru.yml - config/locales/sk.yml - config/locales/zh-CN.yml - 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 - lib - lib/gemspec.rb - lib/generators - lib/generators/refinerycms_blog_generator.rb - lib/refinery - lib/refinery/blog - lib/refinery/blog/tabs.rb - lib/refinery/blog/version.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 - readme.md - refinerycms-blog.gemspec - spec - spec/models - spec/models/blog_category_spec.rb - spec/models/blog_comment_spec.rb - spec/models/blog_post_spec.rb - ) - + s.add_dependency 'seo_meta', '~> 1.3.0' + s.add_dependency 'rails_autolink', '~> 1.0.7' 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/helpers/refinery/blog/posts_helper_spec.rb b/spec/helpers/refinery/blog/posts_helper_spec.rb new file mode 100644 index 0000000..b8c8911 --- /dev/null +++ b/spec/helpers/refinery/blog/posts_helper_spec.rb @@ -0,0 +1,71 @@ +require 'spec_helper' + +module Refinery + module Blog + describe PostsHelper do + describe "#blog_archive_widget" do + let(:html) { helper.blog_archive_widget(dates) } + let(:links) { Capybara.string(html).find("#blog_archive_widget ul") } + + context "with no archive dates" do + let(:dates) { [] } + + it "does not display anything" do + html.should be_blank + end + end + + context "with archive dates" do + let(:recent_post) { 2.months.ago } + let(:old_post) { 4.years.ago } + + let(:dates) do + [old_post, recent_post].map do |date| + [date, date.beginning_of_month, date.end_of_month] + end.flatten + end + + it "has a link for the month of dates not older than one year" do + month = Date::MONTHNAMES[recent_post.month] + year = recent_post.year + + links.should have_link("#{month} #{year} (3)") + end + + it "has a link for the year of dates older than one year" do + year = old_post.year + + links.should have_link("#{year} (3)") + end + + it "sorts recent links before old links" do + links.find("li:first").should have_content(recent_post.year.to_s) + links.find("li:last").should have_content(old_post.year.to_s) + end + end + + context "with multiple recent dates" do + let(:dates) { [3.months.ago, 2.months.ago] } + + it "sorts by the more recent date" do + first, second = dates.map {|p| Date::MONTHNAMES[p.month] } + + links.find("li:first").should have_content(second) + links.find("li:last").should have_content(first) + end + end + + context "with multiple old dates" do + let(:dates) { [5.years.ago, 4.years.ago] } + + it "sorts by the more recent date" do + first, second = dates.map {|p| p.year.to_s } + + links.find("li:first").should have_content(second) + links.find("li:last").should have_content(first) + end + end + end + end + end +end diff --git a/spec/lib/refinery/blog/engine_spec.rb b/spec/lib/refinery/blog/engine_spec.rb new file mode 100644 index 0000000..b64601a --- /dev/null +++ b/spec/lib/refinery/blog/engine_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +module Refinery + module Blog + describe Engine do + describe "plugin activity" do + let(:activity) do + Refinery::Plugins.registered.find_by_name("refinerycms_blog").activity.first + end + + it "sets the correct path for activity entries" do + activity.url.should eq("refinery.edit_blog_admin_post_path") + end + end + + describe ".load_seed" do + it "is idempotent" do + Engine.load_seed + Engine.load_seed + + Refinery::Page.where(:link_url => '/blog').count.should eq(1) + end + end + 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..7b0c9be --- /dev/null +++ b/spec/models/refinery/blog/post_spec.rb @@ -0,0 +1,233 @@ +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 + described_class.instance_methods.map(&:to_sym).should include(:author) + end + end + + describe "by_month" do + before do + @post1 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 11)) + @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" + described_class.by_month(Time.parse(date)).count.should be == 2 + described_class.by_month(Time.parse(date)).should == [@post2, @post1] + end + end + + describe ".published_dates_older_than" do + before do + @post1 = FactoryGirl.create(:blog_post, :published_at => Time.utc(2012, 05, 01, 15, 20)) + @post2 = FactoryGirl.create(:blog_post, :published_at => Time.utc(2012, 05, 01, 15, 30)) + FactoryGirl.create(:blog_post, :published_at => Time.now) + end + + it "returns all published dates older than the argument" do + expected = [@post2.published_at, @post1.published_at] + + described_class.published_dates_older_than(5.minutes.ago).should eq(expected) + end + end + + describe "live" do + before do + @post1 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -2)) + @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 + described_class.live.count.should be == 2 + described_class.live.should == [@post2, @post1] + end + end + + describe "uncategorized" 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 + described_class.uncategorized.should include @uncategorized_post + described_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 + Factory.build(:blog_post).should be_live + end + + it "returns false if post is in draft" do + Factory.build(:blog_post, :draft => true).should_not be_live + end + + it "returns false if post pub date is in future" do + Factory.build(:blog_post, :published_at => Time.now.advance(:minutes => 1)).should_not be_live + end + end + + describe "#next" do + before do + FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:days => -1)) + @post = FactoryGirl.create(:blog_post) + end + + it "returns next article when called on current article" do + described_class.last.next.should == @post + end + end + + describe "#prev" do + before do + FactoryGirl.create(:blog_post) + @post = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:days => -1)) + end + + it "returns previous article when called on current article" do + described_class.first.prev.should == @post + 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 + described_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 + described_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 + described_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 + described_class.teasers_enabled?.should be_false + end + end + end + + describe "source url" do + it "should allow a source url and title" do + p = FactoryGirl.create(:blog_post, :source_url => 'google.com', :source_url_title => 'author') + p.should be_valid + p.source_url.should include('google') + p.source_url_title.should include('author') + end + end + + describe ".validate_source_url?" do + context "with Refinery::Blog.validate_source_url set to true" do + before do + Refinery::Blog.validate_source_url = true + end + it "should have canonical url" do + p = FactoryGirl.create(:blog_post, :source_url => 'google.com', :source_url_title => 'google') + p.source_url.should include('www') + end + end + context "with Refinery::Blog.validate_source_url set to false" do + before do + Refinery::Blog.validate_source_url = false + end + it "should have original url" do + p = FactoryGirl.create(:blog_post, :source_url => 'google.com', :source_url_title => 'google') + p.source_url.should_not include('www') + end + end + end + + end + end +end diff --git a/spec/requests/refinery/blog/admin/categories_spec.rb b/spec/requests/refinery/blog/admin/categories_spec.rb new file mode 100644 index 0000000..c1809f7 --- /dev/null +++ b/spec/requests/refinery/blog/admin/categories_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "Categories admin" do + refinery_login_with :refinery_user + + let(:title) { "lol" } + + it "can create categories" do + visit refinery.admin_root_path + + within("nav#menu") { click_link "Blog" } + within("nav.multilist") { click_link "Create new category" } + + fill_in "Title", :with => title + click_button "Save" + + category = Refinery::Blog::Category.first + category.title.should eq(title) + end +end diff --git a/spec/requests/refinery/blog/admin/comments_spec.rb b/spec/requests/refinery/blog/admin/comments_spec.rb new file mode 100644 index 0000000..c834d13 --- /dev/null +++ b/spec/requests/refinery/blog/admin/comments_spec.rb @@ -0,0 +1,121 @@ +require "spec_helper" + +module Refinery + module Blog + module Admin + describe Comment do + refinery_login_with :refinery_user + + describe "#index" do + context "when has no new unapproved comments" do + before(:each) do + subject.class.delete_all + visit refinery.blog_admin_comments_path + end + + it "should list no comments" do + visit refinery.blog_admin_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.blog_admin_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 + subject.class.delete_all + visit refinery.approved_blog_admin_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 refinery.approved_blog_admin_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 + subject.class.delete_all + visit refinery.rejected_blog_admin_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 refinery.rejected_blog_admin_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.blog_admin_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 + end +end diff --git a/spec/requests/refinery/blog/admin/menu_spec.rb b/spec/requests/refinery/blog/admin/menu_spec.rb new file mode 100644 index 0000000..ba10ffe --- /dev/null +++ b/spec/requests/refinery/blog/admin/menu_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe "Blog menu entry" do + refinery_login_with :refinery_user + + it "is highlighted when managing the blog" do + visit refinery.admin_root_path + + within("#menu") { click_link "Blog" } + + page.should have_css("a.active", :text => "Blog") + end +end diff --git a/spec/requests/refinery/blog/admin/posts_spec.rb b/spec/requests/refinery/blog/admin/posts_spec.rb new file mode 100644 index 0000000..7972162 --- /dev/null +++ b/spec/requests/refinery/blog/admin/posts_spec.rb @@ -0,0 +1,175 @@ +require "spec_helper" + +module Refinery + module Blog + module Admin + describe Post do + refinery_login_with :refinery_user + + let!(:blog_category) { FactoryGirl.create(:blog_category, :title => "Video Games") } + + context "when no blog posts" do + before(:each) { subject.class.destroy_all } + + describe "blog post listing" do + before(:each) { visit refinery.blog_admin_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.blog_admin_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 "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 + subject.class.all.size.should eq(1) + end + + it "should belong to me" do + subject.class.first.author.should eq(::Refinery::User.last) + end + + it "should save categories" do + subject.class.last.categories.count.should eq(1) + subject.class.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 "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 + subject.class.all.size.should eq(1) + end + + it "should have the specified tags" do + subject.class.last.tag_list.sort.should eq(@tag_list.split(', ').sort) + 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.blog_admin_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 == refinery.edit_blog_admin_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 == refinery.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 refinery.uncategorized_blog_admin_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 refinery.uncategorized_blog_admin_posts_path + page.should_not have_content(blog_post.title) + end + end + end + + context "with multiple users" do + let!(:other_guy) { Factory(:refinery_user, :username => "Other Guy") } + + describe "create blog post with alternate author" do + before(:each) do + visit refinery.blog_admin_posts_path + click_link "Create new post" + + fill_in "Title", :with => "This is some other guy's blog post" + fill_in "post_body", :with => "I totally didn't write it." + + click_link "Advanced Options" + + select other_guy.username, :from => "Author" + + click_button "Save" + end + + it "should succeed" do + page.should have_content("was successfully added.") + end + + it "belongs to another user" do + subject.class.last.author.should eq(other_guy) + end + end + 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..3834992 --- /dev/null +++ b/spec/requests/refinery/blog/categories_spec.rb @@ -0,0 +1,24 @@ +require "spec_helper" + +module Refinery + describe "BlogCategories" do + refinery_login_with :refinery_user + + context "has one category and post" do + before(:each) do + @post = FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post") + @category = FactoryGirl.create(:blog_category, :title => "Video Games") + @post.categories << @category + @post.save! + end + + describe "show categories blog posts" do + before(:each) { visit refinery.blog_category_path(@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..3422dd2 --- /dev/null +++ b/spec/requests/refinery/blog/posts_spec.rb @@ -0,0 +1,160 @@ +require "spec_helper" + +module Refinery + describe "Blog::Posts" do + refinery_login_with :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 refinery.blog_post_path(blog_post) + + page.should have_content(blog_post.title) + end + + it "should display the blog rss feed" do + get refinery.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" + @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 refinery.blog_tagged_posts_path(@tag.id, @tag_name.parameterize) + + page.should have_content(@tag_name) + page.should have_content(@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 refinery.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 refinery.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 refinery.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 refinery.blog_post_path(blog_comment.post) + + page.should_not have_content(blog_comment.body) + end + end + + context "when posting comments" do + let(:blog_post) { Factory(:blog_post) } + let(:name) { "pete" } + let(:email) { "pete@mcawesome.com" } + let(:body) { "Witty comment." } + + before do + visit refinery.blog_post_path(blog_post) + + fill_in "Name", :with => name + fill_in "Email", :with => email + fill_in "Message", :with => body + click_button "Send comment" + end + + it "creates the comment" do + comment = blog_post.reload.comments.last + + comment.name.should eq(name) + comment.email.should eq(email) + comment.body.should eq(body) + end + end + + context "post popular" do + let(:blog_post) { FactoryGirl.create(:blog_post) } + let(:blog_post2) { FactoryGirl.create(:blog_post) } + + before do + visit refinery.blog_post_path(blog_post) + end + + it "should increment access count" do + blog_post.reload.access_count.should eq(1) + visit refinery.blog_post_path(blog_post) + blog_post.reload.access_count.should eq(2) + end + + it "should be most popular" do + Refinery::Blog::Post.popular(2).first.should eq(blog_post) + end + end + + context "post recent" do + let(:blog_post) { FactoryGirl.create(:blog_post) } + let(:blog_post2) { FactoryGirl.create(:blog_post) } + + before do + visit refinery.blog_post_path(blog_post2) + visit refinery.blog_post_path(blog_post) + end + + it "should be the most recent" do + Refinery::Blog::Post.recent(2).first.should eq(blog_post2) + 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 refinery.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 refinery.destroy_refinery_user_session_path } + + it "should not display the blog post" do + visit refinery.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..a313bbb --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,56 @@ +require 'rubygems' + +def setup_environment + # Configure Rails Environment + ENV["RAILS_ENV"] ||= 'test' + + require File.expand_path("../dummy/config/environment", __FILE__) + + require 'rspec/rails' + require 'capybara/rspec' + require 'factory_girl_rails' + + Rails.backtrace_cleaner.remove_silencers! + + RSpec.configure do |config| + config.mock_with :rspec + config.treat_symbols_as_metadata_keys_with_true_values = true + config.filter_run :focus => true + config.run_all_when_everything_filtered = true + end + + # set javascript driver for capybara + Capybara.javascript_driver = :selenium +end + +def each_run + ActiveSupport::Dependencies.clear + + FactoryGirl.reload + + # Requires supporting files with custom matchers and macros, etc, + # in ./support/ and its subdirectories including factories. + ([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p| + Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s] + }.flatten.sort.each do |support_file| + require support_file + end +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 do + # Loading more in this block will cause your tests to run faster. However, + # if you change any configuration or code from libraries loaded here, you'll + # need to restart spork for it take effect. + setup_environment + end + + Spork.each_run do + # This code will be run each time you run your specs. + each_run + end +else + setup_environment + each_run +end diff --git a/tasks/rspec.rake b/tasks/rspec.rake new file mode 100644 index 0000000..2ce7751 --- /dev/null +++ b/tasks/rspec.rake @@ -0,0 +1,4 @@ +require 'rspec/core/rake_task' + +desc "Run specs" +RSpec::Core::RakeTask.new