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

37 lines
1.0 KiB
Plaintext
Raw Normal View History

2011-02-01 02:46:26 +00:00
<div id="select_user_roles">
<% @user_role_models.each do |ua| %>
<%= check_box_tag "user[active_roles][]", ua.key, (@user.active_roles.include?(ua.key) rescue false) %> <%= ua.i18n_variable[locale] %>
<% end -%>
2011-02-01 02:46:26 +00:00
<%= hidden_field_tag 'user[active_roles][]', '' %>
</div>
<div>
<label><%= t('panel.my_avatar') %></label>
<%= image_tag(@user.avatar.thumb.url) if @user.avatar? %>
<%= file_field_tag 'file' %>
<%= hidden_field_tag :avatar_cache %>
</div>
<div>
<p>
<%= f.label :email %>
<%= f.text_field :email %>
</p>
</div>
2011-02-01 02:46:26 +00:00
<% @user_role_models.each do |ua| %>
<%= render :partial => 'user_role',
:object => (@user.user_roles.detect {|u| u.key == ua.key } || @user.user_roles.build),
:locals => {:ua => ua} %>
2010-03-08 09:14:59 +00:00
<% end -%>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
2011-02-01 02:46:26 +00:00
$('#select_user_roles input').click(function(){
$("#role_"+this.value).toggle();
});
});
</script>
<% end -%>