Commit 91bf3f94898f496af824b8a3a3b97ee9ead6c0d2

Authored by Daniela Feitosa
1 parent 2468db59

Some enhancements on solr

Removed whitespaces
Recovered schema.rb without plugins fields
Included info about solr support of multitenancy on solr.yml.dist
INSTALL
... ... @@ -13,7 +13,7 @@ You need to install some packages Noosfero depends on. On Debian GNU/Linux or
13 13 Debian-based systems, all of these packages are available through the Debian
14 14 archive. You can install them with the following command:
15 15  
16   - # apt-get install ruby rake po4a libgettext-ruby-util libgettext-ruby-data libgettext-ruby1.8 libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby libwill-paginate-ruby iso-codes libfeedparser-ruby openjdk-6-jre libdaemons-ruby thin tango-icon-theme libhpricot-ruby
  16 + # apt-get install ruby rake po4a libgettext-ruby-util libgettext-ruby1.8 libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby libwill-paginate-ruby iso-codes libfeedparser-ruby openjdk-6-jre libdaemons-ruby thin tango-icon-theme libhpricot-ruby
17 17  
18 18 On other systems, they may or may not be available through your regular package
19 19 management system. Below are the links to their homepages.
... ...
app/controllers/application.rb
1 1 require 'application_controller'
2   -
... ...
app/controllers/public/search_controller.rb
... ... @@ -46,7 +46,7 @@ class SearchController < PublicController
46 46 def products
47 47 public_filters = ['public:true', 'enabled:true']
48 48 if !@empty_query
49   - full_text_search public_filters
  49 + full_text_search public_filters
50 50 else
51 51 @one_page = true
52 52 @geosearch = logged_in? && current_user.person.lat && current_user.person.lng
... ... @@ -183,7 +183,7 @@ class SearchController < PublicController
183 183 @asset = params[:action].to_sym
184 184 @order ||= [@asset]
185 185 @results ||= {}
186   - @filter = filter
  186 + @filter = filter
187 187 @filter_title = filter_description(@asset, @filter)
188 188  
189 189 @query = params[:query] || ''
... ... @@ -198,7 +198,7 @@ class SearchController < PublicController
198 198 @category = environment.categories.find_by_path(path)
199 199 if @category.nil?
200 200 render_not_found(path)
201   - else
  201 + else
202 202 @category_id = @category.id
203 203 end
204 204 end
... ... @@ -220,12 +220,12 @@ class SearchController < PublicController
220 220 def filter_description(asset, filter)
221 221 {
222 222 'articles_more_recent' => _('More recent contents from network'),
223   - 'articles_more_popular' => _('More read contents from network'),
  223 + 'articles_more_popular' => _('More viewed contents from network'),
224 224 'people_more_recent' => _('More recent people from network'),
225 225 'people_more_active' => _('More active people from network'),
226 226 'people_more_popular' => _('More popular people from network'),
227   - 'communities_more_recent' => _('More recent communities from network'),
228   - 'communities_more_active' => _('More active communities from network'),
  227 + 'communities_more_recent' => _('More recent communities from network'),
  228 + 'communities_more_active' => _('More active communities from network'),
229 229 'communities_more_popular' => _('More popular communities from network'),
230 230 'products_more_recent' => _('Highlights'),
231 231 }[asset.to_s + '_' + filter]
... ...
app/helpers/application_helper.rb
... ... @@ -1088,7 +1088,7 @@ module ApplicationHelper
1088 1088 def search_contents_menu
1089 1089 links = [
1090 1090 {s_('contents|More Recent') => {:href => url_for({:controller => 'search', :action => 'contents', :filter => 'more_recent'})}},
1091   - {s_('contents|More Read') => {:href => url_for({:controller => 'search', :action => 'contents', :filter => 'more_popular'})}}
  1091 + {s_('contents|More Viewed') => {:href => url_for({:controller => 'search', :action => 'contents', :filter => 'more_popular'})}}
1092 1092 ]
1093 1093 if logged_in?
1094 1094 links.push(_('New Content') => lightbox_options({:href => url_for({:controller => 'cms', :action => 'new', :profile => current_user.login, :cms => true})}))
... ...
app/helpers/lightbox_helper.rb
... ... @@ -22,7 +22,10 @@ module LightboxHelper
22 22 def lightbox_options(options, lightbox_type = 'lbOn')
23 23 the_class = lightbox_type
24 24 the_class << " #{options[:class]}" if options.has_key?(:class)
25   - options.merge(:class => the_class)
  25 + options.merge(
  26 + :class => the_class,
  27 + :onclick => 'alert("%s"); return false' % _('Please, try again when the page loading completes.')
  28 + )
