Commit 602ae1ff4d81851d10817d4255dc56aacfccbeb4

Authored by AntonioTerceiro
1 parent 76248135

ActionItem18: dealing with comatose's black magic



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@380 3f533792-8f58-4932-b0fe-aaf55b0a4547
lib/comatose_extensions.rb 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +
  2 +# FIXME: for some reason adding the following makes comatose migration to not
  3 +# work
  4 +
  5 +#def (Comatose::Page).icon
  6 +# 'text-x-generic'
  7 +#end
... ...
lib/comatose_integration.rb
... ... @@ -1,31 +0,0 @@
1   -require 'comatose'
2   -
3   -def (Comatose::Page).icon
4   - 'text-x-generic'
5   -end
6   -
7   -Comatose.configure do |config|
8   - config.admin_get_root_page do
9   - Comatose::Page.find_by_path(request.parameters[:profile])
10   - end
11   - config.admin_authorization do |config|
12   - Profile.exists?(:identifier => request.parameters[:profile])
13   - # FIXME: also check permissions
14   - end
15   - config.admin_includes << :authenticated_system
16   - config.admin_helpers << :application_helper
17   - config.admin_helpers << :document_helper
18   -end
19   -Comatose::AdminController.design :holder => 'virtual_community'
20   -Comatose::AdminController.before_filter do |controller|
21   - # TODO: copy/paste; extract this into a method (see
22   - # app/controllers/application.rb)
23   - domain = Domain.find_by_name(controller.request.host)
24   - if domain.nil?
25   - virtual_community = VirtualCommunity.default
26   - else
27   - virtual_community = domain.virtual_community
28   - profile = domain.profile
29   - end
30   - controller.instance_variable_set('@virtual_community', virtual_community)
31   -end