rosa-build/app/views/admin/users/index.html.haml

39 lines
2.0 KiB
Plaintext
Raw Normal View History

2013-01-10 15:50:49 +00:00
%h3.fix= title t("layout.users.#{@filter == 'system' ? 'system' : 'list_header'}")
-if @filter == 'system'
- columns = [{:type => 'html'}, {:type => nil, :sortable => false, :searchable => false, :class => 'buttons'}]
-else
- columns = [{:type => 'html'}, {:type => 'html'}, {:type => 'html'}, {:type => 'html'}, {:type => 'html', :sortable => false, :searchable => false}, {:type => nil, :sortable => false, :searchable => false, :class => 'buttons'}]
= raw datatable(columns, {:sort_by => "[0, 'asc']", :processing => t("layout.processing"), :search_label => t("layout.search.header"),
2012-03-20 18:11:28 +00:00
:pagination_labels => {:previous => t("datatables.previous_label"), :next => t("datatables.next_label")},
:empty_label => t("datatables.empty_label"),
:info_label => t("datatables.info_label"),
:info_empty_label => t("datatables.info_empty_label"),
:filtered_label => t("datatables.filtered_label"),
:table_dom_id => 'datatable',
:auto_width => 'false',
2013-01-11 10:03:24 +00:00
:ajax_source => "#{url_for :controller => 'admin/users', :action => :list, :system => (@filter == 'system')}",
2012-03-20 18:11:28 +00:00
:additional_data => {:filter => "' + $('#users_filter[type=\"radio\"]:checked').val() + '"} })
%table#datatable.tablesorter.list-users{:cellspacing => 0, :cellpadding => 0}
%thead
%tr
2013-01-10 15:50:49 +00:00
-if @filter == 'system'
%th.th2= t("activerecord.attributes.user.uname")
-else
%th.th1= t("activerecord.attributes.user.name")
%th.th2= t("activerecord.attributes.user.uname")
%th.th3= t("activerecord.attributes.user.email")
%th.th1= t("activerecord.attributes.user.created_at")
2013-01-10 15:50:49 +00:00
%th.th4= t("activerecord.attributes.user.role")
2012-03-20 18:11:28 +00:00
%th.last  
%tbody
%br
= render 'sidebar'
= render 'submenu'
2012-03-20 18:11:28 +00:00
:javascript
$('#users_filter[type="radio"]').live('change', function(){
$('#datatable').dataTable().fnDraw();
});