rosa-build/app/views/admin/users/_users_ajax.js.erb

20 lines
803 B
Plaintext
Raw Normal View History

2012-03-20 18:11:28 +00:00
{
"sEcho": <%=h params[:sEcho].to_i || -1 %>,
"iTotalRecords": <%= @total_users %>,
"iTotalDisplayRecords": <%= @total_user %>,
"aaData": [
<% @users.each do |user| %>
[
"<%= user.name %>",
"<%= user.uname %>",
"<%= user.email %>",
2012-03-22 14:50:15 +00:00
"<span style='<%=user.access_locked? ? 'background: #FEDEDE' : ''%>'><%= user.role %></span>",
"<%= j raw [(link_to t('layout.show'), user if can? :read, user),
(link_to t('layout.edit'), edit_admin_user_path(user) if can? :edit, user),
(link_to t('layout.delete'), admin_user_path(user), :method => :delete, :confirm => t('layout.users.confirm_delete') if can? :destroy, user)
2012-03-20 18:11:28 +00:00
].compact.join('&nbsp;|&nbsp;') %>"
]<%= user == @users.last ? '' : ',' %>
<% end %>
]
}