From 6f63b94b06ed35c3abcaa5119d10e62acefb46ea Mon Sep 17 00:00:00 2001 From: LeandroNunes Date: Fri, 26 Oct 2007 13:34:52 +0000 Subject: [PATCH] ActionItem19: fixing routing bugs for design plugin --- app/controllers/profile_admin/profile_editor_controller.rb | 2 +- db/migrate/001_add_design_support.rb | 4 +--- lib/noosfero.rb | 8 +++++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/controllers/profile_admin/profile_editor_controller.rb b/app/controllers/profile_admin/profile_editor_controller.rb index 77c2c77..52e1c7a 100644 --- a/app/controllers/profile_admin/profile_editor_controller.rb +++ b/app/controllers/profile_admin/profile_editor_controller.rb @@ -13,7 +13,7 @@ class ProfileEditorController < ProfileAdminController ] end -# Put other Blocks to works +# FIXME Put other Blocks to works # def block_types # { # 'ListBlock' => _("List of People"), diff --git a/db/migrate/001_add_design_support.rb b/db/migrate/001_add_design_support.rb index 5cb45dc..bb4f4b0 100644 --- a/db/migrate/001_add_design_support.rb +++ b/db/migrate/001_add_design_support.rb @@ -1,6 +1,5 @@ class AddDesignSupport < ActiveRecord::Migration def self.up - create_table :design_boxes do |t| t.column :name, :string t.column :title, :string @@ -10,12 +9,11 @@ class AddDesignSupport < ActiveRecord::Migration end create_table :design_blocks do |t| - t.column :name, :string t.column :title, :string t.column :box_id, :integer t.column :position, :integer t.column :type, :string - t.column :helper, :string + t.column :settings, :text end end diff --git a/lib/noosfero.rb b/lib/noosfero.rb index 83cb9cc..af3e55f 100644 --- a/lib/noosfero.rb +++ b/lib/noosfero.rb @@ -4,7 +4,13 @@ module Noosfero SVN_ROOT = 'https://svn.colivre.coop.br/svn/noosfero' def self.controllers_in_directory(dir) - Dir.glob(File.join(RAILS_ROOT, 'app', 'controllers', dir, '*_controller.rb')).map do |item| + app_controller_path = Dir.glob(File.join(RAILS_ROOT, 'app', 'controllers', dir, '*_controller.rb')) + + # FIXME we can remove this line here if the controllers needed by application are not loaded + # directly + design_controller_path = Dir.glob(File.join(RAILS_ROOT, 'app', 'design_blocks', '*', 'controllers', '*_controller.rb')) + + (app_controller_path + design_controller_path).map do |item| item.gsub(/^.*\/([^\/]+)_controller.rb$/, '\1') end end -- libgit2 0.21.2