Commit da1ced66a8d5715cd98900a68fbb71141167422d
1 parent
d9cebf53
Exists in
master
and in
29 other branches
ActionItem18: reverting comatose integration changes (broke something)
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@378 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
26 additions
and
2 deletions
Show diff stats
config/environment.rb
... | ... | @@ -55,5 +55,29 @@ end |
55 | 55 | require 'gettext/rails' |
56 | 56 | Tag.hierarchical = true |
57 | 57 | |
58 | -require 'comatose_integration' | |
59 | - | |
58 | +Comatose.configure do |config| | |
59 | + config.admin_get_root_page do | |
60 | + Comatose::Page.find_by_path(request.parameters[:profile]) | |
61 | + end | |
62 | + config.admin_authorization do |config| | |
63 | + Profile.exists?(:identifier => request.parameters[:profile]) | |
64 | + # FIXME: also check permissions | |
65 | + end | |
66 | + config.admin_includes << :authenticated_system | |
67 | + config.admin_helpers << :application_helper | |
68 | + config.admin_helpers << :document_helper | |
69 | +end | |
70 | +Comatose::AdminController.design :holder => 'virtual_community' | |
71 | +Comatose::AdminController.before_filter do |controller| | |
72 | + # TODO: copy/paste; extract this into a method (see | |
73 | + # app/controllers/application.rb) | |
74 | + domain = Domain.find_by_name(controller.request.host) | |
75 | + if domain.nil? | |
76 | + virtual_community = VirtualCommunity.default | |
77 | + else | |
78 | + virtual_community = domain.virtual_community | |
79 | + profile = domain.profile | |
80 | + end | |
81 | + controller.instance_variable_set('@virtual_community', virtual_community) | |
82 | +end | |
83 | +#require 'comatose_extensions' | ... | ... |