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

54 lines
1.7 KiB
Plaintext
Raw Normal View History

2012-10-08 08:58:33 +00:00
<div class="user-info">
<div class="user-avatar pull-left">
<p class="reflective"></p>
<% if @user.avatar? %>
<%= image_tag(@user.avatar.thumb.url) %>
<% else %>
<%= image_tag "person.png" %>
<% end %>
<%= file_field_tag 'file' %>
<%= hidden_field_tag :avatar_cache %>
</div>
<label>
<%= f.check_box :admin %>
<span><%= t('admin.admin') %></span>
</label>
</div>
<%= render :partial=>"infos"%>
2012-10-18 10:36:21 +00:00
<%#= render :partial=>"roles"%>
<% content_for :page_specific_javascript do -%>
<script type="text/javascript">
$(document).ready(function(){
// $("a.submit_btn").click(function(){
// value = $("a.submit_btn").parents("form").find("input[disabled='disabled']")
// jQuery.each(value, function() {
// index = $(this).attr("for");
// console.log(index);
// $("input[for='"+ index +"']").remove();
// });
// value.remove();
// $(this).parents("form")[0].submit();
// });
$(".onoff").click(function(){
var dom = $(this).attr("for");
if($(this).hasClass("disabled")){
$(".controls-block[for="+dom+"] input").removeAttr("disabled");
$(".controls-block[for="+dom+"]").slideDown();
$(this).removeClass("disabled");
$(this).text("OFF");
}else{
$(this).addClass("disabled");
$(".controls-block[for="+dom+"]").slideUp();
$(".controls-block[for="+dom+"] input").attr("disabled","disabled");
$(this).text("ON");
}
return false;
})
})
</script>
<% end -%>