Commit 66376b84f6a50f6329c9eb2a293b0ae1b6935c39

Authored by Antonio Terceiro
2 parents 51e93495 33d03675

Merge branch 'stable'

app/models/recent_documents_block.rb
@@ -12,7 +12,7 @@ class RecentDocumentsBlock < Block @@ -12,7 +12,7 @@ class RecentDocumentsBlock < Block
12 _('This block lists your recent content.') 12 _('This block lists your recent content.')
13 end 13 end
14 14
15 - settings_items :limit 15 + settings_items :limit, :type => :integer, :default => 5
16 16
17 include ActionController::UrlWriter 17 include ActionController::UrlWriter
18 def content 18 def content
app/views/account/_signup_form.rhtml
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 <% labelled_form_for :user, @user, 12 <% labelled_form_for :user, @user,
13 :html => { :help=>_('Fill all this fields to join in this environment. <p/> If you forgot your password, do not create a new account, click on the "<b>I forgot my password!</b>" link. ;-)'), :id => 'profile-data' 13 :html => { :help=>_('Fill all this fields to join in this environment. <p/> If you forgot your password, do not create a new account, click on the "<b>I forgot my password!</b>" link. ;-)'), :id => 'profile-data'
14 } do |f| -%> 14 } do |f| -%>
  15 +<%= icaptcha_field() %>
15 16
16 <%= hidden_field_tag :invitation_code, @invitation_code %> 17 <%= hidden_field_tag :invitation_code, @invitation_code %>
17 18
@@ -48,8 +49,6 @@ @@ -48,8 +49,6 @@
48 <%= render :partial => 'profile_editor/person_form', :locals => {:f => f} %> 49 <%= render :partial => 'profile_editor/person_form', :locals => {:f => f} %>
49 <% end %> 50 <% end %>
50 51
51 -<%= icaptcha_field() %>  
52 -  
53 <% if @terms_of_use %> 52 <% if @terms_of_use %>
54 <%= _("By clicking on 'I accept the terms of use' below you are agreeing to the %s") % 53 <%= _("By clicking on 'I accept the terms of use' below you are agreeing to the %s") %
55 link_to_function(_('Terms of use'), nil) do |page| 54 link_to_function(_('Terms of use'), nil) do |page|
app/views/contact/new.rhtml
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 4
5 5
6 <% labelled_form_for :contact, @contact do |f| %> 6 <% labelled_form_for :contact, @contact do |f| %>
  7 + <%= icaptcha_field() %>
7 8
8 <%= required_fields_message %> 9 <%= required_fields_message %>
9 10
@@ -16,8 +17,6 @@ @@ -16,8 +17,6 @@
16 <%= required f.text_area(:message, :rows => 10, :cols => 60) %> 17 <%= required f.text_area(:message, :rows => 10, :cols => 60) %>
17 <%= labelled_form_field check_box(:contact, :receive_a_copy) + _('I want to receive a copy of the message in my e-mail.'), '' %> 18 <%= labelled_form_field check_box(:contact, :receive_a_copy) + _('I want to receive a copy of the message in my e-mail.'), '' %>
18 19
19 - <%= icaptcha_field() %>  
20 -  
21 <%= submit_button(:send, _('Send')) %> 20 <%= submit_button(:send, _('Send')) %>
22 21
23 <% end %> 22 <% end %>
app/views/content_viewer/_comment_form.rhtml
@@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
18 <h4><%= content_tag('a', '', :name => 'comment_form') + _('Post a comment') %></h4> 18 <h4><%= content_tag('a', '', :name => 'comment_form') + _('Post a comment') %></h4>
19 19
20 <% form_tag( @page.view_url, { :id => comment_form_id } ) do %> 20 <% form_tag( @page.view_url, { :id => comment_form_id } ) do %>
  21 + <%= icaptcha_field() %>
