diff --git a/.gitignore b/.gitignore index 02200c0..9c1a2c5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ doc/* *.autobackupbyrefinery.* /refinerycms-blog*.gem .autotest -spec/dummy # Mac .DS_Store @@ -43,12 +42,3 @@ 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 deleted file mode 100644 index 53607ea..0000000 --- a/.rspec +++ /dev/null @@ -1 +0,0 @@ ---colour diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f240b90..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -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 f9da5c3..84f127c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,70 +1,2 @@ -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 - 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' +gem 'filters_spam', '~> 0.3' +gem "will_paginate", ">= 2.3.14" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..ae2c41e --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,11 @@ +GEM + specs: + filters_spam (0.3) + will_paginate (2.3.14) + +PLATFORMS + ruby + +DEPENDENCIES + filters_spam (~> 0.3) + will_paginate (>= 2.3.14) diff --git a/Guardfile b/Guardfile deleted file mode 100644 index 0de2882..0000000 --- a/Guardfile +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 743f388..0000000 --- a/Rakefile +++ /dev/null @@ -1,19 +0,0 @@ -#!/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/app/assets/images/refinerycms-blog/.gitkeep b/app/assets/images/refinerycms-blog/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/javascripts/refinery/blog/backend.js b/app/assets/javascripts/refinery/blog/backend.js deleted file mode 100644 index 695cdb7..0000000 --- a/app/assets/javascripts/refinery/blog/backend.js +++ /dev/null @@ -1,115 +0,0 @@ -$(document).ready(function(){ - $('nav#actions.multilist > ul:not(.search_list) li a[href$="' + window.location.pathname + '"]') - .parent().addClass('selected'); - if($('nav#actions.multilist > ul:not(.search_list) li.selected').length == 0) { - $('nav#actions.multilist > ul:not(.search_list) li a:nth(1)').parent().addClass('selected'); - } - - $('nav#actions.multilist > ul:not(.search_list) li > a').each(function(i,a){ - if ($(this).data('dialog-title') == null) { - $(this).bind('click', function(){ - $(this).css('background-image', "url('/images/refinery/icons/ajax-loader.gif') !important"); - }); - } - }); - - $('ul.collapsible_menu').each(function(i, ul) { - (first_li = $(this).children('li:first')).after(div=$("
")); - - $(" ").appendTo(first_li) - - if (($(this).children('li.selected')).length == 0) { - div.hide(); - first_li.addClass("closed"); - } - $(this).children('li:not(:first)').appendTo(div); - - first_li.find('> a, > span.arrow').click(function(e){ - $(this).parent().toggleClass("closed"); - $(this).parent().toggleClass("open"); - - $(this).parent().next('div').animate({ - opacity: 'toggle' - , height: 'toggle' - }, 250, $.proxy(function(){ - $(this).css('background-image', null); - }, $(this)) - ); - e.preventDefault(); - }); - }); - - $('.success_icon, .failure_icon').bind('click', function(e) { - $.get($(this).attr('href'), $.proxy(function(data){ - $(this).css('background-image', null) - .removeClass('failure_icon').removeClass('success_icon') - .addClass(data.enabled ? 'success_icon' : 'failure_icon'); - }, $(this))); - e.preventDefault(); - }); - - - $(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/app/assets/javascripts/refinerycms-blog/.gitkeep b/app/assets/javascripts/refinerycms-blog/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/stylesheets/refinery/blog/backend.css.scss b/app/assets/stylesheets/refinery/blog/backend.css.scss deleted file mode 100644 index 7e2a841..0000000 --- a/app/assets/stylesheets/refinery/blog/backend.css.scss +++ /dev/null @@ -1,73 +0,0 @@ -.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/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index 954e22d..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index 64ece57..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index abdc010..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index 9b383f4..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index a23baad..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index 42ccba2..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index 39d5824..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index f127367..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/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 deleted file mode 100755 index 359397a..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_222222_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_222222_256x240.png deleted file mode 100755 index b273ff1..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_228ef1_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_228ef1_256x240.png deleted file mode 100755 index a641a37..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_228ef1_256x240.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ef8c08_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ef8c08_256x240.png deleted file mode 100755 index 85e63e9..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ef8c08_256x240.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffd27a_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffd27a_256x240.png deleted file mode 100755 index e117eff..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffd27a_256x240.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffffff_256x240.png b/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffffff_256x240.png deleted file mode 100755 index 42f8f99..0000000 Binary files a/app/assets/stylesheets/refinery/blog/ui-lightness/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss b/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss deleted file mode 100755 index f9a1401..0000000 --- a/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss +++ /dev/null @@ -1,330 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.13 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } -.ui-autocomplete{ background:#fff; border:solid #ccc; border-width:0 1px 1px; } - -/* - * jQuery UI CSS Framework 1.8.13 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px - */ - - -/* Interaction states -----------------------------------*/ - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* - * jQuery UI Autocomplete 1.8.13 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete#theming - */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu 1.8.13 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} - diff --git a/app/assets/stylesheets/refinerycms-blog/.gitkeep b/app/assets/stylesheets/refinerycms-blog/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/controllers/.gitkeep b/app/controllers/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/controllers/admin/blog/categories_controller.rb b/app/controllers/admin/blog/categories_controller.rb new file mode 100644 index 0000000..fe15a0b --- /dev/null +++ b/app/controllers/admin/blog/categories_controller.rb @@ -0,0 +1,7 @@ +class Admin::Blog::CategoriesController < Admin::BaseController + + crudify :blog_category, + :title_attribute => :title, + :order => 'title ASC' + +end diff --git a/app/controllers/admin/blog/comments_controller.rb b/app/controllers/admin/blog/comments_controller.rb new file mode 100644 index 0000000..0dc1db5 --- /dev/null +++ b/app/controllers/admin/blog/comments_controller.rb @@ -0,0 +1,36 @@ +class Admin::Blog::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('admin.blog.comments.approved', :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('admin.blog.comments.rejected', :author => @blog_comment.name) + redirect_to :action => params[:return_to] || 'index' + end + end + +end diff --git a/app/controllers/admin/blog/posts_controller.rb b/app/controllers/admin/blog/posts_controller.rb new file mode 100644 index 0000000..bd5dd49 --- /dev/null +++ b/app/controllers/admin/blog/posts_controller.rb @@ -0,0 +1,14 @@ +class Admin::Blog::PostsController < Admin::BaseController + + crudify :blog_post, + :title_attribute => :title, + :order => 'published_at DESC' + + before_filter :find_all_categories, + :only => [:new, :edit, :create, :update] + +protected + def find_all_categories + @blog_categories = BlogCategory.find(:all) + end +end diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb new file mode 100644 index 0000000..cc9261b --- /dev/null +++ b/app/controllers/admin/blog/settings_controller.rb @@ -0,0 +1,27 @@ +class Admin::Blog::SettingsController < Admin::BaseController + + def notification_recipients + @recipients = BlogComment::Notification.recipients + + if request.post? + BlogComment::Notification.recipients = params[:recipients] + flash[:notice] = t('admin.blog.settings.notification_recipients.updated', + :recipients => BlogComment::Notification.recipients) + unless request.xhr? or from_dialog? + redirect_back_or_default(admin_blog_posts_path) + else + render :text => "" + 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} + end + end + +end diff --git a/app/controllers/blog/categories_controller.rb b/app/controllers/blog/categories_controller.rb new file mode 100644 index 0000000..4795e99 --- /dev/null +++ b/app/controllers/blog/categories_controller.rb @@ -0,0 +1,7 @@ +class Blog::CategoriesController < BlogController + + def show + @category = BlogCategory.find(params[:id]) + end + +end diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb new file mode 100644 index 0000000..eabb742 --- /dev/null +++ b/app/controllers/blog/posts_controller.rb @@ -0,0 +1,68 @@ +class Blog::PostsController < BlogController + + before_filter :find_all_blog_posts, :except => [:archive] + before_filter :find_blog_post, :only => [:show, :comment, :update_nav] + + def index + # TODO: respond_to block + end + + def show + @blog_comment = BlogComment.new + + # TODO: respond_to block + 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.deliver_notification(@blog_comment, request) + rescue + logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" + end + end + + if BlogComment::Moderation.enabled? + flash[:notice] = t('blog.posts.comments.thank_you_moderated') + redirect_to blog_post_url(params[:id]) + else + flash[:notice] = t('blog.posts.comments.thank_you') + redirect_to blog_post_url(params[:id], + :anchor => "comment-#{@blog_comment.to_param}") + end + else + render :action => 'show' + end + end + + def archive + date = "#{params[:month]}/#{params[:year]}" + @archive_date = Time.parse(date) + @blog_posts = BlogPost.live.by_archive(@archive_date).paginate({ + :page => params[:page], + :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) + }) + # TODO: respond_to block + 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.paginate({ + :page => params[:page], + :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) + }) + end + +end diff --git a/app/controllers/blog_controller.rb b/app/controllers/blog_controller.rb new file mode 100644 index 0000000..f51d5bb --- /dev/null +++ b/app/controllers/blog_controller.rb @@ -0,0 +1,16 @@ +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 deleted file mode 100644 index 0a3b7b9..0000000 --- a/app/controllers/refinery/blog/admin/categories_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 8565b28..0000000 --- a/app/controllers/refinery/blog/admin/comments_controller.rb +++ /dev/null @@ -1,49 +0,0 @@ -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 deleted file mode 100644 index b379a24..0000000 --- a/app/controllers/refinery/blog/admin/posts_controller.rb +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100644 index 68daa19..0000000 --- a/app/controllers/refinery/blog/admin/settings_controller.rb +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100644 index 54a8b03..0000000 --- a/app/controllers/refinery/blog/blog_controller.rb +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 467726e..0000000 --- a/app/controllers/refinery/blog/categories_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index caa46ec..0000000 --- a/app/controllers/refinery/blog/posts_controller.rb +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100644 index e69de29..0000000 diff --git a/app/helpers/blog_posts_helper.rb b/app/helpers/blog_posts_helper.rb new file mode 100644 index 0000000..53bdb75 --- /dev/null +++ b/app/helpers/blog_posts_helper.rb @@ -0,0 +1,28 @@ +module BlogPostsHelper + def blog_archive_list + posts = BlogPost.select('published_at').all_previous + return nil if posts.blank? + html = '<%= t('admin.search_no_results') %>
+ <% end %> + <% else %> + <% if @blog_categories.any? %> + <%= will_paginate @blog_categories, + :previous_label => '«', + :next_label => '»' %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_categories, + :previous_label => '«', + :next_label => '»' %> + <% else %> ++ + <%= t('.no_items_yet', :create => t('admin.blog.submenu.categories.new')) %> + +
+ <% end %> + <% end %> +<%= t('admin.search_no_results') %>
+ <% end %> + <% else %> + <% if @blog_comments.any? %> + <%=# will_paginate @blog_comments + %> + + <%= render :partial => "sortable_list" %> + + <%=# will_paginate @blog_comments + %> + <% else %> ++ <%= t('.age') %>: <%= time_ago_in_words(@blog_comment.created_at) %> +
++ <%= 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", " ") %> + + |
+
+ <%= 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" %> + +<%= t('admin.search_no_results') %>
+ <% end %> + <% else %> + <% if @blog_posts.any? %> + <%= will_paginate @blog_posts, + :previous_label => '«', + :next_label => '»' %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_posts, + :previous_label => '«', + :next_label => '»' %> + <% else %> ++ + <%= t('.no_items_yet', :create => t('admin.blog.submenu.posts.new')) %> + +
+ <% end %> + <% end %> ++ <%= 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/comment_mailer/notification.html.erb b/app/views/blog/comment_mailer/notification.html.erb new file mode 100644 index 0000000..b75020d --- /dev/null +++ b/app/views/blog/comment_mailer/notification.html.erb @@ -0,0 +1,17 @@ +<%= t('.greeting') %>, + +<%= t('.you_recieved_new_comment') %> + +<%= t('.comment_starts') %> + +<%= t('.from') %>: <%= @comment.name %> +<%= t('.email') %>: <%= @comment.email %> +<%= t('.message') %>: +<%= @comment.body %> + +<%= t('.comment_ends') %> + +<%= t('.closing_line') %>, +<%= RefinerySetting[:site_name] %> + +<%= t('.ps') %> diff --git a/app/views/blog/posts/_comment.html.erb b/app/views/blog/posts/_comment.html.erb new file mode 100644 index 0000000..71eab30 --- /dev/null +++ b/app/views/blog/posts/_comment.html.erb @@ -0,0 +1,11 @@ + diff --git a/app/views/blog/posts/_nav.html.erb b/app/views/blog/posts/_nav.html.erb new file mode 100644 index 0000000..50391ee --- /dev/null +++ b/app/views/blog/posts/_nav.html.erb @@ -0,0 +1,13 @@ +<% if next_or_previous?(@blog_post) -%> + +<% end -%> diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb new file mode 100644 index 0000000..6fb8e64 --- /dev/null +++ b/app/views/blog/posts/_post.html.erb @@ -0,0 +1,34 @@ +<% flash.each do |key, value| %> +There are no blog articles posted yet. Stay tuned.
".html_safe unless @blog_posts.any? %> + <%# TODO: Add locale logic here - hubble is a n00b at that %> +<% end %> + +<% content_for :body_content_right do %> + <%= @page[Page.default_parts.second.to_sym] %> + + <%= render :partial => "/blog/shared/categories" %> + <%= 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 new file mode 100644 index 0000000..51fa4da --- /dev/null +++ b/app/views/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 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 new file mode 100644 index 0000000..ed154ea --- /dev/null +++ b/app/views/blog/posts/show.html.erb @@ -0,0 +1,75 @@ +<% content_for :body_content_left do %> +<%= 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 %> -<%= t('search_no_results', :scope => 'admin') %>
- <% end %> - <% else %> - <% if @comments.any? %> - <%= will_paginate @comments %> - - <%= render "sortable_list" %> - - <%= will_paginate @comments %> - <% else %> -- <%= t('.age') %>: <%= time_ago_in_words(@comment.created_at) %> -
-- <%= 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", " ") %> - - |
-
- <%= f.check_box :draft %> - <%= f.label :draft, t('.save_as_draft'), :class => "stripped" %> -
-- <%= link_to t('.advanced_options'), "#", - :id => 'toggle_advanced_options', - :title => t('.toggle_advanced_options') %> -
-<%= 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 %> -<%= 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 %> -- <%= 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/refinery/blog/comment_mailer/notification.html.erb b/app/views/refinery/blog/comment_mailer/notification.html.erb deleted file mode 100644 index 8bf642e..0000000 --- a/app/views/refinery/blog/comment_mailer/notification.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<%=raw t('.greeting') %>, - -<%=raw t('.you_recieved_new_comment') %> - -<%=raw t('.comment_starts') %> - -<%=raw t('.from') %>: <%= @comment.name %> -<%=raw t('.email') %>: <%= @comment.email %> -<%=raw t('.message') %>: -<%=simple_format strip_tags(@comment.body) %> - -<%=raw t('.comment_ends') %> - -<%=raw t('.closing_line') %>, -<%=raw Refinery::Core.site_name %> - -<%=raw t('.ps') %> diff --git a/app/views/refinery/blog/posts/_comment.html.erb b/app/views/refinery/blog/posts/_comment.html.erb deleted file mode 100644 index 659f433..0000000 --- a/app/views/refinery/blog/posts/_comment.html.erb +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/app/views/refinery/blog/posts/_comments.html.erb b/app/views/refinery/blog/posts/_comments.html.erb deleted file mode 100644 index d662a1f..0000000 --- a/app/views/refinery/blog/posts/_comments.html.erb +++ /dev/null @@ -1,40 +0,0 @@ - diff --git a/app/views/refinery/blog/posts/_nav.html.erb b/app/views/refinery/blog/posts/_nav.html.erb deleted file mode 100644 index eafd35e..0000000 --- a/app/views/refinery/blog/posts/_nav.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/app/views/refinery/blog/posts/_post.html.erb b/app/views/refinery/blog/posts/_post.html.erb deleted file mode 100644 index 9811dd2..0000000 --- a/app/views/refinery/blog/posts/_post.html.erb +++ /dev/null @@ -1,37 +0,0 @@ -<% flash.each do |key, value| %> -<%= 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 deleted file mode 100644 index 772f2ec..0000000 --- a/app/views/refinery/blog/posts/index.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<% content_for :body do %> - <%= raw @page.content_for(Refinery::Pages.default_parts.first.to_sym) if Refinery::Pages.default_parts.any? %> - - <% if @posts.any? %> -<%= 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 deleted file mode 100644 index 8ffacd4..0000000 --- a/app/views/refinery/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 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 deleted file mode 100644 index d7abd1e..0000000 --- a/app/views/refinery/blog/posts/show.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<% content_for :body do %> -<%= 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 deleted file mode 100644 index b614dca..0000000 --- a/app/views/refinery/blog/shared/_body_content_right.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% 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/refinery/blog/shared/_categories.html.erb b/app/views/refinery/blog/shared/_categories.html.erb deleted file mode 100644 index 64f4ee6..0000000 --- a/app/views/refinery/blog/shared/_categories.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% if @categories.any? %> -