diff --git a/INSTALL b/INSTALL index a12b8b0..9ee8a6e 100644 --- a/INSTALL +++ b/INSTALL @@ -13,7 +13,7 @@ You need to install some packages Noosfero depends on. On Debian GNU/Linux or Debian-based systems, all of these packages are available through the Debian archive. You can install them with the following command: - # 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 + # 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 On other systems, they may or may not be available through your regular package management system. Below are the links to their homepages. diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 7b70633..33f4328 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -1,2 +1 @@ require 'application_controller' - diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index 65a0d31..077bff0 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -46,7 +46,7 @@ class SearchController < PublicController def products public_filters = ['public:true', 'enabled:true'] if !@empty_query - full_text_search public_filters + full_text_search public_filters else @one_page = true @geosearch = logged_in? && current_user.person.lat && current_user.person.lng @@ -183,7 +183,7 @@ class SearchController < PublicController @asset = params[:action].to_sym @order ||= [@asset] @results ||= {} - @filter = filter + @filter = filter @filter_title = filter_description(@asset, @filter) @query = params[:query] || '' @@ -198,7 +198,7 @@ class SearchController < PublicController @category = environment.categories.find_by_path(path) if @category.nil? render_not_found(path) - else + else @category_id = @category.id end end @@ -220,12 +220,12 @@ class SearchController < PublicController def filter_description(asset, filter) { 'articles_more_recent' => _('More recent contents from network'), - 'articles_more_popular' => _('More read contents from network'), + 'articles_more_popular' => _('More viewed contents from network'), 'people_more_recent' => _('More recent people from network'), 'people_more_active' => _('More active people from network'), 'people_more_popular' => _('More popular people from network'), - 'communities_more_recent' => _('More recent communities from network'), - 'communities_more_active' => _('More active communities from network'), + 'communities_more_recent' => _('More recent communities from network'), + 'communities_more_active' => _('More active communities from network'), 'communities_more_popular' => _('More popular communities from network'), 'products_more_recent' => _('Highlights'), }[asset.to_s + '_' + filter] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5d6c9eb..b1820a7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1088,7 +1088,7 @@ module ApplicationHelper def search_contents_menu links = [ {s_('contents|More Recent') => {:href => url_for({:controller => 'search', :action => 'contents', :filter => 'more_recent'})}}, - {s_('contents|More Read') => {:href => url_for({:controller => 'search', :action => 'contents', :filter => 'more_popular'})}} + {s_('contents|More Viewed') => {:href => url_for({:controller => 'search', :action => 'contents', :filter => 'more_popular'})}} ] if logged_in? links.push(_('New Content') => lightbox_options({:href => url_for({:controller => 'cms', :action => 'new', :profile => current_user.login, :cms => true})})) diff --git a/app/helpers/lightbox_helper.rb b/app/helpers/lightbox_helper.rb index ffb8d35..4567c3c 100644 --- a/app/helpers/lightbox_helper.rb +++ b/app/helpers/lightbox_helper.rb @@ -22,7 +22,10 @@ module LightboxHelper def lightbox_options(options, lightbox_type = 'lbOn') the_class = lightbox_type the_class << " #{options[:class]}" if options.has_key?(:class) - options.merge(:class => the_class) + options.merge( + :class => the_class, + :onclick => 'alert("%s"); return false' % _('Please, try again when the page loading completes.') + ) end def lightbox? diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index da79499..091b791 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -77,9 +77,9 @@ module SearchHelper end def city_with_state(city) - if city and city.kind_of?(City) + if city and city.kind_of?(City) s = city.parent - if s and s.kind_of?(State) and s.acronym + if s and s.kind_of?(State) and s.acronym city.name + ', ' + s.acronym else city.name @@ -140,7 +140,7 @@ module SearchHelper def facet_selecteds_html_for(environment, klass, params) def name_with_extra(klass, facet, value) name = klass.facet_result_name(facet, value) - name = name[0] + name[1] if name.kind_of?(Array) + name = name[0] + name[1] if name.kind_of?(Array) name end @@ -165,7 +165,7 @@ module SearchHelper end ret.map do |label, name, url| - content_tag('div', content_tag('span', label, :class => 'facet-selected-label') + + content_tag('div', content_tag('span', label, :class => 'facet-selected-label') + content_tag('span', name, :class => 'facet-selected-name') + link_to('', url, :class => 'facet-selected-remove', :title => 'remove facet'), :class => 'facet-selected') end.join @@ -199,7 +199,7 @@ module SearchHelper def asset_class(asset) asset.to_s.singularize.camelize.constantize end - + def asset_table(asset) asset_class(asset).table_name end diff --git a/app/models/article.rb b/app/models/article.rb index 1bd3c34..221e5f4 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -661,8 +661,8 @@ class Article < ActiveRecord::Base acts_as_faceted :fields => { :f_type => {:label => _('Type'), :proc => proc{|klass| f_type_proc(klass)}}, - :f_published_at => {:type => :date, :label => _('Published date'), :queries => {'[* TO NOW-1YEARS/DAY]' => _("Older than one year"), - '[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")}, + :f_published_at => {:type => :date, :label => _('Published date'), :queries => {'[* TO NOW-1YEARS/DAY]' => _("Older than one year"), + '[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")}, :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]']}, :f_profile_type => {:label => _('Profile'), :proc => proc{|klass| f_profile_type_proc(klass)}}, :f_category => {:label => _('Categories')}, diff --git a/app/models/domain.rb b/app/models/domain.rb index edb0f48..2b29939 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -8,7 +8,7 @@ class Domain < ActiveRecord::Base # validations ############# - # name must be sequences of alphanumeric characters (a to z, + # name must be sequences of alphanumeric characters (a to z, # 0 to 9), plus '_' or '-', separated by dots. Letters must be lowercase. 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 diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index d401dd9..47603ca 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -162,9 +162,9 @@ class Enterprise < Organization end end - def control_panel_settings_button - {:title => __('Enterprise Info and settings'), :icon => 'edit-profile-enterprise'} - end + def control_panel_settings_button + {:title => __('Enterprise Info and settings'), :icon => 'edit-profile-enterprise'} + end settings_items :enable_contact_us, :type => :boolean, :default => true diff --git a/app/models/environment.rb b/app/models/environment.rb index 7e3b178..3df675c 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -365,11 +365,11 @@ class Environment < ActiveRecord::Base end def terminology - #if self.settings[:terminology] - #self.settings[:terminology].constantize.instance - #else + if self.settings[:terminology] + self.settings[:terminology].constantize.instance + else Noosfero.terminology - #end + end end def terminology=(value) diff --git a/app/models/product.rb b/app/models/product.rb index 1ef691c..2d0ec9d 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -219,7 +219,7 @@ class Product < ActiveRecord::Base def self.f_region_proc(id) c = Region.find(id) s = c.parent - if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym + if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym [c.name, ', ' + s.acronym] else c.name diff --git a/app/models/profile.rb b/app/models/profile.rb index 86cf906..4085588 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -239,7 +239,7 @@ class Profile < ActiveRecord::Base self.categories(true) self.solr_save end - self.categories(reload) + self.categories(reload) end def category_ids=(ids) @@ -544,7 +544,7 @@ private :generate_url, :url_options other.top_level_articles.each do |a| copy_article_tree a end - self.articles.reload + self.articles.reload end def copy_article_tree(article, parent=nil) @@ -864,7 +864,7 @@ private :generate_url, :url_options def self.f_region_proc(id) c = Region.find(id) s = c.parent - if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym + if c and c.kind_of?(City) and s and s.kind_of?(State) and s.acronym [c.name, ', ' + s.acronym] else c.name @@ -872,7 +872,7 @@ private :generate_url, :url_options end def self.f_enabled_proc(enabled) - enabled = enabled == "true" ? true : false + enabled = enabled == "true" ? true : false enabled ? _('Enabled') : _('Not enabled') end def f_enabled @@ -920,8 +920,8 @@ private :generate_url, :url_options after_save_reindex [:articles], :with => :delayed_job handle_asynchronously :solr_save - def control_panel_settings_button - {:title => _('Profile Info and settings'), :icon => 'edit-profile'} + def control_panel_settings_button + {:title => _('Profile Info and settings'), :icon => 'edit-profile'} end def followed_by?(person) diff --git a/app/views/layouts/_javascript.rhtml b/app/views/layouts/_javascript.rhtml index bb43c1e..a5dff4e 100644 --- a/app/views/layouts/_javascript.rhtml +++ b/app/views/layouts/_javascript.rhtml @@ -1,7 +1,7 @@ -<%= javascript_include_tag :defaults, 'jquery-latest.js', +<%= javascript_include_tag :defaults, 'jquery-latest.js', 'jquery.noconflict.js', 'jquery.cycle.all.min.js', 'thickbox.js', 'lightbox', 'colorbox', 'jquery-ui-1.8.2.custom.min', 'jquery.scrollTo', 'jquery.form.js', 'jquery-validation/jquery.validate', -'jquery.cookie', 'jquery.ba-bbq.min.js', 'reflection', 'jquery.tokeninput', +'jquery.cookie', 'jquery.ba-bbq.min.js', 'reflection', 'jquery.tokeninput', 'add-and-join', 'report-abuse', 'catalog', 'manage-products', :cache => 'cache-general' %> <% language = FastGettext.locale %> diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index 6207f15..838fb19 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -62,7 +62,7 @@
diff --git a/app/views/manage_products/_display_image.rhtml b/app/views/manage_products/_display_image.rhtml index a17e39a..e8e44fb 100644 --- a/app/views/manage_products/_display_image.rhtml +++ b/app/views/manage_products/_display_image.rhtml @@ -3,7 +3,7 @@ <% if @product.image %> - <%= link_to content_tag(:span, _('Zoom in')), @product.image.public_filename, + <%= link_to content_tag(:span, _('Zoom in')), @product.image.public_filename, :class => 'zoomify-image' %> <% end %> <%= add_zoom_to_images %> diff --git a/app/views/maps/_google_map.js.erb b/app/views/maps/_google_map.js.erb index 78fd623..c0e2bd1 100644 --- a/app/views/maps/_google_map.js.erb +++ b/app/views/maps/_google_map.js.erb @@ -16,7 +16,7 @@ function getAddress(latlng) { function codeAddress() { $('location-fields').addClassName("loading"); - + var country_option = $('profile_data_country').value; var address = $('profile_data_address').value + "-" + $('profile_data_zip_code').value + "," + $('profile_data_city').value+ "-" + $('profile_data_state').value + "," + country_option; @@ -78,7 +78,7 @@ function getAddressData() { } function showAddress(results, status) { - + if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); updateFields(results[0]); @@ -113,10 +113,10 @@ function updateFields(place) { var state = ""; var country_code = ""; var i = 0; - + for( i =0 ; i < components_len; i ++) { - + if (components[i].types[0] == 'country') country_code = components[i].short_name; else if (components[i].types[0] == 'administrative_area_level_1') @@ -132,7 +132,7 @@ function updateFields(place) { else if (components[i].types[0] == 'postal_code') zip_code = components[i].short_name; } - + $('profile_data_country').value = country_code; $('profile_data_state').value = state; $('profile_data_address').value = address; diff --git a/app/views/maps/edit_location.rhtml b/app/views/maps/edit_location.rhtml index 9ed01a4..08c6203 100644 --- a/app/views/maps/edit_location.rhtml +++ b/app/views/maps/edit_location.rhtml @@ -26,9 +26,8 @@ <%= f.hidden_field :lat %> <%= f.hidden_field :lng %> - + <% end %> <%= content_tag('script', '', :src => "http://maps.googleapis.com/maps/api/js?sensor=false", :type => 'text/javascript') %> <%= content_tag('script', '', :src => url_for(:controller => :maps, :action => :google_map), :type => 'text/javascript') %> - diff --git a/app/views/search/_blog.rhtml b/app/views/search/_blog.rhtml index c155bca..e96a519 100644 --- a/app/views/search/_blog.rhtml +++ b/app/views/search/_blog.rhtml @@ -15,7 +15,7 @@ <%= _('None') if r.empty? %> - + <%= render :partial => 'article_common', :object => blog %> <%= render :partial => 'article_last_change', :object => blog %> diff --git a/app/views/search/_display_results.rhtml b/app/views/search/_display_results.rhtml index d7ce59f..6501b65 100644 --- a/app/views/search/_display_results.rhtml +++ b/app/views/search/_display_results.rhtml @@ -31,7 +31,7 @@ <% end %> <% end %> - + <%= add_zoom_to_images %> diff --git a/app/views/search/_image.rhtml b/app/views/search/_image.rhtml index ae82a05..8c83359 100644 --- a/app/views/search/_image.rhtml +++ b/app/views/search/_image.rhtml @@ -1,5 +1,5 @@