app/views/wobauth/users/index.html.erb in wobauth-5.1.1 vs app/views/wobauth/users/index.html.erb in wobauth-5.1.2
- old
+ new
@@ -1,50 +1,55 @@
<h1><%= t('controller.wobauth/users') %></h1>
-<%= content_tag :table, id: :wobauth_users, role: :wobauth_datatable,
- class: "table table-bordered table-striped dataTable" do %>
-<thead>
- <tr>
- <th><%= t('attributes.name') %></th>
- <th class="notvisible"><%= t('attributes.sn') %></th>
- <th class="notvisible"><%= t('attributes.givenname') %></th>
- <th class="notvisible"><%= t('attributes.title') %></th>
- <th><%= t('attributes.username') %></th>
- <th><%= t('attributes.telephone') %></th>
- <th><%= t('attributes.email') %></th>
- <th class="notvisible"><%= t('attributes.position') %></th>
- <th class="notvisible"><%= t('attributes.department') %></th>
- <th class="notvisible"><%= t('attributes.company') %></th>
- <th><%= t('attributes.current_sign_in_at') %></th>
- <th class="notvisible"><%= t('attributes.sign_in_count') %></th>
- <th><%= t('wobauth.action')%></th>
- </tr>
-</thead>
-<tbody>
+<div data-controller="datatables">
+ <%= content_tag :table, id: :wobauth_users, role: :wobauth_datatable,
+ class: "table table-bordered table-striped",
+ data: {
+ target: 'datatables.datatable',
+ } do %>
+ <thead>
+ <tr>
+ <th><%= t('attributes.name') %></th>
+ <th class="notvisible"><%= t('attributes.sn') %></th>
+ <th class="notvisible"><%= t('attributes.givenname') %></th>
+ <th class="notvisible"><%= t('attributes.title') %></th>
+ <th><%= t('attributes.username') %></th>
+ <th><%= t('attributes.telephone') %></th>
+ <th><%= t('attributes.email') %></th>
+ <th class="notvisible"><%= t('attributes.position') %></th>
+ <th class="notvisible"><%= t('attributes.department') %></th>
+ <th class="notvisible"><%= t('attributes.company') %></th>
+ <th><%= t('attributes.current_sign_in_at') %></th>
+ <th class="notvisible"><%= t('attributes.sign_in_count') %></th>
+ <th><%= t('wobauth.action')%></th>
+ </tr>
+ </thead>
+ <tbody>
-<% @users.each do |user| %>
- <%= content_tag_for(:tr, user) do %>
- <td><%= user %></td>
- <td><%= user.sn %></td>
- <td><%= user.givenname %></td>
- <td><%= user.title %></td>
- <td><%= user.username %></td>
- <td><%= user.telephone %></td>
- <td><%= user.email %></td>
- <td><%= user.position %></td>
- <td><%= user.department %></td>
- <td><%= user.company %></td>
- <td><%= user.current_sign_in_at.try(:to_date) %></td>
- <td><%= user.sign_in_count %></td>
- <td class="nowrap">
- <%= show_link [wobauth, user] %>
- <%= edit_link [wobauth, user] %>
- <%= delete_link [wobauth, user] %>
- </td>
+ <% @users.each do |user| %>
+ <%= content_tag_for(:tr, user) do %>
+ <td><%= user %></td>
+ <td><%= user.sn %></td>
+ <td><%= user.givenname %></td>
+ <td><%= user.title %></td>
+ <td><%= user.username %></td>
+ <td><%= user.telephone %></td>
+ <td><%= user.email %></td>
+ <td><%= user.position %></td>
+ <td><%= user.department %></td>
+ <td><%= user.company %></td>
+ <td><%= user.current_sign_in_at.try(:to_date) %></td>
+ <td><%= user.sign_in_count %></td>
+ <td class="nowrap">
+ <%= show_link [wobauth, user] %>
+ <%= edit_link [wobauth, user] %>
+ <%= delete_link [wobauth, user] %>
+ </td>
+ <% end %>
<% end %>
-<% end %>
-</tbody>
-<% end %>
+ </tbody>
+ <% end %>
+</div>
<br />
<%= back_link %>
<%= new_link [wobauth, Wobauth::User] %>