Sha256: 5128b9c7d5cd1a7a016f9ed11edb3584e062117f414f13dd0bbc0cb09a12f76d

Contents?: true

Size: 1.83 KB

Versions: 4

Compression:

Stored size: 1.83 KB

Contents

<div class="search">

  <div class="column-block">

    <h1>Tags</h1>

    <table id="tags-table" class="table table-condensed mobile-data">
      <thead>
      <tr>
        <th>Tag ID</th>
        <th>Object ID</th>
        <th>Object type</th>
        <th>Tag definition name</th>
      </tr>
      </thead>
      <tbody>
      <tr>
        <td colspan="1" class="dataTables_empty">Loading data from server</td>
      </tr>
      </tbody>
    </table>

  </div>

</div>

<%= javascript_tag do %>

$(document).ready(function() {
  var table = $('#tags-table').DataTable({
    "dom": "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
    "pagingType": <% if @max_nb_records.nil? -%>"simple"<% else -%>"full_numbers"<% end -%>,
    "language": {
    <!-- See DefaultPaginationSqlDaoHelper.java -->
      "info": <% if @max_nb_records.nil? -%>"Showing _START_ to _END_ of <%= number_with_delimiter(Kaui::EngineControllerUtil::SIMPLE_PAGINATION_THRESHOLD) -%>+ entries"<% else -%>"Showing _START_ to _END_ of _TOTAL_ entries"<% end -%>
    },
    "pageLength": <%= @limit %>,
    "displayStart": <%= @offset %>,
    <% unless @ordering.blank? %>
        "order": [[ 0, "<%= @ordering %>" ]],
    <% end %>
    "processing": true,
    "serverSide": true,
    "search": {"search": "<%= @search_query %>"},
    "ajax": "<%= tags_pagination_path(:ordering => @ordering, :format => :json) %>"
  });

  <!-- When we don't know the total number of pages, we need to hide the legend and next button manually -->
  <% if @max_nb_records.nil? %>
    $('#tags-table').on('draw.dt', function() {
      var noMoreData = table.column(0)
                            .data()
                            .length == 0;
      $(".next.paginate_button").toggleClass("disabled", noMoreData);
      $(".dataTables_info").toggle(!noMoreData);
    });
  <% end %>
});
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kaui-3.0.4 app/views/kaui/tags/index.html.erb
kaui-3.0.2 app/views/kaui/tags/index.html.erb
kaui-2.2.1 app/views/kaui/tags/index.html.erb
kaui-3.0.1 app/views/kaui/tags/index.html.erb