From 0e06b2d098f0873bb0a2b4ecfc9b270783128422 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Fri, 11 Jan 2008 22:35:32 +0000 Subject: [PATCH] ActionItem121: made a info for the oganization info --- app/controllers/my_profile/profile_editor_controller.rb | 2 +- app/controllers/public/search_controller.rb | 2 +- app/helpers/search_helper.rb | 2 +- app/models/organization.rb | 4 ++++ app/models/organization_info.rb | 4 ++++ app/views/profile_editor/change_image.rhtml | 18 ------------------ app/views/profile_editor/organization_info.rhtml | 29 +++++++++++++++++++++++++++++ config/routes.rb | 2 +- 8 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 app/views/profile_editor/organization_info.rhtml diff --git a/app/controllers/my_profile/profile_editor_controller.rb b/app/controllers/my_profile/profile_editor_controller.rb index 1540840..d9b6da4 100644 --- a/app/controllers/my_profile/profile_editor_controller.rb +++ b/app/controllers/my_profile/profile_editor_controller.rb @@ -1,6 +1,6 @@ class ProfileEditorController < MyProfileController - protect 'edit_profile', :profile, :only => [:index, :edit] +# protect 'edit_profile', :profile, :only => [:index, :edit] helper :profile diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index cf9201e..ac5f417 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -53,7 +53,7 @@ class SearchController < ApplicationController end def advanced_search - + end end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 76e416a..7723c50 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -12,6 +12,6 @@ module SearchHelper end def remove_stop_words(query) - (query.downcase.split(' ') - STOP_WORDS[Locale.current.to_s]).join(' ') + (query.downcase.split(/[ '".]/) - STOP_WORDS[Locale.current.to_s]).join(' ') end end diff --git a/app/models/organization.rb b/app/models/organization.rb index 4870567..0af3eee 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -38,4 +38,8 @@ class Organization < Profile CreateEnterprise.processed_for(self, :code => code).first end + def info + organization_info + end + end diff --git a/app/models/organization_info.rb b/app/models/organization_info.rb index b468892..0318cff 100644 --- a/app/models/organization_info.rb +++ b/app/models/organization_info.rb @@ -4,4 +4,8 @@ class OrganizationInfo < ActiveRecord::Base validates_numericality_of :foundation_year, :only_integer => true, :allow_nil => true validates_format_of :contact_email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda { |info| ! info.contact_email.nil? }) + + def summary + [['acronym', acronym], ['foundation year',foundation_year], ['contact email', contact_email]] + end end diff --git a/app/views/profile_editor/change_image.rhtml b/app/views/profile_editor/change_image.rhtml index 8577e40..0c797bd 100644 --- a/app/views/profile_editor/change_image.rhtml +++ b/app/views/profile_editor/change_image.rhtml @@ -5,21 +5,3 @@ <%= display_submit_tag(_('Upload')) %> <%= link_to _('Cancel'), :action => 'index' %> <% end %> - - - - - - - diff --git a/app/views/profile_editor/organization_info.rhtml b/app/views/profile_editor/organization_info.rhtml new file mode 100644 index 0000000..c12d978 --- /dev/null +++ b/app/views/profile_editor/organization_info.rhtml @@ -0,0 +1,29 @@ +

+<%= text_field 'enterprise', 'name', 'size' => 20, 'class' => 'formfield text_field' %>

+ +

+<%= text_field 'enterprise', 'address', 'size' => 50 , :id => 'address'%>

+ +


+<%= text_field 'enterprise', 'contact_phone', 'size' => 20 %>

+ +


+<%= text_field 'organization_info', 'contact_person', 'size' => 20 %>

+ +


+<%= text_field 'organization_info', 'acronym', 'size' => 20 %>

+ +


+<%= text_field 'organization_info', 'foundation_year', 'size' => 20 %>

+ +


+<%= text_field 'organization_info', 'legal_form', 'size' => 20 %>

+ +


+<%= text_field 'organization_info', 'economic_activity', 'size' => 20 %>

+ +


+<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %>

+ +


+<%= text_field 'enterprise', 'tag_list', 'size' => 20 %>

diff --git a/config/routes.rb b/config/routes.rb index a78ea0d..71f0b83 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -30,7 +30,7 @@ ActionController::Routing::Routes.draw do |map| map.connect 'enterprise_registration/:action', :controller => 'enterprise_registration' # search - map.connect 'search', :controller => 'search' + map.connect 'search/:action', :controller => 'search' # categories controller map.connect 'cat', :controller => 'category', :action => 'index' -- libgit2 0.21.2