Commit 0e06b2d098f0873bb0a2b4ecfc9b270783128422

Authored by MoisesMachado
1 parent 37053984

ActionItem121: made a info for the oganization info

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1184 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/my_profile/profile_editor_controller.rb
1 class ProfileEditorController < MyProfileController 1 class ProfileEditorController < MyProfileController
2 2
3 - protect 'edit_profile', :profile, :only => [:index, :edit] 3 +# protect 'edit_profile', :profile, :only => [:index, :edit]
4 4
5 helper :profile 5 helper :profile
6 6
app/controllers/public/search_controller.rb
@@ -53,7 +53,7 @@ class SearchController &lt; ApplicationController @@ -53,7 +53,7 @@ class SearchController &lt; ApplicationController
53 end 53 end
54 54
55 def advanced_search 55 def advanced_search
56 - 56 +
57 end 57 end
58 58
59 end 59 end
app/helpers/search_helper.rb
@@ -12,6 +12,6 @@ module SearchHelper @@ -12,6 +12,6 @@ module SearchHelper
12 end 12 end
13 13
14 def remove_stop_words(query) 14 def remove_stop_words(query)
15 - (query.downcase.split(' ') - STOP_WORDS[Locale.current.to_s]).join(' ') 15 + (query.downcase.split(/[ '".]/) - STOP_WORDS[Locale.current.to_s]).join(' ')
16 end 16 end
17 end 17 end
app/models/organization.rb
@@ -38,4 +38,8 @@ class Organization &lt; Profile @@ -38,4 +38,8 @@ class Organization &lt; Profile
38 CreateEnterprise.processed_for(self, :code => code).first 38 CreateEnterprise.processed_for(self, :code => code).first
39 end 39 end
40 40
  41 + def info
  42 + organization_info
  43 + end
  44 +
41 end 45 end
app/models/organization_info.rb
@@ -4,4 +4,8 @@ class OrganizationInfo &lt; ActiveRecord::Base @@ -4,4 +4,8 @@ class OrganizationInfo &lt; ActiveRecord::Base
4 validates_numericality_of :foundation_year, :only_integer => true, :allow_nil => true 4 validates_numericality_of :foundation_year, :only_integer => true, :allow_nil => true
5 5
6 validates_format_of :contact_email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda { |info| ! info.contact_email.nil? }) 6 validates_format_of :contact_email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda { |info| ! info.contact_email.nil? })
  7 +
  8 + def summary
  9 + [['acronym', acronym], ['foundation year',foundation_year], ['contact email', contact_email]]
  10 + end
7 end 11 end
app/views/profile_editor/change_image.rhtml
@@ -5,21 +5,3 @@ @@ -5,21 +5,3 @@
5 <%= display_submit_tag(_('Upload')) %> 5 <%= display_submit_tag(_('Upload')) %>
6 <%= link_to _('Cancel'), :action => 'index' %> 6 <%= link_to _('Cancel'), :action => 'index' %>
7 <% end %> 7 <% end %>
8 -  
9 -<ximg id="imgPrev" src="file:///home/aurium/osso3.png" onerror="alert(999)" onload="alert(111)" />  
10 -  
11 -<iframe id="fimg" src=""></iframe>  
12 -  
13 -<script type="text/javascript">  
14 -  
15 -var imgPrev = $("imgPrev");  
16 -  
17 -setTimeout( '$("fimg").src = "http://google.com"', 2000 );  
18 -setTimeout( '$("fimg").src = "file:///home/aurium/osso3.png"', 9000 );  
19 -  
20 -function updateImg( imgLocal ) {  
21 - imgPrev.src = "file://" + imgLocal;  
22 -}  
23 -  
24 -</script>  
25 -  
app/views/profile_editor/organization_info.rhtml 0 → 100644
@@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
  1 +<p class='formfield text_field'><label class='formlabel' for="name"><%= _('Name') %></label>
  2 +<%= text_field 'enterprise', 'name', 'size' => 20, 'class' => 'formfield text_field' %></p>
  3 +
  4 +<p class='formfield text_field'><label class='formlabel' for="address"><%= _('Address') %></label>
  5 +<%= text_field 'enterprise', 'address', 'size' => 50 , :id => 'address'%></p>
  6 +
  7 +<p class='formfield text_field'><label for="contact_phone"><%= _('Contact Phone') %></label><br/>
  8 +<%= text_field 'enterprise', 'contact_phone', 'size' => 20 %></p>
  9 +
  10 +<p class='formfield text_field'><label for="contact_person"><%= _('Contact Person') %></label><br/>
  11 +<%= text_field 'organization_info', 'contact_person', 'size' => 20 %></p>
  12 +
  13 +<p class='formfield text_field'><label for="acronym"><%= _('Acronym') %></label><br/>
  14 +<%= text_field 'organization_info', 'acronym', 'size' => 20 %></p>
  15 +
  16 +<p class='formfield text_field'><label for="foundation_year"><%= _('Foundation Year') %></label><br/>
  17 +<%= text_field 'organization_info', 'foundation_year', 'size' => 20 %></p>
  18 +
  19 +<p class='formfield text_field'><label for="legal_form"><%= _('Legal Form') %></label><br/>
  20 +<%= text_field 'organization_info', 'legal_form', 'size' => 20 %></p>
  21 +
  22 +<p class='formfield text_field'><label for="economic_activity"><%= _('Economic Activity') %></label><br/>
  23 +<%= text_field 'organization_info', 'economic_activity', 'size' => 20 %></p>
  24 +
  25 +<p class='formfield text_area'><label for="management_information"><%= _('Management Information') %></label><br/>
  26 +<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %></p>
  27 +
  28 +<p class='formfield text_field'><label for="tag_list"><%= _('Tags') %></label><br/>
  29 +<%= text_field 'enterprise', 'tag_list', 'size' => 20 %></p>
config/routes.rb
@@ -30,7 +30,7 @@ ActionController::Routing::Routes.draw do |map| @@ -30,7 +30,7 @@ ActionController::Routing::Routes.draw do |map|
30 map.connect 'enterprise_registration/:action', :controller => 'enterprise_registration' 30 map.connect 'enterprise_registration/:action', :controller => 'enterprise_registration'
31 31
32 # search 32 # search
33 - map.connect 'search', :controller => 'search' 33 + map.connect 'search/:action', :controller => 'search'
34 34
35 # categories controller 35 # categories controller
36 map.connect 'cat', :controller => 'category', :action => 'index' 36 map.connect 'cat', :controller => 'category', :action => 'index'