Commit ec6a779510d070673d1b6773e06d007850b21f53
1 parent
2cad0a73
Exists in
master
and in
29 other branches
invite-members: fix broken tests
Also changed message to be easier to translate
Showing
2 changed files
with
4 additions
and
5 deletions
Show diff stats
app/controllers/public/invite_controller.rb
@@ -8,7 +8,7 @@ class InviteController < PublicController | @@ -8,7 +8,7 @@ class InviteController < PublicController | ||
8 | @import_from = params[:import_from] || "manual" | 8 | @import_from = params[:import_from] || "manual" |
9 | @mail_template = params[:mail_template] || environment.invitation_mail_template(profile) | 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 | last = labels.pop | 12 | last = labels.pop |
13 | label = labels.join(', ') | 13 | label = labels.join(', ') |
14 | @search_friend_fields = "#{label} #{_('or')} #{last}" | 14 | @search_friend_fields = "#{label} #{_('or')} #{last}" |
@@ -72,7 +72,6 @@ class InviteController < PublicController | @@ -72,7 +72,6 @@ class InviteController < PublicController | ||
72 | else | 72 | else |
73 | redirect_to :controller => 'profile', :action => 'members' | 73 | redirect_to :controller => 'profile', :action => 'members' |
74 | end | 74 | end |
75 | - return | ||
76 | else | 75 | else |
77 | redirect_to :action => 'invite_friends' | 76 | redirect_to :action => 'invite_friends' |
78 | session[:notice] = _('Please enter a valid profile.') | 77 | session[:notice] = _('Please enter a valid profile.') |
app/views/invite/invite_friends.html.erb
@@ -4,13 +4,13 @@ | @@ -4,13 +4,13 @@ | ||
4 | <h1><%= _('Invite your friends to join %s') % profile.name %></h1> | 4 | <h1><%= _('Invite your friends to join %s') % profile.name %></h1> |
5 | <% end %> | 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 | <p><%= _('You can search for user profiles and invite them to join this community.') %></p> | 9 | <p><%= _('You can search for user profiles and invite them to join this community.') %></p> |
10 | <%= form_tag :action => 'invite_registered_friend' do %> | 10 | <%= form_tag :action => 'invite_registered_friend' do %> |
11 | <% search_action = url_for(:action => 'search_friend') %> | 11 | <% search_action = url_for(:action => 'search_friend') %> |
12 | <%= token_input_field_tag(:q, 'search-friends', search_action, | 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 | :focus => false }) %> | 14 | :focus => false }) %> |
15 | 15 | ||
16 | <% button_bar do %> | 16 | <% button_bar do %> |