From a2a03f161eabecf71e7eae475bfe649ee344ae79 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 14 Aug 2007 19:49:16 +0000 Subject: [PATCH] ActionItem0: moving design_editor stuff to plugin --- app/controllers/edit_template_controller.rb | 7 +++++++ app/helpers/edit_template_helper.rb | 3 ++- app/views/edit_template/design_editor.rhtml | 63 --------------------------------------------------------------- config/environment.rb | 9 +++++++++ test/functional/edit_template_controller_test.rb | 4 ++++ test/test_helper.rb | 1 + 6 files changed, 23 insertions(+), 64 deletions(-) delete mode 100644 app/views/edit_template/design_editor.rhtml diff --git a/app/controllers/edit_template_controller.rb b/app/controllers/edit_template_controller.rb index 09d0f4a..599e7c8 100644 --- a/app/controllers/edit_template_controller.rb +++ b/app/controllers/edit_template_controller.rb @@ -6,6 +6,7 @@ class EditTemplateController < ApplicationController { 'ListBlock' => _("List Block"), 'LinkBlock' => _("Link Block"), + 'Design::MainBlock' => _('Main content block'), } end @@ -23,4 +24,10 @@ class EditTemplateController < ApplicationController redirect_to :action => 'design_editor' end + ############################################################ + # FIXME: design_editor stuff: MOVE this to design plugin + ############################################################ + + include EditTemplateHelper + end diff --git a/app/helpers/edit_template_helper.rb b/app/helpers/edit_template_helper.rb index 0157adb..2054c28 100644 --- a/app/helpers/edit_template_helper.rb +++ b/app/helpers/edit_template_helper.rb @@ -1,4 +1,5 @@ -# Methods added to this helper will be available to all templates in the application. +# Methods added to this helper will be available to all templates in the +# application. module EditTemplateHelper end diff --git a/app/views/edit_template/design_editor.rhtml b/app/views/edit_template/design_editor.rhtml deleted file mode 100644 index 4a481e9..0000000 --- a/app/views/edit_template/design_editor.rhtml +++ /dev/null @@ -1,63 +0,0 @@ -<%= RedCloth.new(_(' - -h1. Design editor (title) - -Here you have some sample text so you can see how your layout is going to look -like. - -h2. A subsection (heading level 2) - -h3. Heagind level 3 - -h4. Heagind level 4 - -h5. Heagind level 5 - -h6. Heagind level 6 - -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. -Here is a somewhat long paragraph. - -A list of items: - -* first list item -* second list item -** you can have subitems too -* third list item - -a table: - -| *column 1* | *column 2* | -| row 1 | row 1 | -| row 2 | row 2 | -| row 3 | row 3 | -| row 4 | row 4 | - -A quote: - -bq. this is cited text. It was written originally by someone else, and is displayed like this so you can see that it was not written by me. - -')).to_html %> diff --git a/config/environment.rb b/config/environment.rb index 4530deb..6d153ad 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -80,3 +80,12 @@ Comatose::AdminController.before_filter do |controller| end controller.instance_variable_set('@virtual_community', virtual_community) end + +# taken from http://blog.spotstory.com/2007/04/19/upgrading-to-rails-12/ +# Array of plugins with Application model dependencies. +reloadable_plugins = ["design"] +# Force these plugins to reload, avoiding stale object references. +reloadable_plugins.each do |plugin_name| + reloadable_path = RAILS_ROOT + "/vendor/plugins/#{plugin_name}/lib" + Dependencies.load_once_paths.delete(reloadable_path) +end diff --git a/test/functional/edit_template_controller_test.rb b/test/functional/edit_template_controller_test.rb index fb047d0..6853942 100644 --- a/test/functional/edit_template_controller_test.rb +++ b/test/functional/edit_template_controller_test.rb @@ -20,4 +20,8 @@ class EditTemplateControllerTest < Test::Unit::TestCase assert_redirected_to :action => 'design_editor' end + ############################################################# + # FIXME: design_editor stuff, move to design plugin + ############################################################# + end diff --git a/test/test_helper.rb b/test/test_helper.rb index eacdf90..16e6665 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,7 @@ ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' +require 'mocha' class Test::Unit::TestCase # Transactional fixtures accelerate your tests by wrapping each test method -- libgit2 0.21.2