From 7c91fe46fe9436c95a3a6833c8a1395362533f7c Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Fri, 20 Mar 2009 16:39:37 -0300 Subject: [PATCH] ActionItem834: port ecosol-specific changes into master branch --- app/controllers/admin/categories_controller.rb | 4 +++- app/models/environment.rb | 3 +++ app/views/home/index.rhtml | 14 +++++++++++++- app/views/layouts/application.rhtml | 22 +++++++++++++--------- config/ferret_server.yml | 16 ---------------- config/ferret_server.yml.dist | 16 ++++++++++++++++ lib/acts_as_searchable.rb | 4 +++- lib/unifreire_terminology.rb | 3 +++ lib/zen3_terminology.rb | 3 +++ public/stylesheets/blocks/main-block.css | 17 +++++++++++++++++ test/functional/categories_controller_test.rb | 11 +++++++++++ test/functional/home_controller_test.rb | 20 +++++++++++++++++++- 12 files changed, 104 insertions(+), 29 deletions(-) delete mode 100644 config/ferret_server.yml create mode 100644 config/ferret_server.yml.dist diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index 9c5cac0..169860a 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -5,7 +5,9 @@ class CategoriesController < AdminController helper :categories def index - @categories = environment.top_level_categories + # WORKAROUND: restricting the category trees to display. Region and + # ProductCategory have VERY LARGE trees. + @categories = environment.categories.find(:all, :conditions => "parent_id is null AND type is null") end ALLOWED_TYPES = CategoriesHelper::TYPES.map {|item| item[1] } diff --git a/app/models/environment.rb b/app/models/environment.rb index 73d22b1..2d5d6d4 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -40,6 +40,9 @@ class Environment < ActiveRecord::Base 'disable_contact_person' => _('Disable contact for people'), 'disable_contact_community' => _('Disable contact for groups/communities'), 'disable_join_community_popup' => _('Disable the popup that ask to join a group/community'), + + 'enterprise_activation' => _('Enable activation of enterprises'), + 'warn_obsolete_browser' => _('Enable warning of obsolete browser'), } end diff --git a/app/views/home/index.rhtml b/app/views/home/index.rhtml index c764d74..ce18f30 100644 --- a/app/views/home/index.rhtml +++ b/app/views/home/index.rhtml @@ -1,4 +1,16 @@ -<%= @environment.description %> +<%= environment.description %> + +<% if environment.enabled?('enterprise_activation') %> + +
+ <% form_tag({:controller => 'account', :action => 'activation_question'}, {:method => 'get'}) do %> +

<%= __('Activate your enterprise') %>

+ <%= labelled_form_field(__('Enterprise activation code') + ':', text_field_tag('enterprise_code')) %> + <%= submit_button(:ok, _('Ativar')) %> + <% end %> +
+ +<% end %>