To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / users / _form.html.erb @ 1591:63650ae64bf2
History | View | Annotate | Download (3.59 KB)
| 1 |
<% content_for :header_tags do %>
|
|---|---|
| 2 |
<%= javascript_include_tag "ssamr_institutions" %>
|
| 3 |
<% end %>
|
| 4 |
|
| 5 |
<%= error_messages_for 'user' %>
|
| 6 |
|
| 7 |
<div id="user_form"> |
| 8 |
<!--[form:user]-->
|
| 9 |
<div class="splitcontentleft"> |
| 10 |
<fieldset class="box tabular"> |
| 11 |
<legend><%=l(:label_information_plural)%></legend> |
| 12 |
<p><%= f.text_field :login, :required => true, :size => 25 %></p> |
| 13 |
<p><%= f.text_field :firstname, :required => true %></p> |
| 14 |
<p><%= f.text_field :lastname, :required => true %></p> |
| 15 |
<p><%= f.text_field :mail, :required => true %></p> |
| 16 |
<% unless @user.force_default_language? %>
|
| 17 |
<p><%= f.select :language, lang_options_for_select %></p> |
| 18 |
<% end %>
|
| 19 |
<% if Setting.openid? %>
|
| 20 |
<p><%= f.text_field :identity_url %></p> |
| 21 |
<% end %>
|
| 22 |
|
| 23 |
<% @user.custom_field_values.each do |value| %>
|
| 24 |
<p><%= custom_field_tag_with_label :user, value %></p> |
| 25 |
<% end %>
|
| 26 |
|
| 27 |
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p> |
| 28 |
<%= call_hook(:view_users_form, :user => @user, :form => f) %>
|
| 29 |
</fieldset>
|
| 30 |
|
| 31 |
<div class="box tabular"> |
| 32 |
<h3><%=l(:label_ssamr_details)%></h3> |
| 33 |
<%= labelled_fields_for :ssamr_user_detail, @user.ssamr_user_detail do |ssamr_user_detail| %>
|
| 34 |
<p>
|
| 35 |
<%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %>
|
| 36 |
</p>
|
| 37 |
|
| 38 |
<p><label for="institution"><%=l("field_ssamr_user_detail.institution")%> <span class="required">*</span></label> |
| 39 |
<nobr>
|
| 40 |
<%= ssamr_user_detail.radio_button :institution_type, true %>
|
| 41 |
<%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&', '&').html_safe %>
|
| 42 |
</nobr>
|
| 43 |
</p>
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
<p>
|
| 48 |
<nobr>
|
| 49 |
<%= ssamr_user_detail.radio_button :institution_type, false %> Other:
|
| 50 |
<%= ssamr_user_detail.text_field :other_institution %>
|
| 51 |
</nobr>
|
| 52 |
</p>
|
| 53 |
<% end %>
|
| 54 |
</div>
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
<fieldset class="box tabular"> |
| 59 |
<legend><%=l(:label_authentication)%></legend> |
| 60 |
<% unless @auth_sources.empty? %>
|
| 61 |
<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> |
| 62 |
<% end %>
|
| 63 |
<div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>"> |
| 64 |
<p><%= f.password_field :password, :required => true, :size => 25 %> |
| 65 |
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> |
| 66 |
<p><%= f.password_field :password_confirmation, :required => true, :size => 25 %></p> |
| 67 |
<p><%= f.check_box :generate_password %></p> |
| 68 |
<p><%= f.check_box :must_change_passwd %></p> |
| 69 |
</div>
|
| 70 |
</fieldset>
|
| 71 |
</div>
|
| 72 |
|
| 73 |
<div class="splitcontentright"> |
| 74 |
<fieldset class="box"> |
| 75 |
<legend><%=l(:field_mail_notification)%></legend> |
| 76 |
<%= render :partial => 'users/mail_notifications' %>
|
| 77 |
</fieldset>
|
| 78 |
|
| 79 |
<fieldset class="box tabular"> |
| 80 |
<legend><%=l(:label_preferences)%></legend> |
| 81 |
<%= render :partial => 'users/preferences' %>
|
| 82 |
<%= call_hook(:view_users_form_preferences, :user => @user, :form => f) %>
|
| 83 |
</fieldset>
|
| 84 |
</div>
|
| 85 |
</div>
|
| 86 |
<div style="clear:left;"></div> |
| 87 |
<!--[eoform:user]-->
|
| 88 |
|
| 89 |
<%= javascript_tag do %>
|
| 90 |
$(document).ready(function(){
|
| 91 |
$('#user_generate_password').change(function(){
|
| 92 |
var passwd = $('#user_password, #user_password_confirmation');
|
| 93 |
if ($(this).is(':checked')){
|
| 94 |
passwd.val('').attr('disabled', true);
|
| 95 |
}else{
|
| 96 |
passwd.removeAttr('disabled');
|
| 97 |
} |
| 98 |
}).trigger('change');
|
| 99 |
}); |
| 100 |
<% end %>
|