Commit 3669188260af89c84992b5948e5fa96c89ce32d3

Authored by Antonio Terceiro
2 parents 4ac905ba d74fdaec

Merge branch 'master' into rails-2.3.5

Conflicts:
	debian/changelog
	test/unit/dates_helper_test.rb
AUTHORS
... ... @@ -16,9 +16,11 @@ Daniel Cunha <daniel@colivre.coop.br>
16 16 Fernanda Lopes <nanda.listas+psl@gmail.com>
17 17 Grazieno Pellegrino <grazieno@gmail.com>
18 18 Italo Valcy <italo@dcc.ufba.br>
  19 +João da Silva <jaodsilv@linux.ime.usp.br>
19 20 Joenio Costa <joenio@colivre.coop.br>
20 21 Josef Spillner <josef.spillner@tu-dresden.de>
21 22 Keilla Menezes <keilla@colivre.coop.br>
  23 +Larissa Reis <reiss.larissa@gmail.com>
22 24 Leandro Nunes dos Santos <leandronunes@gmail.com>
23 25 LinguÁgil 2010 <linguagil.bahia@gmail.com>
24 26 Martín Olivera <molivera@solar.org.ar>
... ...
HACKING
... ... @@ -13,7 +13,7 @@ After installing the requirements listed in INSTALL, you need to install some
13 13 packages be able to run Noosfero tests. On Debian GNU/Linux and Debian-based
14 14 systems, you install them with the following command:
15 15  
16   - # apt-get install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb
  16 + # apt-get install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb libxml2-dev libxslt-dev
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.
... ... @@ -24,6 +24,8 @@ management system. Below are the links to their homepages.
24 24 * Imagemagick: http://wwwimagemagick.org/
25 25 * po4a: http://po4a.alioth.debian.org/
26 26 * xvfb: http://packages.debian.org/lenny/xvfb
  27 +* Libxml2: http://xmlsoft.org/
  28 +* Libxslt: http://xmlsoft.org/xslt
27 29  
28 30 == Boostraping a development/test environment
29 31  
... ... @@ -46,6 +48,9 @@ commands and make sure you understand what you are doing):
46 48 rake makemo
47 49 # create some test data:
48 50 ./script/sample-data
  51 + # install latest requirements for running tests
  52 + RAILS_ENV=cucumber rake gems:install
  53 + RAILS_ENV=test rake gems:install
49 54 # run the automated test suite to make sure your environment is sane:
50 55 rake test
51 56  
... ...
app/models/organization.rb
... ... @@ -157,4 +157,8 @@ class Organization &lt; Profile
157 157 members_by_role(role).map { |member| {:id => member.id, :name => member.name} }.to_json
158 158 end
159 159  
  160 + def disable
  161 + self.visible = false
  162 + save!
  163 + end
160 164 end
... ...
app/models/person.rb
... ... @@ -406,6 +406,14 @@ class Person &lt; Profile
406 406 {:title => _('Profile Info and settings'), :icon => 'edit-profile'}
407 407 end
408 408  
  409 + def disable
  410 + self.visible = false
  411 + user.password = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{identifier}--")
  412 + user.password_confirmation = user.password
  413 + save!
  414 + user.save!
  415 + end
  416 +
409 417 protected
410 418  
411 419 def followed_by?(profile)
... ...
app/models/profile.rb
... ... @@ -806,11 +806,6 @@ private :generate_url, :url_options
806 806 end
807 807  
808 808 def disable
809   - self.visible = false
810   - user.password = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{identifier}--")
811   - user.password_confirmation = user.password
812   - save!
813   - user.save!
814 809 end
815 810  
816 811 def control_panel_settings_button
... ...
app/views/blocks/profile_info_actions/community.rhtml
... ... @@ -2,7 +2,7 @@
2 2 <% if logged_in? %>
3 3 <% if profile.members.include?(user) %>
4 4 <li>
5   - <%= button(:delete, content_tag('span', __('Leave')), profile.leave_url,
  5 + <%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,
6 6 :class => 'leave-community',
7 7 :title => _("Leave community"),
8 8 :style => 'position: relative;') %>
... ... @@ -14,7 +14,7 @@
14 14 <% else %>
15 15 <% unless profile.already_request_membership?(user) %>
16 16 <li>
17   - <%= button(:delete, content_tag('span', __('Leave')), profile.leave_url,
  17 + <%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,
18 18 :class => 'leave-community',
19 19 :title => _("Leave community"),
20 20 :style => 'position: relative; display: none;') %>
... ...
app/views/profile/_organization_profile.rhtml
... ... @@ -15,7 +15,7 @@
15 15 <%= display_field(_('Location:'), profile, :location, true) %>
16 16  
17 17 <tr>
18   - <td class='field-name'><%= _('Created at:') %></td>
  18 + <td class='field-name'><%= _('Profile created at:') %></td>