26 29 end
27 30  
28 31 def lightbox?
... ...
app/helpers/search_helper.rb
... ... @@ -77,9 +77,9 @@ module SearchHelper
77 77 end
78 78  
79 79 def city_with_state(city)
80   - if city and city.kind_of?(City)
  80 + if city and city.kind_of?(City)
81 81 s = city.parent
82   - if s and s.kind_of?(State) and s.acronym
  82 + if s and s.kind_of?(State) and s.acronym
83 83 city.name + ', ' + s.acronym
84 84 else
85 85 city.name
... ... @@ -140,7 +140,7 @@ module SearchHelper
140 140 def facet_selecteds_html_for(environment, klass, params)
141 141 def name_with_extra(klass, facet, value)
142 142 name = klass.facet_result_name(facet, value)
143   - name = name[0] + name[1] if name.kind_of?(Array)
  143 + name = name[0] + name[1] if name.kind_of?(Array)
144 144 name
145 145 end
146 146  
... ... @@ -165,7 +165,7 @@ module SearchHelper
165 165 end
166 166  
167 167 ret.map do |label, name, url|
168   - content_tag('div', content_tag('span', label, :class => 'facet-selected-label') +
  168 + content_tag('div', content_tag('span', label, :class => 'facet-selected-label') +
169 169 content_tag('span', name, :class => 'facet-selected-name') +
170 170 link_to('', url, :class => 'facet-selected-remove', :title => 'remove facet'), :class => 'facet-selected')
171 171 end.join
... ... @@ -199,7 +199,7 @@ module SearchHelper
199 199 def asset_class(asset)
200 200 asset.to_s.singularize.camelize.constantize
201 201 end
202   -
  202 +
203 203 def asset_table(asset)
204 204 asset_class(asset).table_name
205 205 end
... ...
app/models/article.rb
... ... @@ -661,8 +661,8 @@ class Article &lt; ActiveRecord::Base
661 661  
662 662 acts_as_faceted :fields => {
663 663 :f_type => {:label => _('Type'), :proc => proc{|klass| f_type_proc(klass)}},
664   - :f_published_at => {:type => :date, :label => _('Published date'), :queries => {'[* TO NOW-1YEARS/DAY]' => _("Older than one year"),
665   - '[NOW-1YEARS TO NOW/DAY]' => _("Last year"), '[NOW-1MONTHS TO NOW/DAY]' => _("Last month"), '[NOW-7DAYS TO NOW/DAY]' => _("Last week"), '[NOW-1DAYS TO NOW/DAY]' => _("Last day")},
  664 + :f_published_at => {:type => :date, :label => _('Published date'), :queries => {'[* TO NOW-1YEARS/DAY]' => _("Older than one year"),
  665 + '[NOW-1YEARS TO NOW/DAY]' => _("In the last year"), '[NOW-1MONTHS TO NOW/DAY]' => _("In the last month"), '[NOW-7DAYS TO NOW/DAY]' => _("In the last week"), '[NOW-1DAYS TO NOW/DAY]' => _("In the last day")},
666 666 :queries_order => ['[NOW-1DAYS TO NOW/DAY]', '[NOW-7DAYS TO NOW/DAY]', '[NOW-1MONTHS TO NOW/DAY]', '[NOW-1YEARS TO NOW/DAY]', '[* TO NOW-1YEARS/DAY]']},
667 667 :f_profile_type => {:label => _('Profile'), :proc => proc{|klass| f_profile_type_proc(klass)}},
668 668 :f_category => {:label => _('Categories')},
... ...
app/models/domain.rb
... ... @@ -8,7 +8,7 @@ class Domain &lt; ActiveRecord::Base
8 8 # validations
9 9 #############
10 10  
11   - # <tt>name</tt> must be sequences of alphanumeric characters (a to z,
  11 + # <tt>name</tt> must be sequences of alphanumeric characters (a to z,
12 12 # 0 to 9), plus '_' or '-', separated by dots. Letters must be lowercase.
13 13 validates_format_of :name, :with => /^([a-z0-9_-]+\.)+[a-z0-9_-]+$/, :message => N_('%{fn} must be composed of sequences of lowercase letters (a to z), numbers (0 to 9), "_" and "-", separated by dots.').fix_i18n
14 14  
... ...
app/models/enterprise.rb
... ... @@ -162,9 +162,9 @@ class Enterprise &lt; Organization
162 162 end
163 163 end
164 164  
165   - def control_panel_settings_button
166   - {:title => __('Enterprise Info and settings'), :icon => 'edit-profile-enterprise'}
167   - end
  165 + def control_panel_settings_button
  166 + {:title => __('Enterprise Info and settings'), :icon => 'edit-profile-enterprise'}
  167 + end
168 168  
169 169 settings_items :enable_contact_us, :type => :boolean, :default => true
170 170  
... ...
app/models/environment.rb
... ... @@ -365,11 +365,11 @@ class Environment &lt; ActiveRecord::Base
365 365 end
366 366  
367 367 def terminology
368   - #if self.settings[:terminology]
369   - #self.settings[:terminology].constantize.instance
370   - #else
  368 + if self.settings[:terminology]
  369 + self.settings[:terminology].constantize.instance
  370 + else
371 371 Noosfero.terminology
372   - #end
  372 + end
373 373 end
374 374  
375 375 def terminology=(value)
... ...
app/models/product.rb
... ... @@ -219,7 +219,7 @@ class Product &lt; ActiveRecord::Base
219 219 def self.f_region_proc(id)
220 220 c = Region.find(id)
221 221 s = c.parent
222   - if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym
  222 + if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym
223 223 [c.name, ', ' + s.acronym]
224 224 else
225 225 c.name
... ...
app/models/profile.rb
... ... @@ -239,7 +239,7 @@ class Profile &lt; ActiveRecord::Base
239 239 self.categories(true)
240 240 self.solr_save
241 241 end
242   - self.categories(reload)
  242 + self.categories(reload)
243 243 end
244 244  
245 245 def category_ids=(ids)
... ... @@ -544,7 +544,7 @@ private :generate_url, :url_options
544 544 other.top_level_articles.each do |a|
545 545 copy_article_tree a
546 546 end
547   - self.articles.reload
  547 + self.articles.reload
548 548 end
549 549  
550 550 def copy_article_tree(article, parent=nil)
... ... @@ -864,7 +864,7 @@ private :generate_url, :url_options
864 864 def self.f_region_proc(id)
865 865 c = Region.find(id)
866 866 s = c.parent
867   - if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym
  867 + if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym
868 868 [c.name, ', ' + s.acronym]
869 869 else
870 870 c.name
... ... @@ -872,7 +872,7 @@ private :generate_url, :url_options
872 872 end
873 873  
874 874 def self.f_enabled_proc(enabled)
875   - enabled = enabled == "true" ? true : false
  875 + enabled = enabled == "true" ? true : false
876 876 enabled ? _('Enabled') : _('Not enabled')
877 877 end
878 878 def f_enabled
... ... @@ -920,8 +920,8 @@ private :generate_url, :url_options
920 920 after_save_reindex [:articles], :with => :delayed_job
921 921 handle_asynchronously :solr_save
922 922  
923   - def control_panel_settings_button
924   - {:title => _('Profile Info and settings'), :icon => 'edit-profile'}
  923 + def control_panel_settings_button
  924 + {:title => _('Profile Info and settings'), :icon => 'edit-profile'}
925 925 end
926 926  
927 927 def followed_by?(person)
... ...
app/views/layouts/_javascript.rhtml
1   -<%= javascript_include_tag :defaults, 'jquery-latest.js',
  1 +<%= javascript_include_tag :defaults, 'jquery-latest.js',
2 2 'jquery.noconflict.js', 'jquery.cycle.all.min.js', 'thickbox.js', 'lightbox', 'colorbox',
3 3 'jquery-ui-1.8.2.custom.min', 'jquery.scrollTo', 'jquery.form.js', 'jquery-validation/jquery.validate',
4   -'jquery.cookie', 'jquery.ba-bbq.min.js', 'reflection', 'jquery.tokeninput',
  4 +'jquery.cookie', 'jquery.ba-bbq.min.js', 'reflection', 'jquery.tokeninput',
5 5 'add-and-join', 'report-abuse', 'catalog', 'manage-products', :cache => 'cache-general' %>
6 6  
7 7 <% language = FastGettext.locale %>
... ...
app/views/layouts/application-ng.rhtml
... ... @@ -62,7 +62,7 @@
62 62 </div>
63 63 </span>
64 64 <form action="/search" class="search_form" method="get" class="clean">
65   - <input name="query" size="15" title="<%=_('Search...')%>" onfocus="this.form.className='focused';" onblur="this.form.className=''" />
  65 + <input name="query" size="15" title="<%=_('Search...')%>" onfocus="this.form.className='focused';" onblur="this.form.className=''" />
66 66 <div><%=_('Press <strong>Enter</strong> to send the search query.')%></div>
67 67 <%= javascript_tag 'jQuery("#user form input").hint();' %>
68 68 </form>
... ...
app/views/manage_products/_display_image.rhtml
... ... @@ -3,7 +3,7 @@
3 3 </div>
4 4  
5 5 <% if @product.image %>
6   - <%= link_to content_tag(:span, _('Zoom in')), @product.image.public_filename,
  6 + <%= link_to content_tag(:span, _('Zoom in')), @product.image.public_filename,
7 7 :class => 'zoomify-image' %>
8 8 <% end %>
9 9 <%= add_zoom_to_images %>
... ...
app/views/maps/_google_map.js.erb
... ... @@ -16,7 +16,7 @@ function getAddress(latlng) {
16 16  
17 17 function codeAddress() {
18 18 $('location-fields').addClassName("loading");
19   -
  19 +
20 20 var country_option = $('profile_data_country').value;
21 21 var address = $('profile_data_address').value + "-" + $('profile_data_zip_code').value + "," + $('profile_data_city').value+ "-" + $('profile_data_state').value + "," + country_option;
22 22  
... ... @@ -78,7 +78,7 @@ function getAddressData() {
78 78 }
79 79  
80 80 function showAddress(results, status) {
81   -
  81 +
82 82 if (status == google.maps.GeocoderStatus.OK) {
83 83 map.setCenter(results[0].geometry.location);
84 84 updateFields(results[0]);
... ... @@ -113,10 +113,10 @@ function updateFields(place) {
113 113 var state = "";
114 114 var country_code = "";
115 115 var i = 0;
116   -
  116 +
117 117 for( i =0 ; i < components_len; i ++)
118 118 {
119   -
  119 +
120 120 if (components[i].types[0] == 'country')
121 121 country_code = components[i].short_name;
122 122 else if (components[i].types[0] == 'administrative_area_level_1')
... ... @@ -132,7 +132,7 @@ function updateFields(place) {
132 132 else if (components[i].types[0] == 'postal_code')
133 133 zip_code = components[i].short_name;
134 134 }
135   -
  135 +
136 136 $('profile_data_country').value = country_code;
137 137 $('profile_data_state').value = state;
138 138 $('profile_data_address').value = address;
... ...
app/views/maps/edit_location.rhtml
... ... @@ -26,9 +26,8 @@
26 26  
27 27 <%= f.hidden_field :lat %>
28 28 <%= f.hidden_field :lng %>
29   -
  29 +
30 30 <% end %>
31 31  
32 32 <%= content_tag('script', '', :src => "http://maps.googleapis.com/maps/api/js?sensor=false", :type => 'text/javascript') %>
33 33 <%= content_tag('script', '', :src => url_for(:controller => :maps, :action => :google_map), :type => 'text/javascript') %>
34   -
... ...
app/views/search/_blog.rhtml
... ... @@ -15,7 +15,7 @@
15 15 <%= _('None') if r.empty? %>
16 16 </td>
17 17 </tr>
18   -
  18 +
19 19 <%= render :partial => 'article_common', :object => blog %>
20 20 </table>
21 21 <%= render :partial => 'article_last_change', :object => blog %>
... ...
app/views/search/_display_results.rhtml
... ... @@ -31,7 +31,7 @@
31 31 <% end %>
32 32 </div>
33 33 <% end %>
34   -
  34 +
35 35 <div style="clear:both"></div>
36 36  
37 37 <%= add_zoom_to_images %>
... ...
app/views/search/_image.rhtml
1 1 <div class="search-image-container">
2   -
  2 +
3 3 <% if image.is_a? UploadedFile and image.filename %>
4 4 <% extension = image.filename[(image.filename.rindex('.')+1)..-1].downcase %>
5 5 <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %>
... ... @@ -38,9 +38,9 @@
38 38 <% elsif image.is_a? Product %>
39 39 <% if image.image %>
40 40 <div class="zoomable-image">
41   - <%= link_to '', product_path(image), :class => "search-image-pic",
  41 + <%= link_to '', product_path(image), :class => "search-image-pic",
42 42 :style => 'background-image: url(%s)'% image.default_image(:thumb) %>
43   - <%= link_to content_tag(:span, _('Zoom in')), image.image.public_filename,
  43 + <%= link_to content_tag(:span, _('Zoom in')), image.image.public_filename,
44 44 :class => 'zoomify-image' %>
45 45 </div>
46 46 <% else %>
... ...
app/views/search/_product.rhtml
... ... @@ -20,7 +20,7 @@
20 20 <% end %>
21 21 <div class="search-product-inputs-info">
22 22 <% if p = product.percentage_from_solidarity_economy %>
23   - <div class="search-product-percentage-from-solidarity-economy search-product-ecosol-percentage-icon-<%= p[0].to_s %>"
  23 + <div class="search-product-percentage-from-solidarity-economy search-product-ecosol-percentage-icon-<%= p[0].to_s %>"
24 24 title="<%=_('Percentage of inputs from solidarity economy')%>">
25 25 <%= p[1] %>
26 26 </div>
... ... @@ -29,7 +29,7 @@
29 29 <% if product.price_described? %>
30 30 <% title = (product.inputs + product.price_details).map{ |i|
31 31 '<div class="search-product-input-dots-to-price">' +
32   - '<div class="search-product-input-name">' + i.product_category.name + '</div>' +
  32 + '<div class="search-product-input-name">' + i.product_category.name + '</div>' +
33 33 price_span(i.price, :class => 'search-product-input-price') +
34 34 '</div>' }.join('') %>
35 35 <%= link_to_function _("Open Price"), '', :title => title, :class => "search-product-price-details" %>
... ...
app/views/search/_profile.rhtml
... ... @@ -26,14 +26,12 @@
26 26  
27 27 <div class="search-enterprise-categorization">
28 28 <% profile.top_level_categorization.each do |parent, children| %>
29   - <% if parent.name != "Territórios" %>
30   - <div class="search-enterprise-category-<%=parent.id%> search-enterprise-category">
31   - <span class="search-enterprise-categorization-parent"><%= parent.name %></span>
32   - <span class="search-enterprise-categorization-children">
33   - <%= children.collect(&:name).join(', ') %>
34   - </span>
35   - </div>
36   - <% end %>
  29 + <div class="search-enterprise-category-<%=parent.id%> search-enterprise-category">
  30 + <span class="search-enterprise-categorization-parent"><%= parent.name %></span>
  31 + <span class="search-enterprise-categorization-children">
  32 + <%= children.collect(&:name).join(', ') %>
  33 + </span>
  34 + </div>
37 35 <% end %>
38 36 </div>
39 37 </div>
... ...
app/views/search/_results_header.rhtml
1 1 <div class="search-results-header <%= "search-no-results" if @results[@asset].nil? or @results[@asset].length == 0 %>">
2 2 <% if !@empty_query %>
3   - <div class="search-results-header-information">
  3 + <div class="search-results-header-information">
4 4 <% if @results[@asset].total_entries > 0 %>
5 5 <%= label_total_found(@asset, @results[@asset].total_entries) %>
6 6 <% if params[:display] != 'map' %>
... ... @@ -9,7 +9,7 @@
9 9 <% end %>
10 10 </div>
11 11  
12   - <div class="search-results-header-facets-order-by">
  12 + <div class="search-results-header-facets-order-by">
13 13 <%= facets_unselect_menu(@asset) %>
14 14 <%= order_by(@asset) if params[:display] != 'map' %>
15 15 </div>
... ...
app/views/search/_search_form.rhtml
... ... @@ -2,7 +2,7 @@
2 2  
3 3 <% form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) },
4 4 :method => 'get', :class => 'search_form' ) do %>
5   -
  5 +
6 6 <%= hidden_field_tag :display, params[:display] %>
7 7  
8 8 <% params_uri = CGI::unescape(request.request_uri) %>
... ... @@ -14,18 +14,18 @@
14 14 <% end %>
15 15 <% end %>
16 16 <% end %>
17   -
  17 +
18 18 <div class="search-field">
19 19 <span class="formfield">
20 20 <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50 %>
21 21 <%= javascript_tag "jQuery('#search-input').attr('title', \"#{hint}\").hint()" if defined?(hint) %>
22 22 </span>
23   -
  23 +
24 24 <%= submit_button(:search, _('Search')) %>
25 25 </div>
26 26  
27 27 <% end %>
28   -
  28 +
29 29 <% if @empty_query %>
30 30 <% hint = environment.search_hints[@asset] %>
31 31 <% if hint and !hint.blank? %>
... ...
app/views/search/index.rhtml
... ... @@ -8,7 +8,7 @@
8 8 <%= render :partial => 'search_form', :locals => { :hint => '' } %>
9 9 <%= category_context(@category, params) %>
10 10 <%= display_results %>
11   -
  11 +
12 12 <div id="category-childs">
13 13 <% if @category %>
14 14 <h2> <%= _('Sub-categories') %> </h2>
... ...
config/environments/cucumber.rb
... ... @@ -18,11 +18,3 @@ config.action_controller.allow_forgery_protection = false
18 18 # The :test delivery method accumulates sent emails in the
19 19 # ActionMailer::Base.deliveries array.
20 20 config.action_mailer.delivery_method = :test
21   -
22   -config.gem 'cucumber', :lib => false, :version => '0.4.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber'))
23   -config.gem 'webrat', :lib => false, :version => '0.5.1' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat'))
24   -config.gem 'rspec', :lib => 'spec', :version => '1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
25   -config.gem 'rspec-rails', :lib => 'spec/rails', :version => '1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
26   -config.gem 'Selenium', :lib => 'selenium', :version => '>= 1.1.14' unless File.directory?(File.join(Rails.root, 'vendor/plugins/selenium'))
27   -config.gem 'selenium-client', :lib => 'selenium/client', :version => '>= 1.2.17' unless File.directory?(File.join(Rails.root, 'vendor/plugins/selenium-client'))
28   -config.gem 'database_cleaner', :lib => 'database_cleaner'
... ...
config/solr.yml.dist
1 1 # Config file for the acts_as_solr plugin.
2 2 #
3   -# If you change the host or port number here, make sure you update
  3 +# If you change the host or port number here, make sure you update
4 4 # them in your Solr config file
5 5  
6   -development:
7   - url: http://0.0.0.0:8982/solr
8   - jvm_options: -server -Xmx128M -Xms16M
9   - timeout: 0
10   -
  6 +# This file must follow a structure in order to achieve multitenancy
  7 +# support. In this example, we will configure solr to support 3
  8 +# different schemas: env1, env2 and env3.
  9 +#
  10 +# Each "hosted" environment must have an entry like this:
  11 +#
  12 +# production: &PRODUCTION
  13 +# url: http://127.0.0.1:8983/solr
  14 +# jvm_options: -server -Xmx192M -Xms64M
  15 +# timeout: 0
  16 +#
  17 +# env1_production:
  18 +# <<: *PRODUCTION
  19 +#
  20 +# env2_production:
  21 +# <<: *PRODUCTION
  22 +#
  23 +# env3_production:
  24 +# <<: *PRODUCTION
  25 +
11 26 production:
12 27 url: http://127.0.0.1:8983/solr
13 28 jvm_options: -server -Xmx192M -Xms64M
14 29 timeout: 0
15 30  
  31 +development:
  32 + url: http://0.0.0.0:8982/solr
  33 + jvm_options: -server -Xmx128M -Xms16M
  34 + timeout: 0
  35 +
16 36 test: &TEST
17 37 url: http://0.0.0.0:8981/solr
18 38 jvm_options: -server -Xmx128M -Xms16M
... ...
db/migrate/20120402205653_remove_broken_references_to_category.rb
1 1 class RemoveBrokenReferencesToCategory < ActiveRecord::Migration
2 2 def self.up
3 3 execute <<-SQL
4   - delete from articles_categories where category_id not in (select id from categories);
  4 + delete from articles_categories where category_id not in (select id from categories);
5 5 SQL
6 6 execute <<-SQL
7 7 delete from categories_profiles where category_id not in (select id from categories);
... ...
db/schema.rb
... ... @@ -161,36 +161,6 @@ ActiveRecord::Schema.define(:version =&gt; 20120411132751) do
161 161  
162 162 add_index "boxes", ["owner_id", "owner_type"], :name => "index_boxes_on_owner_type_and_owner_id"
163 163  
164   - create_table "bsc_plugin_contracts", :force => true do |t|
165   - t.string "client_name"
166   - t.integer "client_type"
167   - t.integer "business_type"
168   - t.string "state"
169   - t.string "city"
170   - t.integer "status", :default => 0
171   - t.integer "number_of_producers", :default => 0
172   - t.datetime "supply_start"
173   - t.datetime "supply_end"
174   - t.text "annotations"
175   - t.integer "bsc_id"
176   - t.datetime "created_at"
177   - t.datetime "updated_at"
178   - end
179   -
180   - create_table "bsc_plugin_contracts_enterprises", :id => false, :force => true do |t|
181   - t.integer "contract_id"
182   - t.integer "enterprise_id"
183   - end
184   -
185   - create_table "bsc_plugin_sales", :force => true do |t|
186   - t.integer "product_id", :null => false
187   - t.integer "contract_id", :null => false
188   - t.integer "quantity", :null => false
189   - t.decimal "price"
190   - t.datetime "created_at"
191   - t.datetime "updated_at"
192   - end
193   -
194 164 create_table "categories", :force => true do |t|
195 165 t.string "name"
196 166 t.string "slug"
... ... @@ -284,7 +254,6 @@ ActiveRecord::Schema.define(:version =&gt; 20120411132751) do
284 254 t.datetime "created_at"
285 255 t.datetime "updated_at"
286 256 t.integer "reports_lower_bound", :default => 0, :null => false
287   - t.text "send_email_plugin_allow_to"
288 257 end
289 258  
290 259 create_table "external_feeds", :force => true do |t|
... ... @@ -308,10 +277,6 @@ ActiveRecord::Schema.define(:version =&gt; 20120411132751) do
308 277 t.integer "enterprise_id"
309 278 end
310 279  
311   - create_table "foo_plugin_bars", :force => true do |t|
312   - t.string "name"
313   - end
314   -
315 280 create_table "friendships", :force => true do |t|
316 281 t.integer "person_id"
317 282 t.integer "friend_id"
... ... @@ -432,7 +397,7 @@ ActiveRecord::Schema.define(:version =&gt; 20120411132751) do
432 397 t.string "type"
433 398 t.string "identifier"
434 399 t.integer "environment_id"
435   - t.boolean "active", :default => true
  400 + t.boolean "active", :default => true
436 401 t.string "address"
437 402 t.string "contact_phone"
438 403 t.integer "home_page_id"
... ... @@ -443,26 +408,19 @@ ActiveRecord::Schema.define(:version =&gt; 20120411132751) do
443 408 t.float "lat"
444 409 t.float "lng"
445 410 t.integer "geocode_precision"
446   - t.boolean "enabled", :default => true
447   - t.string "nickname", :limit => 16
  411 + t.boolean "enabled", :default => true
  412 + t.string "nickname", :limit => 16
448 413 t.text "custom_header"
449 414 t.text "custom_footer"
450 415 t.string "theme"
451   - t.boolean "public_profile", :default => true
  416 + t.boolean "public_profile", :default => true
452 417 t.date "birth_date"
453 418 t.integer "preferred_domain_id"
454 419 t.datetime "updated_at"
455   - t.boolean "visible", :default => true
  420 + t.boolean "visible", :default => true
456 421 t.integer "image_id"
457   - t.boolean "validated", :default => true
  422 + t.boolean "validated", :default => true
458 423 t.string "cnpj"
459   - t.boolean "shopping_cart", :default => true
460   - t.boolean "shopping_cart_delivery", :default => false
461   - t.decimal "shopping_cart_delivery_price", :default => 0.0
462   - t.string "usp_id"
463   - t.integer "bar_id"
464   - t.integer "bsc_id"
465   - t.string "company_name"
466 424 t.string "national_region_code"
467 425 end
468 426  
... ... @@ -526,15 +484,6 @@ ActiveRecord::Schema.define(:version =&gt; 20120411132751) do
526 484 t.datetime "updated_at"
527 485 end
528 486  
529   - create_table "shopping_cart_plugin_purchase_orders", :force => true do |t|
530   - t.integer "customer_id"
531   - t.integer "seller_id"
532   - t.text "data"
533   - t.integer "status"
534   - t.datetime "created_at"
535   - t.datetime "updated_at"
536   - end
537   -
538 487 create_table "taggings", :force => true do |t|
539 488 t.integer "tag_id"
540 489 t.integer "taggable_id"
... ... @@ -562,7 +511,6 @@ ActiveRecord::Schema.define(:version =&gt; 20120411132751) do
562 511 t.datetime "created_at"
563 512 t.string "target_type"
564 513 t.integer "image_id"
565   - t.integer "bsc_id"
566 514 end
567 515  
568 516 create_table "thumbnails", :force => true do |t|
... ...
debian/solr.yml
1 1 # Config file for the acts_as_solr plugin.
2 2 #
3   -# If you change the host or port number here, make sure you update
  3 +# If you change the host or port number here, make sure you update
4 4 # them in your Solr config file
5 5  
6 6 development:
7 7 url: http://0.0.0.0:8982/solr
8 8 jvm_options: -server -Xmx128M -Xms16M
9 9 timeout: 0
10   -
  10 +
11 11 production:
12 12 url: http://127.0.0.1:8983/solr
13 13 jvm_options: -server -Xmx192M -Xms64M
... ...
features/step_definitions/create_community_steps.rb
... ... @@ -25,8 +25,7 @@ Given /^I reject community &quot;(.+)&quot;$/ do |community|
25 25 end
26 26  
27 27 Then /^I should see "([^\"]*)"'s creation date$/ do |community|
28   - com = Community.find_by_name community
  28 + com = Community.find_by_name community
29 29 text = "Created at: #{show_date(com.created_at)}"
30 30 response.should contain(text)
31 31 end
32   -
... ...
gitignore.example
... ... @@ -12,9 +12,9 @@ config/mongrel_cluster.yml
12 12 config/solr.yml
13 13 config/plugins
14 14 config/thin.yml
15   -/index
16   -/locale
17   -/log
  15 +index
  16 +locale
  17 +log
18 18 public/articles
19 19 public/image_uploads
20 20 public/thumbnails
... ... @@ -29,9 +29,9 @@ db/production.db
29 29 db/test.db
30 30 doc/noosfero/*.xhtml
31 31 doc/noosfero/*/*.xhtml
32   -/tags
33   -/pkg
34   -/solr
  32 +tags
  33 +pkg
  34 +solr
35 35 *~
36 36 *.swp
37 37 debian/*.log
... ...
lib/acts_as_searchable.rb
... ... @@ -47,7 +47,7 @@ module ActsAsSearchable
47 47 options[:facets][:browse] = nil
48 48 all_facets = find_by_solr(query, options.merge(:per_page => 0)).facets
49 49 end
50   -
  50 +
51 51 if !solr_result.nil?
52 52 facets = options.include?(:facets) ? solr_result.facets : []
53 53  
... ...
public/images/icons-app/product-default-pic-big.png 0 → 100644

20.1 KB

public/javascripts/application.js
... ... @@ -719,14 +719,14 @@ Array.min = function(array) {
719 719 (function ($) {
720 720  
721 721 $.fn.hint = function (blurClass) {
722   - if (!blurClass) {
  722 + if (!blurClass) {
723 723 blurClass = 'blur';
724 724 }
725   -
  725 +
726 726 return this.each(function () {
727 727 // get jQuery version of 'this'
728 728 var $input = $(this),
729   -
  729 +
730 730 // capture the rest of the variable to allow for reuse
731 731 title = $input.attr('title'),
732 732 $form = $(this.form),
... ... @@ -739,14 +739,14 @@ $.fn.hint = function (blurClass) {
739 739 }
740 740  
741 741 // only apply logic if the element has the attribute
742   - if (title) {
  742 + if (title) {
743 743 // on blur, set value to title attr if text is blank
744 744 $input.blur(function () {
745 745 if (this.value === '') {
746 746 $input.val(title).addClass(blurClass);
747 747 }
748 748 }).focus(remove).blur(); // now change all inputs to title
749   -
  749 +
750 750 // clear the pre-defined text when form is submitted
751 751 $form.submit(remove);
752 752 $win.unload(remove); // handles Firefox's autocomplete
... ...
public/javascripts/google_maps.js
... ... @@ -8,7 +8,7 @@ function mapOpenBalloon(marker, html) {
8 8 infoWindow.setContent(html);
9 9 infoWindow.open(map, marker);
10 10 }
11   -
  11 +
12 12 function mapPutMarker(lat, lng, title, icon, url_or_function) {
13 13 var point_str = lat + ":" + lng;
14 14  
... ... @@ -18,7 +18,7 @@ function mapPutMarker(lat, lng, title, icon, url_or_function) {
18 18 } else {
19 19 mapPoints[point_str] = true;
20 20 }
21   -
  21 +
22 22 var point = new google.maps.LatLng(lat, lng);
23 23 var options = { map: map, title: title, icon: icon, position: point };
24 24 var marker = new google.maps.Marker(options);
... ...
vendor/plugins/acts_as_solr_reloaded/config/solr.yml
1 1 # Config file for the acts_as_solr plugin.
2 2 #
3   -# If you change the host or port number here, make sure you update
  3 +# If you change the host or port number here, make sure you update
4 4 # them in your Solr config file
5 5  
6 6 development:
7 7 url: http://0.0.0.0:8982/solr
8 8 jvm_options: -server -Xmx128M -Xms16M
9 9 timeout: 0
10   -
  10 +
11 11 production:
12 12 url: http://127.0.0.1:8983/solr
13 13 jvm_options: -server -Xmx192M -Xms64M
... ...