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

39 lines
1.9 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'
2014-01-21 04:51:49 +00:00
- columns = [{type: 'html'}, {type: nil, sortable: false, searchable: false, class: 'buttons'}]
2013-01-10 15:50:49 +00:00
-else
2014-01-21 04:51:49 +00:00
- 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"),
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',
ajax_source: "#{url_for controller: 'admin/users', action: :list, system: (@filter == 'system')}",
additional_data: {filter: "' + $('#users_filter[type=\"radio\"]:checked').val() + '"} })
2012-03-20 18:11:28 +00:00
2014-01-21 04:51:49 +00:00
%table#datatable.tablesorter.list-users{cellspacing: 0, cellpadding: 0}
2012-03-20 18:11:28 +00:00
%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
2014-03-13 10:09:00 +00:00
$('#users_filter[type="radio"]').on('change', function(){
2012-03-20 18:11:28 +00:00
$('#datatable').dataTable().fnDraw();
});