2006-06-28 22:11:03 +04:00
|
|
|
<%= error_messages_for 'user' %>
|
|
|
|
|
2011-03-20 14:49:29 +03:00
|
|
|
<div id="user_form">
|
2006-06-28 22:11:03 +04:00
|
|
|
<!--[form:user]-->
|
2011-03-20 14:49:29 +03:00
|
|
|
<div class="splitcontentleft">
|
2011-07-03 16:21:37 +04:00
|
|
|
<fieldset class="box tabular">
|
2011-09-17 03:55:07 +04:00
|
|
|
<legend><%=l(:label_information_plural)%></legend>
|
|
|
|
<p><%= f.text_field :login, :required => true, :size => 25 %></p>
|
|
|
|
<p><%= f.text_field :firstname, :required => true %></p>
|
|
|
|
<p><%= f.text_field :lastname, :required => true %></p>
|
|
|
|
<p><%= f.text_field :mail, :required => true %></p>
|
|
|
|
<p><%= f.select :language, lang_options_for_select %></p>
|
|
|
|
<% if Setting.openid? %>
|
|
|
|
<p><%= f.text_field :identity_url %></p>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% @user.custom_field_values.each do |value| %>
|
|
|
|
<p><%= custom_field_tag_with_label :user, value %></p>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p>
|
|
|
|
<%= call_hook(:view_users_form, :user => @user, :form => f) %>
|
2011-07-03 16:21:37 +04:00
|
|
|
</fieldset>
|
2007-03-12 20:59:02 +03:00
|
|
|
|
2011-07-03 16:21:37 +04:00
|
|
|
<fieldset class="box tabular">
|
2011-09-17 03:55:07 +04:00
|
|
|
<legend><%=l(:label_authentication)%></legend>
|
|
|
|
<% unless @auth_sources.empty? %>
|
2012-07-22 17:29:26 +04:00
|
|
|
<p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {$('#password_fields').show();} else {$('#password_fields').hide();}" %></p>
|
2011-09-17 03:55:07 +04:00
|
|
|
<% end %>
|
|
|
|
<div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>">
|
2012-02-03 00:07:37 +04:00
|
|
|
<p><%= f.password_field :password, :required => true, :size => 25 %>
|
|
|
|
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p>
|
2011-09-17 03:55:07 +04:00
|
|
|
<p><%= f.password_field :password_confirmation, :required => true, :size => 25 %></p>
|
2013-08-05 21:58:33 +04:00
|
|
|
<p><%= f.check_box :generate_password %></p>
|
|
|
|
<p><%= f.check_box :must_change_passwd %></p>
|
2011-09-17 03:55:07 +04:00
|
|
|
</div>
|
2011-07-03 16:21:37 +04:00
|
|
|
</fieldset>
|
2011-03-20 14:49:29 +03:00
|
|
|
</div>
|
2010-09-29 02:13:06 +04:00
|
|
|
|
2011-03-20 14:49:29 +03:00
|
|
|
<div class="splitcontentright">
|
2011-07-03 16:21:37 +04:00
|
|
|
<fieldset class="box">
|
2011-09-17 03:55:07 +04:00
|
|
|
<legend><%=l(:field_mail_notification)%></legend>
|
|
|
|
<%= render :partial => 'users/mail_notifications' %>
|
2011-07-03 16:21:37 +04:00
|
|
|
</fieldset>
|
2010-09-29 02:13:06 +04:00
|
|
|
|
2011-07-03 16:21:37 +04:00
|
|
|
<fieldset class="box tabular">
|
2011-09-17 03:55:07 +04:00
|
|
|
<legend><%=l(:label_preferences)%></legend>
|
|
|
|
<%= render :partial => 'users/preferences' %>
|
2013-08-05 22:29:29 +04:00
|
|
|
<%= call_hook(:view_users_form_preferences, :user => @user, :form => f) %>
|
2011-07-03 16:21:37 +04:00
|
|
|
</fieldset>
|
2011-03-20 14:49:29 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="clear:left;"></div>
|
2006-11-12 21:50:30 +03:00
|
|
|
<!--[eoform:user]-->
|
2013-02-23 20:50:07 +04:00
|
|
|
|
|
|
|
<%= javascript_tag do %>
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('#user_generate_password').change(function(){
|
|
|
|
var passwd = $('#user_password, #user_password_confirmation');
|
|
|
|
if ($(this).is(':checked')){
|
|
|
|
passwd.val('').attr('disabled', true);
|
|
|
|
}else{
|
|
|
|
passwd.removeAttr('disabled');
|
|
|
|
}
|
|
|
|
}).trigger('change');
|
|
|
|
});
|
|
|
|
<% end %>
|