Commit ec6a779510d070673d1b6773e06d007850b21f53

Authored by Daniela Feitosa
1 parent 2cad0a73

invite-members: fix broken tests

Also changed message to be easier to translate
app/controllers/public/invite_controller.rb
... ... @@ -8,7 +8,7 @@ class InviteController < PublicController
8 8 @import_from = params[:import_from] || "manual"
9 9 @mail_template = params[:mail_template] || environment.invitation_mail_template(profile)
10 10  
11   - labels = Profile::SEARCHABLE_FIELDS.except(:nickname).merge(User::SEARCHABLE_FIELDS).map { |name,info| info[:label] }
  11 + labels = Profile::SEARCHABLE_FIELDS.except(:nickname).merge(User::SEARCHABLE_FIELDS).map { |name,info| info[:label].downcase }
12 12 last = labels.pop
13 13 label = labels.join(', ')
14 14 @search_friend_fields = "#{label} #{_('or')} #{last}"
... ... @@ -72,7 +72,6 @@ class InviteController < PublicController
72 72 else
73 73 redirect_to :controller => 'profile', :action => 'members'
74 74 end
75   - return
76 75 else
77 76 redirect_to :action => 'invite_friends'
78 77 session[:notice] = _('Please enter a valid profile.')
... ...
app/views/invite/invite_friends.html.erb
... ... @@ -4,13 +4,13 @@
4 4 <h1><%= _('Invite your friends to join %s') % profile.name %></h1>
5 5 <% end %>
6 6  
7   -<% unless profile.person? %>
8   - <h2><%= _('Invite other registered users') %></h2>
  7 +<% if profile.community? %>
  8 + <h2><%= _('Invite registered users') %></h2>
9 9 <p><%= _('You can search for user profiles and invite them to join this community.') %></p>
10 10 <%= form_tag :action => 'invite_registered_friend' do %>
11 11 <% search_action = url_for(:action => 'search_friend') %>
12 12 <%= token_input_field_tag(:q, 'search-friends', search_action,
13   - { :hint_text => _('Type in your friend\'s ') + @search_friend_fields,
  13 + { :hint_text => _('Type in your friend\'s %{search_fields}') % {:search_fields => @search_friend_fields},
14 14 :focus => false }) %>
15 15  
16 16 <% button_bar do %>
... ...