<commit_before><% 
  @user_ids = []
  @current_user.company.projects.each do |p|
    @user_ids << p.users.collect{ |pu| pu.id }
  end

  @user_ids = [0] if @user_ids.size == 0
  @users = User.find(:all, :conditions => ["id IN (#{@user_ids.uniq.join(',')})"], :order => "name").collect{|u| [u.name, u.id.to_s]}
%>
<div id="content">
<fieldset>
<legend>New User</legend>

<% form_tag :action => 'create' do %>
  <%= render :partial => "form" %>

  <label for="welcome_message"><%=_('Signup Message')%></label><%= text_area_tag 'welcome_message', {}, { :rows => 10, :style => "width:80%;"} %> <br/>
  <label></label><span class="optional"><%=_('The message will be included in the signup email.')%></span>
  <label>&nbsp;</label>
  <%= submit_tag _("Create"), :class => 'nolabel' %><span style="padding-top:0.3em;padding-right:0.5em;float:left;"> <%= _'and copy permissions from'%></span><div style="float:left;">
  <select name="copy_user" id="copy_user">
     <option value="0" class="select_default"><%= _("[No one]") %></option>
     <%= options_for_select @users, params[:copy_user].to_i %>
  </select>
  </div>
<% end %>

</fieldset>
</div><commit_msg>Fix new user for people with projects without any users<commit_after><% 
  @user_ids = []
  @current_user.company.projects.each do |p|
    @user_ids << p.users.collect{ |pu| pu.id }
  end

  @user_ids = [0] if @user_ids.size == 0
  @users = User.find(:all, :conditions => ["id IN (#{@user_ids.flatten.compact.uniq.join(',')})"], :order => "name").collect{|u| [u.name, u.id.to_s]}
%>
<div id="content">
<fieldset>
<legend>New User</legend>

<% form_tag :action => 'create' do %>
  <%= render :partial => "form" %>

  <label for="welcome_message"><%=_('Signup Message')%></label><%= text_area_tag 'welcome_message', {}, { :rows => 10, :style => "width:80%;"} %> <br/>
  <label></label><span class="optional"><%=_('The message will be included in the signup email.')%></span>
  <label>&nbsp;</label>
  <%= submit_tag _("Create"), :class => 'nolabel' %><span style="padding-top:0.3em;padding-right:0.5em;float:left;"> <%= _'and copy permissions from'%></span><div style="float:left;">
  <select name="copy_user" id="copy_user">
     <option value="0" class="select_default"><%= _("[No one]") %></option>
     <%= options_for_select @users, params[:copy_user].to_i %>
  </select>
  </div>
<% end %>

</fieldset>
</div>
{'fraction_non_alphanumeric': 0.24493243243243243, 'fraction_numerical': 0.009290540540540541, 'mean_word_length': 5.043367346938775, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3482717', 'n_tokens_mistral': 921, 'n_tokens_neox': 867, 'n_words': 180}