19 19 <td><%= show_date(profile.created_at) %></td>
20 20 </tr>
21 21  
... ...
app/views/profile/_person_profile.rhtml
... ... @@ -9,7 +9,7 @@
9 9 <%= display_field(_('Type:'), profile, :privacy_setting, true) %>
10 10  
11 11 <tr>
12   - <td class='field-name'><%= _('Created at:') %></td>
  12 + <td class='field-name'><%= _('Profile created at:') %></td>
13 13 <td><%= show_date(profile.created_at) %></td>
14 14 </tr>
15 15  
... ...
app/views/profile/_profile.rhtml
... ... @@ -11,19 +11,14 @@
11 11 <% end %>
12 12  
13 13 <% if @profile.organization? %>
14   - <% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %>
15   - <% tabs << {:title => _('What\'s new'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %>
16   - <% end %>
  14 + <% tabs << {:title => _('What\'s new'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %>
17 15 <% tabs << {:title => _('Profile'), :id => 'organization-profile', :content => (render :partial => 'organization_profile')} %>
18 16 <% elsif @profile.person? %>
19 17 <% if logged_in? && current_person.follows?(@profile) %>
20 18 <% tabs << {:title => _('Network'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %>
21 19 <% end %>
22 20  
23   - <% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %>
24   - <% tabs << {:title => _('Activity'), :id => 'profile-activity', :content => (render :partial => 'profile_activity')} %>
25   - <% end %>
26   -
  21 + <% tabs << {:title => _('Activity'), :id => 'profile-activity', :content => (render :partial => 'profile_activity')} %>
27 22 <% tabs << {:title => _('Profile'), :id => 'person-profile', :content => (render :partial => 'person_profile')} %>
28 23 <% end %>
29 24  
... ...
app/views/profile/index.rhtml
... ... @@ -15,6 +15,8 @@
15 15 </div>
16 16 <% end %>
17 17  
18   -<table class='profile'>
19   - <%= render :partial => 'profile' %>
20   -</table>
  18 +<% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %>
  19 + <table class='profile'>
  20 + <%= render :partial => 'profile' %>
  21 + </table>
  22 +<% end %>
... ...
config/environments/cucumber.rb
... ... @@ -21,8 +21,8 @@ config.action_mailer.delivery_method = :test
21 21  
22 22 config.gem 'cucumber', :lib => false, :version => '0.4.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber'))
23 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.8' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
25   -config.gem 'rspec-rails', :lib => 'spec/rails', :version => '>=1.2.7.1' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
  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 26 config.gem 'Selenium', :lib => 'selenium', :version => '>= 1.1.14' unless File.directory?(File.join(Rails.root, 'vendor/plugins/selenium'))
27 27 config.gem 'selenium-client', :lib => 'selenium/client', :version => '>= 1.2.17' unless File.directory?(File.join(Rails.root, 'vendor/plugins/selenium-client'))
28 28 config.gem 'database_cleaner', :lib => 'database_cleaner'
... ...
config/environments/test.rb
... ... @@ -20,3 +20,5 @@ config.action_controller.allow_forgery_protection = false
20 20 # The :test delivery method accumulates sent emails in the
21 21 # ActionMailer::Base.deliveries array.
22 22 config.action_mailer.delivery_method = :test
  23 +
  24 +config.gem 'exception_notification', :lib => 'exception_notification', :version => '1.0.20090728'
... ...
debian/changelog
... ... @@ -9,6 +9,12 @@ noosfero (0.35.0~1) unstable; urgency=low
9 9  
10 10 -- Antonio Terceiro <terceiro@colivre.coop.br> Sun, 27 Nov 2011 14:11:33 -0200
11 11  
  12 +noosfero (0.34.1) unstable; urgency=low
  13 +
  14 + * Bugfixes version release
  15 +
  16 + -- Daniela Soares Feitosa <daniela@colivre.coop.br> Wed, 07 Dec 2011 00:52:59 -0200
  17 +
12 18 noosfero (0.34.0) unstable; urgency=low
13 19  
14 20 * Features version release.
... ...
features/private_profile.feature
... ... @@ -40,3 +40,15 @@ Feature: private profiles
40 40 When I am on Safernet's homepage
41 41 Then I should see "What's new"
42 42  
  43 + Scenario: person private profiles should not display sensible information
  44 + Given I am logged in as "joao"
  45 + When I go to shygirl's homepage
  46 + Then I should not see "Basic information"
  47 + Then I should not see "Work"
  48 + Then I should not see "Enterprises"
  49 + Then I should not see "Network"
  50 +
  51 + Scenario: community private profiles should not display sensible information
  52 + Given I am logged in as "joao"
  53 + When I go to Safernet's homepage
  54 + Then I should not see "Basic information"
... ...
lib/noosfero.rb
1 1 module Noosfero
2 2 PROJECT = 'noosfero'
3   - VERSION = '0.34.0'
  3 + VERSION = '0.34.1'
4 4  
5 5 def self.pattern_for_controllers_in_directory(dir)
6 6 disjunction = controllers_in_directory(dir).join('|')
... ...
lib/tasks/gettext.rake
... ... @@ -8,7 +8,7 @@ makemo_stamp = &#39;tmp/makemo.stamp&#39;
8 8 desc "Create mo-files for L10n"
9 9 task :makemo => makemo_stamp
10 10 file makemo_stamp => Dir.glob('po/*/noosfero.po') do
11   - ruby '-rconfig/boot -rgettext -rgettext/utils -e \'GetText.create_mofiles(true, "po", "locale") 2>/dev/null'
  11 + ruby '-rconfig/boot -e \'require "gettext"; require "gettext/utils"; GetText.create_mofiles(true, "po", "locale") 2>/dev/null'
12 12 Rake::Task['symlinkmo'].invoke
13 13 FileUtils.touch makemo_stamp
14 14 end
... ...
plugins/shopping_cart/controllers/shopping_cart_plugin_myprofile_controller.rb
... ... @@ -24,7 +24,7 @@ class ShoppingCartPluginMyprofileController &lt; MyProfileController
24 24 condition = 'created_at >= ? AND created_at <= ?'
25 25 condition_parameters = [@from, @to+1.day]
26 26 if @status
27   - condition += ' AND status == ?'
  27 + condition += ' AND status = ?'
28 28 condition_parameters << @status
29 29 end
30 30  
... ...
plugins/shopping_cart/views/shopping_cart_plugin_profile/buy.html.erb
... ... @@ -22,7 +22,13 @@
22 22 <script type="text/javascript">
23 23 //<![CDATA[
24 24 jQuery(document).ready(function(){
25   - jQuery("#cart-request-form").validate();
  25 + jQuery("#cart-request-form").validate({
  26 + submitHandler: function(form) {
  27 + jQuery(form).find('input.submit').attr('disabled', true);
  28 + jQuery('#cboxLoadingOverlay').show().addClass('loading');
  29 + jQuery('#cboxLoadingGraphic').show().addClass('loading');
  30 + }
  31 + });
26 32 });
27 33 //]]>
28 34 </script>
... ...
po/pt/noosfero.po
... ... @@ -224,7 +224,7 @@ msgstr &quot;&quot;
224 224  
225 225 #: app/helpers/forum_helper.rb:4
226 226 msgid "New discussion topic"
227   -msgstr "Novo tópido de discussão"
  227 +msgstr "Novo tópico de discussão"
228 228  
229 229 #: app/helpers/forum_helper.rb:8
230 230 msgid "Configure forum"
... ...
test/unit/dates_helper_test.rb
... ... @@ -17,22 +17,22 @@ class DatesHelperTest &lt; ActiveSupport::TestCase
17 17  
18 18 should 'generate period with two dates' do
19 19 date1 = mock
20   - expects(:show_date).with(date1, false).returns('XXX')
  20 + expects(:show_date).with(date1, anything).returns('XXX')
21 21 date2 = mock
22   - expects(:show_date).with(date2, false).returns('YYY')
  22 + expects(:show_date).with(date2, anything).returns('YYY')
23 23 expects(:_).with('from %{date1} to %{date2}').returns('from %{date1} to %{date2}')
24 24 assert_equal 'from XXX to YYY', show_period(date1, date2)
25 25 end
26 26  
27 27 should 'generate period with two equal dates' do
28 28 date1 = mock
29   - expects(:show_date).with(date1, false).returns('XXX')
  29 + expects(:show_date).with(date1, anything).returns('XXX')
30 30 assert_equal 'XXX', show_period(date1, date1)
31 31 end
32 32  
33 33 should 'generate period with one date only' do
34 34 date1 = mock
35   - expects(:show_date).with(date1, false).returns('XXX')
  35 + expects(:show_date).with(date1, anything).returns('XXX')
36 36 assert_equal 'XXX', show_period(date1)
37 37 end
38 38  
... ...
test/unit/organization_test.rb
... ... @@ -408,4 +408,12 @@ class OrganizationTest &lt; ActiveSupport::TestCase
408 408 assert_match [{:id => p1.id, :name => p1.name}, {:id => p2.id, :name => p2.name}].to_json, organization.members_by_role_to_json(role)
409 409 end
410 410  
  411 + should 'disable organization' do
  412 + organization = fast_create(Organization, :visible => true)
  413 + assert organization.visible
  414 +
  415 + organization.disable
  416 + assert !organization.visible
  417 + end
  418 +
411 419 end
... ...
test/unit/person_test.rb
... ... @@ -1226,4 +1226,14 @@ class PersonTest &lt; ActiveSupport::TestCase
1226 1226 assert person.already_reported?(profile)
1227 1227 end
1228 1228  
  1229 + should 'disable person' do
  1230 + person = create_user('some-user').person
  1231 + password = person.user.password
  1232 + assert person.visible
  1233 +
  1234 + person.disable
  1235 +
  1236 + assert !person.visible
  1237 + assert_not_equal password, person.user.password
  1238 + end
1229 1239 end
... ...