<commit_before><table id="dt-<%= plural_table_name %>" class="table" style="width: 100%;">
  <thead>
  <tr>
    <%- attributes.reject(&:password_digest?).each do |attribute| -%>
    <th><%= attribute.human_name %></th>
    <%- end -%>
    <th class="text-right"><%%= link_to 'New', new_<%= singular_table_name %>_path, class: 'btn btn-success btn-xs inline_form' %></th>
  </tr>
  </thead>
</table>

<%% provide :scripts do %>
<script type="text/javascript">
    //<![CDATA[
    $(function() {
        function filter_column(column, text) {
          var dt = $('#dt-<%= plural_table_name %>').dataTable().api();
          var col = dt.column(column);

          if (col.search() !== text) {
            col.search(text).draw();
          }
        }

        $('#dt-<%= plural_table_name %>').DataTable({
            dom: '<"panel-body"<"col-sm-6 col-sm-offset-6"fr>>t<"panel-body"<"col-sm-6"i><"col-sm-6"p>>',
            ajax: {
                url: '<%%= api_path %>',
                type: 'POST'
            },
            columns: [
                <%- attributes.reject(&:password_digest?).each do |attribute| -%>
                {
                    // the data to display.
                    data: '<%= attribute.name %>',
                    <%- if attribute.type == :boolean -%>
                    // for booleans, show a checkmark instead of true/false.
                    render: function (data, type) {
                        if (type === 'display')
                            return data ? '<i class="glyphicon glyphicon-ok glyphicon-small"></i>' : '';
                        else
                            return data;
                    },
                    <%- end -%>
                    // can this column be used for sorting?
                    orderable: true,
                    // can this column be used for searching?
                    searchable: true
                },
                <%- end %>
                {
                    orderable: false,
                    searchable: false,
                    data: function (row, type, set, meta) {
                        if (type === 'display') {
                            var ret = '<div class="text-right">';

                            // the show icon.
                            ret += '<a href="javascript:inlineForm(\'' + row.DT_Path + '\')" title="Details" class="btn btn-default btn-xs"><i class="glyphicon glyphicon-zoom-in"></i></a>';

                            // the edit icon.
                            ret += '<a href="javascript:inlineForm(\'' + row.DT_Path + '/edit\')" title="Edit" class="btn btn-default btn-xs"><i class="glyphicon glyphicon-pencil"></i></a>';

                            // the delete icon.
                            ret += '<a href="javascript:inlineAction(\'' + row.DT_Path + '\',\'delete\')" title="Remove" class="btn btn-danger btn-xs" data-confirm="Are you sure you want to remove this <%= singular_table_name.humanize %>?"><i class="glyphicon glyphicon-trash"></i></a>';

                            ret += '</div>';
                            return ret;
                        } else {
                            return row.DT_Path;
                        }
                    }
                }
            ],
            responsive: true,
            serverSide: true
        });<commit_msg>Fix list generating code.<commit_after><table id="dt-<%= plural_table_name %>" class="table" style="width: 100%;">
  <thead>
  <tr>
    <%- attributes.reject(&:password_digest?).each do |attribute| -%>
    <th><%= attribute.human_name %></th>
    <%- end -%>
    <th class="text-right"><%%= link_to 'New', new_<%= singular_table_name %>_path, class: 'btn btn-success btn-xs inline_form' %></th>
  </tr>
  </thead>
</table>

<%% provide :scripts do %>
<script type="text/javascript">
    //<![CDATA[
    $(function() {
        function filter_column(column, text) {
          var dt = $('#dt-<%= plural_table_name %>').dataTable().api();
          var col = dt.column(column);

          if (col.search() !== text) {
            col.search(text).draw();
          }
        }

        $('#dt-<%= plural_table_name %>').DataTable({
            dom: '<"panel-body"<"col-sm-6 col-sm-offset-6"fr>>t<"panel-body"<"col-sm-6"i><"col-sm-6"p>>',
            ajax: {
                url: '<%%= api_path %>',
                type: 'POST'
            },
            columns: [
                <%- attributes.reject(&:password_digest?).each do |attribute| -%>
                {
                    // the data to display.
                    data: '<%= attribute.name %>',
                    <%- if attribute.type == :boolean -%>
                    // for booleans, show a checkmark instead of true/false.
                    render: function (data, type) {
                        if (type === 'display')
                            return data ? '<i class="glyphicon glyphicon-ok glyphicon-small"></i>' : '';
                        else
                            return data;
                    },
                    <%- end -%>
                    // can this column be used for sorting?
                    orderable: true,
                    // can this column be used for searching?
                    searchable: true
                },
                <%- end %>
                {
                    orderable: false,
                    searchable: false,
                    data: function (row, type, set, meta) {
                        if (type === 'display') {
                            var ret = '<div class="text-right">';
                            var p_start = row.DT_Path.indexOf('?');
                            var item_path = p_start >= 0 ? row.DT_Path.substr(0, p_start) : row.DT_Path;
                            var item_params = p_start >= 0 ? row.DT_Path.substr(p_start) : '';

                            // the show icon.
                            ret += '<a href="javascript:inlineForm(\'' + row.DT_Path + '\')" title="Details" class="btn btn-default btn-xs"><i class="glyphicon glyphicon-zoom-in"></i></a>';

                            // the edit icon.
                            ret += '<a href="javascript:inlineForm(\'' + item_path + '/edit' + item_params + '\')" title="Edit" class="btn btn-default btn-xs"><i class="glyphicon glyphicon-pencil"></i></a>';

                            // the delete icon.
                            ret += '<a href="javascript:inlineAction(\'' + row.DT_Path + '\',\'delete\')" title="Remove" class="btn btn-danger btn-xs" data-confirm="Are you sure you want to remove this <%= singular_table_name.humanize %>?"><i class="glyphicon glyphicon-trash"></i></a>';

                            ret += '</div>';
                            return ret;
                        } else {
                            return row.DT_Path;
                        }
                    }
                }
            ],
            responsive: true,
            serverSide: true
        });
{'fraction_non_alphanumeric': 0.15969744541173111, 'fraction_numerical': 0.0024261452832881406, 'mean_word_length': 1.293193717277487, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '400245', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1834, 'n_words': 419}