Commit 6f63b94b06ed35c3abcaa5119d10e62acefb46ea
1 parent
790e2816
Exists in
master
and in
28 other branches
ActionItem19: fixing routing bugs for design plugin
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@830 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
9 additions
and
5 deletions
Show diff stats
app/controllers/profile_admin/profile_editor_controller.rb
@@ -13,7 +13,7 @@ class ProfileEditorController < ProfileAdminController | @@ -13,7 +13,7 @@ class ProfileEditorController < ProfileAdminController | ||
13 | ] | 13 | ] |
14 | end | 14 | end |
15 | 15 | ||
16 | -# Put other Blocks to works | 16 | +# FIXME Put other Blocks to works |
17 | # def block_types | 17 | # def block_types |
18 | # { | 18 | # { |
19 | # 'ListBlock' => _("List of People"), | 19 | # 'ListBlock' => _("List of People"), |
db/migrate/001_add_design_support.rb
1 | class AddDesignSupport < ActiveRecord::Migration | 1 | class AddDesignSupport < ActiveRecord::Migration |
2 | def self.up | 2 | def self.up |
3 | - | ||
4 | create_table :design_boxes do |t| | 3 | create_table :design_boxes do |t| |
5 | t.column :name, :string | 4 | t.column :name, :string |
6 | t.column :title, :string | 5 | t.column :title, :string |
@@ -10,12 +9,11 @@ class AddDesignSupport < ActiveRecord::Migration | @@ -10,12 +9,11 @@ class AddDesignSupport < ActiveRecord::Migration | ||
10 | end | 9 | end |
11 | 10 | ||
12 | create_table :design_blocks do |t| | 11 | create_table :design_blocks do |t| |
13 | - t.column :name, :string | ||
14 | t.column :title, :string | 12 | t.column :title, :string |
15 | t.column :box_id, :integer | 13 | t.column :box_id, :integer |
16 | t.column :position, :integer | 14 | t.column :position, :integer |
17 | t.column :type, :string | 15 | t.column :type, :string |
18 | - t.column :helper, :string | 16 | + t.column :settings, :text |
19 | end | 17 | end |
20 | 18 | ||
21 | end | 19 | end |
lib/noosfero.rb
@@ -4,7 +4,13 @@ module Noosfero | @@ -4,7 +4,13 @@ module Noosfero | ||
4 | SVN_ROOT = 'https://svn.colivre.coop.br/svn/noosfero' | 4 | SVN_ROOT = 'https://svn.colivre.coop.br/svn/noosfero' |
5 | 5 | ||
6 | def self.controllers_in_directory(dir) | 6 | def self.controllers_in_directory(dir) |
7 | - Dir.glob(File.join(RAILS_ROOT, 'app', 'controllers', dir, '*_controller.rb')).map do |item| | 7 | + app_controller_path = Dir.glob(File.join(RAILS_ROOT, 'app', 'controllers', dir, '*_controller.rb')) |
8 | + | ||
9 | + # FIXME we can remove this line here if the controllers needed by application are not loaded | ||
10 | + # directly | ||
11 | + design_controller_path = Dir.glob(File.join(RAILS_ROOT, 'app', 'design_blocks', '*', 'controllers', '*_controller.rb')) | ||
12 | + | ||
13 | + (app_controller_path + design_controller_path).map do |item| | ||
8 | item.gsub(/^.*\/([^\/]+)_controller.rb$/, '\1') | 14 | item.gsub(/^.*\/([^\/]+)_controller.rb$/, '\1') |
9 | end | 15 | end |
10 | end | 16 | end |