Commit a2a03f161eabecf71e7eae475bfe649ee344ae79

Authored by AntonioTerceiro
1 parent 9fd37c4c

ActionItem0: moving design_editor stuff to plugin



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@333 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/edit_template_controller.rb
@@ -6,6 +6,7 @@ class EditTemplateController < ApplicationController @@ -6,6 +6,7 @@ class EditTemplateController < ApplicationController
6 { 6 {
7 'ListBlock' => _("List Block"), 7 'ListBlock' => _("List Block"),
8 'LinkBlock' => _("Link Block"), 8 'LinkBlock' => _("Link Block"),
  9 + 'Design::MainBlock' => _('Main content block'),
9 } 10 }
10 end 11 end
11 12
@@ -23,4 +24,10 @@ class EditTemplateController < ApplicationController @@ -23,4 +24,10 @@ class EditTemplateController < ApplicationController
23 redirect_to :action => 'design_editor' 24 redirect_to :action => 'design_editor'
24 end 25 end
25 26
  27 + ############################################################
  28 + # FIXME: design_editor stuff: MOVE this to design plugin
  29 + ############################################################
  30 +
  31 + include EditTemplateHelper
  32 +
26 end 33 end
app/helpers/edit_template_helper.rb
1 -# Methods added to this helper will be available to all templates in the application. 1 +# Methods added to this helper will be available to all templates in the
  2 +# application.
2 module EditTemplateHelper 3 module EditTemplateHelper
3 4
4 end 5 end
app/views/edit_template/design_editor.rhtml
@@ -1,63 +0,0 @@ @@ -1,63 +0,0 @@
1 -<%= RedCloth.new(_('  
2 -  
3 -h1. Design editor (title)  
4 -  
5 -Here you have some sample text so you can see how your layout is going to look  
6 -like.  
7 -  
8 -h2. A subsection (heading level 2)  
9 -  
10 -h3. Heagind level 3  
11 -  
12 -h4. Heagind level 4  
13 -  
14 -h5. Heagind level 5  
15 -  
16 -h6. Heagind level 6  
17 -  
18 -Here is a somewhat long paragraph.  
19 -Here is a somewhat long paragraph.  
20 -Here is a somewhat long paragraph.  
21 -Here is a somewhat long paragraph.  
22 -Here is a somewhat long paragraph.  
23 -Here is a somewhat long paragraph.  
24 -Here is a somewhat long paragraph.  
25 -Here is a somewhat long paragraph.  
26 -Here is a somewhat long paragraph.  
27 -Here is a somewhat long paragraph.  
28 -Here is a somewhat long paragraph.  
29 -Here is a somewhat long paragraph.  
30 -Here is a somewhat long paragraph.  
31 -Here is a somewhat long paragraph.  
32 -Here is a somewhat long paragraph.  
33 -Here is a somewhat long paragraph.  
34 -Here is a somewhat long paragraph.  
35 -Here is a somewhat long paragraph.  
36 -Here is a somewhat long paragraph.  
37 -Here is a somewhat long paragraph.  
38 -Here is a somewhat long paragraph.  
39 -Here is a somewhat long paragraph.  
40 -Here is a somewhat long paragraph.  
41 -Here is a somewhat long paragraph.  
42 -Here is a somewhat long paragraph.  
43 -  
44 -A list of items:  
45 -  
46 -* first list item  
47 -* second list item  
48 -** you can have subitems too  
49 -* third list item  
50 -  
51 -a table:  
52 -  
53 -| *column 1* | *column 2* |  
54 -| row 1 | row 1 |  
55 -| row 2 | row 2 |  
56 -| row 3 | row 3 |  
57 -| row 4 | row 4 |  
58 -  
59 -A quote:  
60 -  
61 -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.  
62 -  
63 -')).to_html %>  
config/environment.rb
@@ -80,3 +80,12 @@ Comatose::AdminController.before_filter do |controller| @@ -80,3 +80,12 @@ Comatose::AdminController.before_filter do |controller|
80 end 80 end
81 controller.instance_variable_set('@virtual_community', virtual_community) 81 controller.instance_variable_set('@virtual_community', virtual_community)
82 end 82 end
  83 +
  84 +# taken from http://blog.spotstory.com/2007/04/19/upgrading-to-rails-12/
  85 +# Array of plugins with Application model dependencies.
  86 +reloadable_plugins = ["design"]
  87 +# Force these plugins to reload, avoiding stale object references.
  88 +reloadable_plugins.each do |plugin_name|
  89 + reloadable_path = RAILS_ROOT + "/vendor/plugins/#{plugin_name}/lib"
  90 + Dependencies.load_once_paths.delete(reloadable_path)
  91 +end
test/functional/edit_template_controller_test.rb
@@ -20,4 +20,8 @@ class EditTemplateControllerTest &lt; Test::Unit::TestCase @@ -20,4 +20,8 @@ class EditTemplateControllerTest &lt; Test::Unit::TestCase
20 assert_redirected_to :action => 'design_editor' 20 assert_redirected_to :action => 'design_editor'
21 end 21 end
22 22
  23 + #############################################################
  24 + # FIXME: design_editor stuff, move to design plugin
  25 + #############################################################
  26 +
23 end 27 end
test/test_helper.rb
1 ENV["RAILS_ENV"] = "test" 1 ENV["RAILS_ENV"] = "test"
2 require File.expand_path(File.dirname(__FILE__) + "/../config/environment") 2 require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3 require 'test_help' 3 require 'test_help'
  4 +require 'mocha'
4 5
5 class Test::Unit::TestCase 6 class Test::Unit::TestCase
6 # Transactional fixtures accelerate your tests by wrapping each test method 7 # Transactional fixtures accelerate your tests by wrapping each test method