|
|
|
@ -193,9 +193,10 @@
|
|
|
|
|
<% if User.current.admin? %>
|
|
|
|
|
<label class="panel-form-label fl mr18">管理员:</label>
|
|
|
|
|
<span class="fl">
|
|
|
|
|
<input type="checkbox" <%= @user.admin? ? "checked" : "" %> name="admin" value="<%= @user.admin? ? "1" : "0" %>" id="person_admin" class="magic-checkbox" style="float:left; margin-top: 8px;">
|
|
|
|
|
<input type="checkbox" <%= @user.admin? ? "checked" : "" %> id="person_admin" class="magic-checkbox" style="float:left; margin-top: 8px;">
|
|
|
|
|
<label for="person_admin"></label>
|
|
|
|
|
</span>
|
|
|
|
|
<input type="hidden" id="user_admin" name="admin" value="<%= @user.admin? ? "1" : "0" %>">
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
@ -636,9 +637,9 @@
|
|
|
|
|
<% if User.current.admin? %>
|
|
|
|
|
var admin_check = document.getElementById('person_admin').checked;
|
|
|
|
|
if (admin_check) {
|
|
|
|
|
document.getElementById('person_admin').value = "1";
|
|
|
|
|
document.getElementById('user_admin').value = "1";
|
|
|
|
|
} else {
|
|
|
|
|
document.getElementById('person_admin').value = "0";
|
|
|
|
|
document.getElementById('user_admin').value = "0";
|
|
|
|
|
}
|
|
|
|
|
<% end %>
|
|
|
|
|
my_account_form_submit();
|
|
|
|
|