Orbit/app/views/admin/users/_form.html.erb

41 lines
1.5 KiB
Plaintext
Raw Normal View History

2011-12-10 10:03:32 +00:00
<div id="person" class="clear">
<% if @user.avatar? %>
<%= image_tag(@user.avatar.thumb.url) %>
<% else %>
<%= image_tag "person.png" %>
<% end %>
<%= file_field_tag 'file' %>
<%= hidden_field_tag :avatar_cache %>
<label>
2012-09-12 11:12:50 +00:00
<span><%= t(:email) %></span>
<%= f.text_field :email, :onfocus => "this.value='';", :onblur => "if(this.value==''){this.value=#{t(:email)};}", :value => (@user.email.blank? ? t(:email) : @user.email), :class => 'user_mail' %>
2011-12-10 10:03:32 +00:00
</label>
<label>
<%= f.check_box :admin %>
2012-09-12 11:12:50 +00:00
<span><%= t(:admin) %></span>
2011-12-10 10:03:32 +00:00
</label>
<label>
2012-09-12 11:12:50 +00:00
<span><%= t(:role) %></span>
2012-07-25 21:58:09 +00:00
<%= f.select :role_id, @roles.sort_by{|role| role.key }.collect {|role| [ role.title, role.id ]}, :selected => (@user.role_id || Role.get_role_from_key('student')) %>
2011-12-10 10:03:32 +00:00
</label>
</div>
2011-12-23 10:34:21 +00:00
<%= render :partial => 'info', :collection => @infos, :locals => {:f => f} %>
<div id='roles'>
<% @roles.each do |role| %>
<div id="<%= role.id %>_block" class="attributes_block <%= @class %>" <%= raw(' style="display: none;"') unless ((@user.role.id.eql?(role.id) rescue nil) || (role.key.eql?('student') && @user.new_record?)) %>>
2012-07-25 21:58:09 +00:00
<h2><%= role.title %></h2>
<hr class="<#%= @user.role.key %>_block">
2011-12-23 10:34:21 +00:00
<%= render :partial => 'sub_role_selector', :locals => {:f => f, :role => role} %>
<%= render :partial => 'sub_role', :collection => role.sub_roles, :locals => {:f => f, :role => role} %>
2011-12-10 10:03:32 +00:00
</div>
<% end -%>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "user_form" %>
<% end -%>