21 22
22 <%= required_fields_message %> 23 <%= required_fields_message %>
23 24
@@ -25,7 +26,6 @@ @@ -25,7 +26,6 @@
25 26
26 <%= required labelled_form_field(_('Name'), text_field(:comment, :name)) %> 27 <%= required labelled_form_field(_('Name'), text_field(:comment, :name)) %>
27 <%= required labelled_form_field(_('e-mail'), text_field(:comment, :email)) %> 28 <%= required labelled_form_field(_('e-mail'), text_field(:comment, :email)) %>
28 - <%= icaptcha_field() %>  
29 29
30 <p> 30 <p>
31 <%= _('If you are a registered user, you can login and be automatically recognized.') %> 31 <%= _('If you are a registered user, you can login and be automatically recognized.') %>
public/designs/icons/tango/ie6.css
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 .msie6 .icon-forward { background-image: url(ie6/Tango/16x16/actions/go-next.gif) } 25 .msie6 .icon-forward { background-image: url(ie6/Tango/16x16/actions/go-next.gif) }
26 .msie6 .icon-search { background-image: url(ie6/Tango/16x16/actions/search.gif) } 26 .msie6 .icon-search { background-image: url(ie6/Tango/16x16/actions/search.gif) }
27 .msie6 .icon-ok { background-image: url(ie6/Tango/16x16/actions/media-playback-start.gif) } 27 .msie6 .icon-ok { background-image: url(ie6/Tango/16x16/actions/media-playback-start.gif) }
28 -.msie6 .icon-login { background-image: url(ie6/Tango-mod/16x16/actions/login.gif) } 28 +.msie6 .icon-login { background-image: url(ie6/Tango-mod/16x16/actions/log-in.gif) }
29 .msie6 .icon-help { background-image: url(ie6/Tango/16x16/apps/gnome-help.gif) } 29 .msie6 .icon-help { background-image: url(ie6/Tango/16x16/apps/gnome-help.gif) }
30 .msie6 .icon-firefox { background-image: url(firefox-24x24.gif) } 30 .msie6 .icon-firefox { background-image: url(firefox-24x24.gif) }
31 .msie6 .icon-help32on { background-image: url(ie6/Tango/32x32/apps/gnome-help.gif) } 31 .msie6 .icon-help32on { background-image: url(ie6/Tango/32x32/apps/gnome-help.gif) }
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 .msie6 .icon-menu-ctrl-panel { background-image: url(ie6/Tango/16x16/categories/preferences-desktop.gif) } 40 .msie6 .icon-menu-ctrl-panel { background-image: url(ie6/Tango/16x16/categories/preferences-desktop.gif) }
41 .msie6 .icon-menu-admin { background-image: url(ie6/Tango/16x16/categories/preferences-system.gif) } 41 .msie6 .icon-menu-admin { background-image: url(ie6/Tango/16x16/categories/preferences-system.gif) }
42 .msie6 .icon-menu-my-groups { background-image: url(ie6/Tango/16x16/apps/system-config-users.gif) } 42 .msie6 .icon-menu-my-groups { background-image: url(ie6/Tango/16x16/apps/system-config-users.gif) }
43 -.msie6 .icon-menu-login { background-image: url(ie6/Tango-mod/16x16/actions/login.gif) } 43 +.msie6 .icon-menu-login { background-image: url(ie6/Tango-mod/16x16/actions/log-in.gif) }
44 .msie6 .icon-menu-logout { background-image: url(ie6/Tango/16x16/actions/exit.gif) } 44 .msie6 .icon-menu-logout { background-image: url(ie6/Tango/16x16/actions/exit.gif) }
45 .msie6 .icon-menu-search { background-image: url(ie6/Tango/16x16/actions/search.gif) } 45 .msie6 .icon-menu-search { background-image: url(ie6/Tango/16x16/actions/search.gif) }
46 .msie6 .icon-menu-events { background-image: url(ie6/Tango/16x16/mimetypes/stock_calendar.gif) } 46 .msie6 .icon-menu-events { background-image: url(ie6/Tango/16x16/mimetypes/stock_calendar.gif) }
test/functional/profile_members_controller_test.rb
@@ -45,7 +45,7 @@ class ProfileMembersControllerTest &lt; Test::Unit::TestCase @@ -45,7 +45,7 @@ class ProfileMembersControllerTest &lt; Test::Unit::TestCase
45 45
46 should 'show form to change role' do 46 should 'show form to change role' do
47 ent = Enterprise.create!(:identifier => 'test_enterprise', :name => 'test enterprise') 47 ent = Enterprise.create!(:identifier => 'test_enterprise', :name => 'test enterprise')
48 - role = Role.create!(:name => 'member_role', :permissions => ['edit_profile']) 48 + role = Role.create!(:name => 'member_role', :environment => Environment.default, :permissions => ['edit_profile'])
49 member = create_user('test_member').person 49 member = create_user('test_member').person
50 member.add_role(role, ent) 50 member.add_role(role, ent)
51 user = create_user_with_permission('test_user', 'manage_memberships', ent) 51 user = create_user_with_permission('test_user', 'manage_memberships', ent)
test/unit/recent_documents_block_test.rb
@@ -44,6 +44,16 @@ class RecentDocumentsBlockTest &lt; Test::Unit::TestCase @@ -44,6 +44,16 @@ class RecentDocumentsBlockTest &lt; Test::Unit::TestCase
44 assert_no_match /href=.*\/testinguser\/first/, output 44 assert_no_match /href=.*\/testinguser\/first/, output
45 end 45 end
46 46
  47 + should 'store limit as a number' do
  48 + block.limit = ''
  49 + assert block.limit.is_a?(Fixnum)
  50 + end
  51 +
  52 + should 'have a non-zero default' do
  53 + block.limit = nil
  54 + assert block.limit > 0
  55 + end
  56 +
47 should 'display a link to sitemap with title "All content"' do 57 should 'display a link to sitemap with title "All content"' do
48 expects(:link_to).with('All content', :controller => 'profile', :action => 'sitemap', :profile => profile.identifier) 58 expects(:link_to).with('All content', :controller => 'profile', :action => 'sitemap', :profile => profile.identifier)
49 expects(:_).with('All content').returns('All content') 59 expects(:_).with('All content').returns('All content')